allow @all to also include gitweb and daemon

By default, @all does not include gitweb and daemon, but if that's what
you want, you can make it happen...  see GL_ALL_INCLUDES_SPECIAL
variable in conf/example.gitolite.rc
This commit is contained in:
Sitaram Chamarty 2010-08-24 17:17:41 +05:30
parent d78f66af52
commit 6b9e75dfcb
5 changed files with 421 additions and 320 deletions

View file

@ -43,6 +43,12 @@ $REPO_UMASK = 0077; # gets you 'rwx------'
$PROJECTS_LIST = $ENV{HOME} . "/projects.list"; $PROJECTS_LIST = $ENV{HOME} . "/projects.list";
# giving access to @all users (as in "R = @all") in the config normally does
# *not* include the special users "gitweb" and "daemon". If you want @all to
# include these two users, set this variable:
# $GL_ALL_INCLUDES_SPECIAL = 0;
# -------------------------------------- # --------------------------------------
# I see no reason anyone may want to change the gitolite admin directory, but # I see no reason anyone may want to change the gitolite admin directory, but

View file

@ -38,7 +38,7 @@ our $USERNAME_PATT=qr(^\@?[0-9a-zA-Z][0-9a-zA-Z._\@+-]*$); # very simple patter
our $REPOPATT_PATT=qr(^\@?[0-9a-zA-Z[][\\^.$|()[\]*+?{}0-9a-zA-Z._\@/-]*$); our $REPOPATT_PATT=qr(^\@?[0-9a-zA-Z[][\\^.$|()[\]*+?{}0-9a-zA-Z._\@/-]*$);
# these come from the RC file # these come from the RC file
our ($REPO_UMASK, $GL_WILDREPOS, $GL_PACKAGE_CONF, $GL_PACKAGE_HOOKS, $REPO_BASE, $GL_CONF_COMPILED, $GL_BIG_CONFIG, $GL_PERFLOGT, $PROJECTS_LIST); our ($REPO_UMASK, $GL_WILDREPOS, $GL_PACKAGE_CONF, $GL_PACKAGE_HOOKS, $REPO_BASE, $GL_CONF_COMPILED, $GL_BIG_CONFIG, $GL_PERFLOGT, $PROJECTS_LIST, $GL_ALL_INCLUDES_SPECIAL);
our %repos; our %repos;
our %groups; our %groups;
our %repo_config; our %repo_config;
@ -295,8 +295,10 @@ sub new_repo
$perms =~ s/ $g(?!\S)/ $user/ if $cached_groups{$g}{$user}; $perms =~ s/ $g(?!\S)/ $user/ if $cached_groups{$g}{$user};
} }
if ($perms) { if ($perms) {
$r = $user if $perms =~ /^\s*R(?=\s).*\s(\@all|$user)(\s|$)/m; $r ='@all' if $perms =~ /^\s*R(?=\s).*\s\@all(\s|$)/m;
$w = $user if $perms =~ /^\s*RW(?=\s).*\s(\@all|$user)(\s|$)/m; $r = $user if $perms =~ /^\s*R(?=\s).*\s$user(\s|$)/m;
$w ='@all' if $perms =~ /^\s*RW(?=\s).*\s\@all(\s|$)/m;
$w = $user if $perms =~ /^\s*RW(?=\s).*\s$user(\s|$)/m;
} }
} }
@ -684,7 +686,10 @@ sub can_read {
my $user = shift || $ENV{GL_USER}; my $user = shift || $ENV{GL_USER};
local $ENV{GL_USER} = $user; local $ENV{GL_USER} = $user;
my ($perm, $creator, $wild) = &repo_rights($repo); my ($perm, $creator, $wild) = &repo_rights($repo);
return $perm =~ /R/; return ( ($GL_ALL_INCLUDES_SPECIAL || $user !~ /^(gitweb|daemon)$/)
? $perm =~ /R/
: $perm =~ /R /
);
} }
# ---------------------------------------------------------------------------- # ----------------------------------------------------------------------------

View file

@ -2,13 +2,22 @@
for wr in 0 1 for wr in 0 1
do do
for bc in 0 1 for bc in 0 1
do
for ais in 0 1
do do
cd $TESTDIR cd $TESTDIR
$TESTDIR/rollback || die "rollback failed" $TESTDIR/rollback || die "rollback failed"
editrc GL_WILDREPOS $wr editrc GL_WILDREPOS $wr
editrc GL_BIG_CONFIG $bc editrc GL_BIG_CONFIG $bc
echo "\$GL_ALL_INCLUDES_SPECIAL = $ais;" | addrc
# ---------- # ----------
name "INTERNAL"
echo|ugc
name "daemon access for testing repo"
runremote ls -al repositories/testing.git/git-daemon-export-ok
[ "$ais" = "0" ] && expect "ls: cannot access repositories/testing.git/git-daemon-export-ok: No such file or directory"
[ "$ais" = "1" ] && expect "gitolite-test gitolite-test .* repositories/testing.git/git-daemon-export-ok"
name "INTERNAL" name "INTERNAL"
echo " echo "
@ -24,9 +33,11 @@ do
runremote ls -al repositories/bar.git/git-daemon-export-ok runremote ls -al repositories/bar.git/git-daemon-export-ok
expect "ls: cannot access repositories/bar.git/git-daemon-export-ok: No such file or directory" expect "ls: cannot access repositories/bar.git/git-daemon-export-ok: No such file or directory"
runremote ls -al projects.list runremote ls -al projects.list
expect "gitolite-test gitolite-test 12 .* projects.list" [ "$ais" = "0" ] && expect "gitolite-test gitolite-test 0 .* projects.list"
[ "$ais" = "1" ] && expect "gitolite-test gitolite-test 12 .* projects.list"
runremote cat projects.list runremote cat projects.list
expect "testing.git" [ "$ais" = "0" ] && notexpect "testing.git"
[ "$ais" = "1" ] && expect "testing.git"
name "add daemon access to bar" name "add daemon access to bar"
echo " echo "
@ -35,7 +46,8 @@ do
runremote ls -al repositories/bar.git/git-daemon-export-ok runremote ls -al repositories/bar.git/git-daemon-export-ok
expect "gitolite-test gitolite-test .* repositories/bar.git/git-daemon-export-ok" expect "gitolite-test gitolite-test .* repositories/bar.git/git-daemon-export-ok"
runremote ls -al projects.list runremote ls -al projects.list
expect "gitolite-test gitolite-test 12 .* projects.list" [ "$ais" = "0" ] && expect "gitolite-test gitolite-test 0 .* projects.list"
[ "$ais" = "1" ] && expect "gitolite-test gitolite-test 12 .* projects.list"
name "add foo with gitweb access" name "add foo with gitweb access"
echo " echo "
@ -50,9 +62,11 @@ do
" | ugc " | ugc
expect_push_ok "master -> master" expect_push_ok "master -> master"
runremote ls -al projects.list runremote ls -al projects.list
expect "gitolite-test gitolite-test 20 .* projects.list" [ "$ais" = "0" ] && expect "gitolite-test gitolite-test 8 .* projects.list"
[ "$ais" = "1" ] && expect "gitolite-test gitolite-test 20 .* projects.list"
runremote cat projects.list runremote cat projects.list
expect "testing.git" [ "$ais" = "0" ] && notexpect "testing.git"
[ "$ais" = "1" ] && expect "testing.git"
expect "foo.git" expect "foo.git"
name "add gitweb access to bar" name "add gitweb access to bar"
@ -62,9 +76,11 @@ do
" | ugc " | ugc
expect_push_ok "master -> master" expect_push_ok "master -> master"
runremote ls -al projects.list runremote ls -al projects.list
expect "gitolite-test gitolite-test 28 .* projects.list" [ "$ais" = "0" ] && expect "gitolite-test gitolite-test 16 .* projects.list"
[ "$ais" = "1" ] && expect "gitolite-test gitolite-test 28 .* projects.list"
runremote cat projects.list runremote cat projects.list
expect "testing.git" [ "$ais" = "0" ] && notexpect "testing.git"
[ "$ais" = "1" ] && expect "testing.git"
expect "foo.git" expect "foo.git"
expect "bar.git" expect "bar.git"
@ -79,9 +95,11 @@ do
expect_push_ok "master -> master" expect_push_ok "master -> master"
expect "remote: Initialized empty Git repository in /home/gitolite-test/repositories/baz.git/" expect "remote: Initialized empty Git repository in /home/gitolite-test/repositories/baz.git/"
runremote ls -al projects.list runremote ls -al projects.list
expect "gitolite-test gitolite-test 36 .* projects.list" [ "$ais" = "0" ] && expect "gitolite-test gitolite-test 24 .* projects.list"
[ "$ais" = "1" ] && expect "gitolite-test gitolite-test 36 .* projects.list"
runremote cat projects.list runremote cat projects.list
expect "testing.git" [ "$ais" = "0" ] && notexpect "testing.git"
[ "$ais" = "1" ] && expect "testing.git"
expect "foo.git" expect "foo.git"
expect "bar.git" expect "bar.git"
expect "baz.git" expect "baz.git"
@ -112,4 +130,5 @@ do
name INTERNAL name INTERNAL
done done
done
done done

View file

@ -1,10 +1,13 @@
# vim: syn=sh: # vim: syn=sh:
for bc in 0 1 for bc in 0 1
do do
for ais in 0 1
do
cd $TESTDIR cd $TESTDIR
$TESTDIR/rollback || die "rollback failed" $TESTDIR/rollback || die "rollback failed"
editrc GL_WILDREPOS 1 editrc GL_WILDREPOS 1
editrc GL_BIG_CONFIG $bc editrc GL_BIG_CONFIG $bc
echo "\$GL_ALL_INCLUDES_SPECIAL = $ais;" | addrc
# ---------- # ----------
@ -24,9 +27,11 @@ do
runremote ls -al repositories/bar/u1/try1.git/git-daemon-export-ok runremote ls -al repositories/bar/u1/try1.git/git-daemon-export-ok
expect "ls: cannot access repositories/bar/u1/try1.git/git-daemon-export-ok: No such file or directory" expect "ls: cannot access repositories/bar/u1/try1.git/git-daemon-export-ok: No such file or directory"
runremote ls -al projects.list runremote ls -al projects.list
expect "gitolite-test gitolite-test 12 .* projects.list" [ "$ais" = "0" ] && expect "gitolite-test gitolite-test 0 .* projects.list"
[ "$ais" = "1" ] && expect "gitolite-test gitolite-test 12 .* projects.list"
runremote cat projects.list runremote cat projects.list
expect "testing.git" [ "$ais" = "0" ] && notexpect "testing.git"
[ "$ais" = "1" ] && expect "testing.git"
notexpect "bar/u1/try1.git" notexpect "bar/u1/try1.git"
name "add daemon access" name "add daemon access"
@ -36,16 +41,19 @@ do
runremote ls -al repositories/bar/u1/try1.git/git-daemon-export-ok runremote ls -al repositories/bar/u1/try1.git/git-daemon-export-ok
expect "gitolite-test gitolite-test .* repositories/bar/u1/try1.git/git-daemon-export-ok" expect "gitolite-test gitolite-test .* repositories/bar/u1/try1.git/git-daemon-export-ok"
runremote ls -al projects.list runremote ls -al projects.list
expect "gitolite-test gitolite-test 12 .* projects.list" [ "$ais" = "0" ] && expect "gitolite-test gitolite-test 0 .* projects.list"
[ "$ais" = "1" ] && expect "gitolite-test gitolite-test 12 .* projects.list"
name "add one more repo" name "add one more repo"
runlocal git ls-remote u1:bar/u1/try2 runlocal git ls-remote u1:bar/u1/try2
runremote ls -al repositories/bar/u1/try2.git/git-daemon-export-ok runremote ls -al repositories/bar/u1/try2.git/git-daemon-export-ok
expect "gitolite-test gitolite-test .* repositories/bar/u1/try2.git/git-daemon-export-ok" expect "gitolite-test gitolite-test .* repositories/bar/u1/try2.git/git-daemon-export-ok"
runremote ls -al projects.list runremote ls -al projects.list
expect "gitolite-test gitolite-test 12 .* projects.list" [ "$ais" = "0" ] && expect "gitolite-test gitolite-test 0 .* projects.list"
[ "$ais" = "1" ] && expect "gitolite-test gitolite-test 12 .* projects.list"
runremote cat projects.list runremote cat projects.list
expect "testing.git" [ "$ais" = "0" ] && notexpect "testing.git"
[ "$ais" = "1" ] && expect "testing.git"
notexpect "bar/u1/try1.git" notexpect "bar/u1/try1.git"
notexpect "bar/u1/try2.git" notexpect "bar/u1/try2.git"
@ -55,9 +63,11 @@ do
bar/u1/try3 = \"this is bar/u1/try3\" bar/u1/try3 = \"this is bar/u1/try3\"
" | ugc " | ugc
runremote ls -al projects.list runremote ls -al projects.list
expect "gitolite-test gitolite-test 28 .* projects.list" [ "$ais" = "0" ] && expect "gitolite-test gitolite-test 16 .* projects.list"
[ "$ais" = "1" ] && expect "gitolite-test gitolite-test 28 .* projects.list"
runremote cat projects.list runremote cat projects.list
expect "testing.git" [ "$ais" = "0" ] && notexpect "testing.git"
[ "$ais" = "1" ] && expect "testing.git"
expect "bar/u1/try1.git" expect "bar/u1/try1.git"
notexpect "bar/u1/try2.git" notexpect "bar/u1/try2.git"
notexpect "bar/u1/try3.git" notexpect "bar/u1/try3.git"
@ -69,9 +79,11 @@ do
runremote ls -al repositories/bar/u1/try3.git/git-daemon-export-ok runremote ls -al repositories/bar/u1/try3.git/git-daemon-export-ok
expect "gitolite-test gitolite-test .* repositories/bar/u1/try3.git/git-daemon-export-ok" expect "gitolite-test gitolite-test .* repositories/bar/u1/try3.git/git-daemon-export-ok"
runremote ls -al projects.list runremote ls -al projects.list
expect "gitolite-test gitolite-test 28 .* projects.list" [ "$ais" = "0" ] && expect "gitolite-test gitolite-test 16 .* projects.list"
[ "$ais" = "1" ] && expect "gitolite-test gitolite-test 28 .* projects.list"
runremote cat projects.list runremote cat projects.list
expect "testing.git" [ "$ais" = "0" ] && notexpect "testing.git"
[ "$ais" = "1" ] && expect "testing.git"
expect "bar/u1/try1.git" expect "bar/u1/try1.git"
notexpect "bar/u1/try2.git" notexpect "bar/u1/try2.git"
notexpect "bar/u1/try3.git" notexpect "bar/u1/try3.git"
@ -86,9 +98,11 @@ do
runremote ls -al repositories/bar/u1/try3.git/git-daemon-export-ok runremote ls -al repositories/bar/u1/try3.git/git-daemon-export-ok
expect "gitolite-test gitolite-test .* repositories/bar/u1/try3.git/git-daemon-export-ok" expect "gitolite-test gitolite-test .* repositories/bar/u1/try3.git/git-daemon-export-ok"
runremote ls -al projects.list runremote ls -al projects.list
expect "gitolite-test gitolite-test 44 .* projects.list" [ "$ais" = "0" ] && expect "gitolite-test gitolite-test 32 .* projects.list"
[ "$ais" = "1" ] && expect "gitolite-test gitolite-test 44 .* projects.list"
runremote cat projects.list runremote cat projects.list
expect "testing.git" [ "$ais" = "0" ] && notexpect "testing.git"
[ "$ais" = "1" ] && expect "testing.git"
expect "bar/u1/try1.git" expect "bar/u1/try1.git"
notexpect "bar/u1/try2.git" notexpect "bar/u1/try2.git"
expect "bar/u1/try3.git" expect "bar/u1/try3.git"
@ -105,7 +119,8 @@ do
expect "\[gitweb\]" expect "\[gitweb\]"
expect "owner = owner2" expect "owner = owner2"
runremote ls -al projects.list runremote ls -al projects.list
expect "gitolite-test gitolite-test 60 .* projects.list" [ "$ais" = "0" ] && expect "gitolite-test gitolite-test 48 .* projects.list"
[ "$ais" = "1" ] && expect "gitolite-test gitolite-test 60 .* projects.list"
runremote cat projects.list runremote cat projects.list
expect "bar/u1/try2.git" expect "bar/u1/try2.git"
@ -116,9 +131,11 @@ do
" | ugc " | ugc
expect_push_ok "master -> master" expect_push_ok "master -> master"
runremote ls -al projects.list runremote ls -al projects.list
expect "gitolite-test gitolite-test 60 .* projects.list" [ "$ais" = "0" ] && expect "gitolite-test gitolite-test 48 .* projects.list"
[ "$ais" = "1" ] && expect "gitolite-test gitolite-test 60 .* projects.list"
runremote cat projects.list runremote cat projects.list
expect "testing.git" [ "$ais" = "0" ] && notexpect "testing.git"
[ "$ais" = "1" ] && expect "testing.git"
expect "bar/u1/try1.git" expect "bar/u1/try1.git"
expect "bar/u1/try2.git" expect "bar/u1/try2.git"
expect "bar/u1/try3.git" expect "bar/u1/try3.git"
@ -126,9 +143,11 @@ do
name "add try4 project" name "add try4 project"
runlocal git ls-remote u1:bar/u1/try4 runlocal git ls-remote u1:bar/u1/try4
runremote ls -al projects.list runremote ls -al projects.list
expect "gitolite-test gitolite-test 76 .* projects.list" [ "$ais" = "0" ] && expect "gitolite-test gitolite-test 64 .* projects.list"
[ "$ais" = "1" ] && expect "gitolite-test gitolite-test 76 .* projects.list"
runremote cat projects.list runremote cat projects.list
expect "testing.git" [ "$ais" = "0" ] && notexpect "testing.git"
[ "$ais" = "1" ] && expect "testing.git"
expect "bar/u1/try1.git" expect "bar/u1/try1.git"
expect "bar/u1/try2.git" expect "bar/u1/try2.git"
expect "bar/u1/try3.git" expect "bar/u1/try3.git"
@ -137,4 +156,5 @@ do
expect "Unnamed repository; edit this file 'description' to name the repository." expect "Unnamed repository; edit this file 'description' to name the repository."
name "INTERNAL" name "INTERNAL"
done
done done

View file

@ -1,10 +1,13 @@
# vim: syn=sh: # vim: syn=sh:
for bc in 0 1 for bc in 0 1
do do
for ais in 0 1
do
cd $TESTDIR cd $TESTDIR
$TESTDIR/rollback || die "rollback failed" $TESTDIR/rollback || die "rollback failed"
editrc GL_WILDREPOS 1 editrc GL_WILDREPOS 1
editrc GL_BIG_CONFIG $bc editrc GL_BIG_CONFIG $bc
echo "\$GL_ALL_INCLUDES_SPECIAL = $ais;" | addrc
name "INTERNAL" name "INTERNAL"
echo " echo "
@ -25,7 +28,8 @@ do
runremote ls -al repositories/bar/u1/try1.git/git-daemon-export-ok runremote ls -al repositories/bar/u1/try1.git/git-daemon-export-ok
expect "ls: cannot access repositories/bar/u1/try1.git/git-daemon-export-ok: No such file or directory" expect "ls: cannot access repositories/bar/u1/try1.git/git-daemon-export-ok: No such file or directory"
runremote ls -al projects.list runremote ls -al projects.list
expect "gitolite-test gitolite-test 12 .* projects.list" [ "$ais" = "0" ] && expect "gitolite-test gitolite-test 0 .* projects.list"
[ "$ais" = "1" ] && expect "gitolite-test gitolite-test 12 .* projects.list"
runremote cat projects.list runremote cat projects.list
notexpect "bar/u1/try1.git" notexpect "bar/u1/try1.git"
@ -33,7 +37,8 @@ do
runremote ls -al repositories/bar/u1/try2.git/git-daemon-export-ok runremote ls -al repositories/bar/u1/try2.git/git-daemon-export-ok
expect "ls: cannot access repositories/bar/u1/try2.git/git-daemon-export-ok: No such file or directory" expect "ls: cannot access repositories/bar/u1/try2.git/git-daemon-export-ok: No such file or directory"
runremote ls -al projects.list runremote ls -al projects.list
expect "gitolite-test gitolite-test 12 .* projects.list" [ "$ais" = "0" ] && expect "gitolite-test gitolite-test 0 .* projects.list"
[ "$ais" = "1" ] && expect "gitolite-test gitolite-test 12 .* projects.list"
runremote cat projects.list runremote cat projects.list
notexpect "bar/u1/try2.git" notexpect "bar/u1/try2.git"
@ -44,7 +49,8 @@ do
runremote ls -al repositories/bar/u1/try1.git/git-daemon-export-ok runremote ls -al repositories/bar/u1/try1.git/git-daemon-export-ok
expect "gitolite-test gitolite-test .* repositories/bar/u1/try1.git/git-daemon-export-ok" expect "gitolite-test gitolite-test .* repositories/bar/u1/try1.git/git-daemon-export-ok"
runremote ls -al projects.list runremote ls -al projects.list
expect "gitolite-test gitolite-test 12 .* projects.list" [ "$ais" = "0" ] && expect "gitolite-test gitolite-test 0 .* projects.list"
[ "$ais" = "1" ] && expect "gitolite-test gitolite-test 12 .* projects.list"
runremote cat projects.list runremote cat projects.list
notexpect "bar/u1/try1.git" notexpect "bar/u1/try1.git"
@ -55,7 +61,8 @@ do
runremote ls -al repositories/bar/u1/try2.git/git-daemon-export-ok runremote ls -al repositories/bar/u1/try2.git/git-daemon-export-ok
expect "ls: cannot access repositories/bar/u1/try2.git/git-daemon-export-ok: No such file or directory" expect "ls: cannot access repositories/bar/u1/try2.git/git-daemon-export-ok: No such file or directory"
runremote ls -al projects.list runremote ls -al projects.list
expect "gitolite-test gitolite-test 28 .* projects.list" [ "$ais" = "0" ] && expect "gitolite-test gitolite-test 16 .* projects.list"
[ "$ais" = "1" ] && expect "gitolite-test gitolite-test 28 .* projects.list"
runremote cat projects.list runremote cat projects.list
expect "bar/u1/try2.git" expect "bar/u1/try2.git"
@ -66,7 +73,8 @@ do
runremote ls -al repositories/bar/u1/try3.git/git-daemon-export-ok runremote ls -al repositories/bar/u1/try3.git/git-daemon-export-ok
expect "gitolite-test gitolite-test .* repositories/bar/u1/try3.git/git-daemon-export-ok" expect "gitolite-test gitolite-test .* repositories/bar/u1/try3.git/git-daemon-export-ok"
runremote ls -al projects.list runremote ls -al projects.list
expect "gitolite-test gitolite-test 28 .* projects.list" [ "$ais" = "0" ] && expect "gitolite-test gitolite-test 16 .* projects.list"
[ "$ais" = "1" ] && expect "gitolite-test gitolite-test 28 .* projects.list"
runremote cat projects.list runremote cat projects.list
notexpect "bar/u1/try3.git" notexpect "bar/u1/try3.git"
@ -77,7 +85,8 @@ do
runremote ls -al repositories/bar/u1/try4.git/git-daemon-export-ok runremote ls -al repositories/bar/u1/try4.git/git-daemon-export-ok
expect "ls: cannot access repositories/bar/u1/try4.git/git-daemon-export-ok: No such file or directory" expect "ls: cannot access repositories/bar/u1/try4.git/git-daemon-export-ok: No such file or directory"
runremote ls -al projects.list runremote ls -al projects.list
expect "gitolite-test gitolite-test 44 .* projects.list" [ "$ais" = "0" ] && expect "gitolite-test gitolite-test 32 .* projects.list"
[ "$ais" = "1" ] && expect "gitolite-test gitolite-test 44 .* projects.list"
runremote cat projects.list runremote cat projects.list
expect "bar/u1/try4.git" expect "bar/u1/try4.git"
@ -88,7 +97,8 @@ do
runremote ls -al repositories/bar/u1/try5.git/git-daemon-export-ok runremote ls -al repositories/bar/u1/try5.git/git-daemon-export-ok
expect "gitolite-test gitolite-test .* repositories/bar/u1/try5.git/git-daemon-export-ok" expect "gitolite-test gitolite-test .* repositories/bar/u1/try5.git/git-daemon-export-ok"
runremote ls -al projects.list runremote ls -al projects.list
expect "gitolite-test gitolite-test 60 .* projects.list" [ "$ais" = "0" ] && expect "gitolite-test gitolite-test 48 .* projects.list"
[ "$ais" = "1" ] && expect "gitolite-test gitolite-test 60 .* projects.list"
runremote cat projects.list runremote cat projects.list
expect "bar/u1/try5.git" expect "bar/u1/try5.git"
@ -99,7 +109,8 @@ do
runremote ls -al repositories/bar/u1/try6.git/git-daemon-export-ok runremote ls -al repositories/bar/u1/try6.git/git-daemon-export-ok
expect "gitolite-test gitolite-test .* repositories/bar/u1/try6.git/git-daemon-export-ok" expect "gitolite-test gitolite-test .* repositories/bar/u1/try6.git/git-daemon-export-ok"
runremote ls -al projects.list runremote ls -al projects.list
expect "gitolite-test gitolite-test 76 .* projects.list" [ "$ais" = "0" ] && expect "gitolite-test gitolite-test 64 .* projects.list"
[ "$ais" = "1" ] && expect "gitolite-test gitolite-test 76 .* projects.list"
runremote cat projects.list runremote cat projects.list
expect "bar/u1/try6.git" expect "bar/u1/try6.git"
@ -110,10 +121,50 @@ do
runremote ls -al repositories/bar/u1/try6.git/git-daemon-export-ok runremote ls -al repositories/bar/u1/try6.git/git-daemon-export-ok
expect "ls: cannot access repositories/bar/u1/try6.git/git-daemon-export-ok: No such file or directory" expect "ls: cannot access repositories/bar/u1/try6.git/git-daemon-export-ok: No such file or directory"
runremote ls -al projects.list runremote ls -al projects.list
expect "gitolite-test gitolite-test 60 .* projects.list" [ "$ais" = "0" ] && expect "gitolite-test gitolite-test 48 .* projects.list"
[ "$ais" = "1" ] && expect "gitolite-test gitolite-test 60 .* projects.list"
runremote cat projects.list runremote cat projects.list
notexpect "bar/u1/try6.git" notexpect "bar/u1/try6.git"
name "set default access to @all only"
echo "\$GL_WILDREPOS_DEFPERMS = 'R @all';" | addrc
runlocal git ls-remote u1:bar/u1/try7
runremote ls -al repositories/bar/u1/try7.git/git-daemon-export-ok
[ "$ais" = "0" ] && expect "ls: cannot access repositories/bar/u1/try7.git/git-daemon-export-ok: No such file or directory"
[ "$ais" = "1" ] && expect "gitolite-test gitolite-test .* repositories/bar/u1/try7.git/git-daemon-export-ok"
runremote ls -al projects.list
[ "$ais" = "0" ] && expect "gitolite-test gitolite-test 48 .* projects.list"
[ "$ais" = "1" ] && expect "gitolite-test gitolite-test 76 .* projects.list"
runremote cat projects.list
[ "$ais" = "0" ] && notexpect "bar/u1/try7.git"
[ "$ais" = "1" ] && expect "bar/u1/try7.git"
name "set default access to daemon only"
echo "\$GL_WILDREPOS_DEFPERMS = 'R daemon';" | addrc
runlocal git ls-remote u1:bar/u1/try8
runremote ls -al repositories/bar/u1/try8.git/git-daemon-export-ok
expect "gitolite-test gitolite-test .* repositories/bar/u1/try8.git/git-daemon-export-ok"
runremote ls -al projects.list
[ "$ais" = "0" ] && expect "gitolite-test gitolite-test 48 .* projects.list"
[ "$ais" = "1" ] && expect "gitolite-test gitolite-test 76 .* projects.list"
runremote cat projects.list
notexpect "bar/u1/try8.git"
name "set default access to gitweb only"
echo "\$GL_WILDREPOS_DEFPERMS = 'R gitweb';" | addrc
runlocal git ls-remote u1:bar/u1/try9
runremote ls -al repositories/bar/u1/try9.git/git-daemon-export-ok
expect "ls: cannot access repositories/bar/u1/try9.git/git-daemon-export-ok: No such file or directory"
runremote ls -al projects.list
[ "$ais" = "0" ] && expect "gitolite-test gitolite-test 64 .* projects.list"
[ "$ais" = "1" ] && expect "gitolite-test gitolite-test 92 .* projects.list"
runremote cat projects.list
expect "bar/u1/try9.git"
name "INTERNAL" name "INTERNAL"
done
done done