chiark / gitweb /
git-daemon: add Makefile and documentation.
[userv-utils.git] / git-daemon / git-urlmap
index 61c376cbe9328f4dfc340acb63e825ffa4350202..cf8b55784499a71240ea7052819d62a6b59fdfe5 100644 (file)
@@ -1,27 +1,46 @@
-# Example configuration file for the userv git daemon.
+# Configuration file for the userv git daemon.
 #
 # This was written by Tony Finch <dot@dotat.at>
 # You may do anything with it, at your own risk.
 # http://creativecommons.org/publicdomain/zero/1.0/
+#
+# This is a perl script which is expected to set a few variables
+# to locate the requested repository.
+#
+# REQUEST VARIABLES
+#  $service - normally "git-upload-pack"
+#    `git daemon --help` describes other possible services
+#  $host
+#  $path
+#  $uri     = git://$host/$path
+#  $_       = $uri
+#
+# CONNECTION VARIABLES
+#  $client_addr
+#  $client_port
+#  $client      = [$client_addr]:$client_port
+#  $server_addr
+#  $server_port
+#  $server      = [$server_addr]:$server_port
+#
+# OUTPUT VARIABLES
+#  $user - who runs the service
+#  $dir  - may be:
+#    * an absolute path
+#    * a path relative to the user's home directory
+#    * equivalently, a path starting ~/
+#  $repo - if set, the repository's path is $dir/$repo
+#          otherwise, the repository's path is just $dir
+#  $check_export - whether to check for a git-daemon-export-ok file
+#                  (default false)
+#  $check_repo   - whether to restrict the syntax of $repo
+#                  (default true)
+#  @opts - options for the service command
 
-if ($host eq 'git.chiark.greenend.org.uk') {
-    if ($path =~ m{^~([^/]*)/(.*)}) {
-        $user = $1;
-        $dir = 'public-git';
-        $repo = $2;
-    } else {
-        $user = 'webmaster';
-        $dir = '/u2/git-repos';
-        $repo = $path;
-    }
-} elsif (m{^git://cabal[.]greenend[.]org[.]uk/~([^/]*)/(.*)$}) {
+if ($path =~ m{^~([^/]*)/(.*)}) {
     $user = $1;
-    $dir = 'cabal-git';
-    $repo = $2;
-} elsif ($host eq 'dotat.at') {
-    $user = 'fanf';
     $dir = 'public-git';
-    $repo = $path;
+    $repo = $2;
 }
 
 # end