From 993934a558804b723817da759b0d2590e8c90277 Mon Sep 17 00:00:00 2001 From: "martin f. krafft" Date: Thu, 27 May 2010 19:20:37 +0200 Subject: [PATCH] simplify repo auth for gitweb --- gitweb.conf | 23 +---------------------- 1 file changed, 1 insertion(+), 22 deletions(-) diff --git a/gitweb.conf b/gitweb.conf index bf549aa..3dcc651 100644 --- a/gitweb.conf +++ b/gitweb.conf @@ -16,25 +16,4 @@ $feature{'pathinfo'}{'default'} = [1]; $feature{'forks'}{'default'} = [1]; $prevent_xss = 1; -my $gl_conf_compiled = "/srv/git/.gitolite/conf/gitolite.conf-compiled.pm"; -my $username = $cgi->remote_user; - -our %repos; -die "parse $gl_conf_compiled failed: " . ($! or $@) unless do $gl_conf_compiled; - -$export_auth_hook = sub { -# open FILE, ">>/tmp/gitweb.auth" or die $!; - - my $reponame = "$vhostdir/$pubdir/" . shift; - # gitweb passes us the full repo path; so we strip the beginning... - $reponame =~ s/\Q$projectroot\E\/?//; - # ...and the end, to get the repo name as it is specified in gitolite conf - $reponame =~ s/\.git$//; - -# use Data::Dumper; -# print FILE Dumper($username, $reponame, $repos); -# close FILE; - - return exists $repos{$reponame}{R}{$username} - || exists $repos{$reponame}{R}{'@all'}; -}; +$export_auth_hook = sub { return -e "$_[0]/git-daemon-export-ok"; }; -- 2.39.5