X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ian/git?p=userv-utils.git;a=blobdiff_plain;f=git-daemon%2Fgit-daemon-urlmap.pl;h=61c376cbe9328f4dfc340acb63e825ffa4350202;hp=18bf722f8b0e1f36bc2a5d2516234e2529f6caf1;hb=3b32ef57ecb04c10f67ea6f424cf599aa2d07aef;hpb=6fe98f4a5ae10ba602534559e8685e7979f12be3 diff --git a/git-daemon/git-daemon-urlmap.pl b/git-daemon/git-daemon-urlmap.pl index 18bf722..61c376c 100644 --- a/git-daemon/git-daemon-urlmap.pl +++ b/git-daemon/git-daemon-urlmap.pl @@ -1,20 +1,27 @@ -# Configuration file for the userv git daemon. +# Example configuration file for the userv git daemon. # # This was written by Tony Finch # You may do anything with it, at your own risk. # http://creativecommons.org/publicdomain/zero/1.0/ -use warnings; -use strict; - -my $g = qr{[0-9a-z_-]+[.]git}; -my $u = qr{[0-9a-z]+}; - -return "fanf" => "~fanf/public-git/$1" if m{^git://dotat[.]at/($g)$}; -return "webmaster" => "/u2/git-repos$1" if m{^git://git[.]chiark[.]greenend[.]org[.]uk/($g)$}; -return "$1" => "~$1/public-git/$2" if m{^git://git[.]chiark[.]greenend[.]org[.]uk/~($u)/($g)$}; -return "$1" => "~$1/cabal-git/$2" if m{^git://cabal[.]greenend[.]org[.]uk/~($u)/($g)$}; - -return undef; +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/~([^/]*)/(.*)$}) { + $user = $1; + $dir = 'cabal-git'; + $repo = $2; +} elsif ($host eq 'dotat.at') { + $user = 'fanf'; + $dir = 'public-git'; + $repo = $path; +} # end