git-daemon: add Makefile and documentation.
[userv-utils] / git-daemon / git-urlmap
CommitLineData
e9fec26a 1# Configuration file for the userv git daemon.
6fe98f4a
TF
2#
3# This was written by Tony Finch <dot@dotat.at>
4# You may do anything with it, at your own risk.
5# http://creativecommons.org/publicdomain/zero/1.0/
e9fec26a
TF
6#
7# This is a perl script which is expected to set a few variables
8# to locate the requested repository.
9#
10# REQUEST VARIABLES
11# $service - normally "git-upload-pack"
12# `git daemon --help` describes other possible services
13# $host
14# $path
15# $uri = git://$host/$path
16# $_ = $uri
17#
18# CONNECTION VARIABLES
19# $client_addr
20# $client_port
21# $client = [$client_addr]:$client_port
22# $server_addr
23# $server_port
24# $server = [$server_addr]:$server_port
25#
26# OUTPUT VARIABLES
27# $user - who runs the service
28# $dir - may be:
29# * an absolute path
30# * a path relative to the user's home directory
31# * equivalently, a path starting ~/
32# $repo - if set, the repository's path is $dir/$repo
33# otherwise, the repository's path is just $dir
34# $check_export - whether to check for a git-daemon-export-ok file
35# (default false)
36# $check_repo - whether to restrict the syntax of $repo
37# (default true)
38# @opts - options for the service command
6fe98f4a 39
e9fec26a 40if ($path =~ m{^~([^/]*)/(.*)}) {
18c4999f 41 $user = $1;
18c4999f 42 $dir = 'public-git';
e9fec26a 43 $repo = $2;
18c4999f 44}
6fe98f4a
TF
45
46# end