chiark / gitweb /
git-daemon: add Makefile and documentation.
[userv-utils.git] / git-daemon / git-urlmap
1 # Configuration file for the userv git daemon.
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/
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
39
40 if ($path =~ m{^~([^/]*)/(.*)}) {
41     $user = $1;
42     $dir = 'public-git';
43     $repo = $2;
44 }
45
46 # end