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:
parent
d78f66af52
commit
6b9e75dfcb
|
@ -43,6 +43,12 @@ $REPO_UMASK = 0077; # gets you 'rwx------'
|
|||
|
||||
$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
|
||||
|
|
|
@ -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._\@/-]*$);
|
||||
|
||||
# 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 %groups;
|
||||
our %repo_config;
|
||||
|
@ -295,8 +295,10 @@ sub new_repo
|
|||
$perms =~ s/ $g(?!\S)/ $user/ if $cached_groups{$g}{$user};
|
||||
}
|
||||
if ($perms) {
|
||||
$r = $user if $perms =~ /^\s*R(?=\s).*\s(\@all|$user)(\s|$)/m;
|
||||
$w = $user if $perms =~ /^\s*RW(?=\s).*\s(\@all|$user)(\s|$)/m;
|
||||
$r ='@all' if $perms =~ /^\s*R(?=\s).*\s\@all(\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};
|
||||
local $ENV{GL_USER} = $user;
|
||||
my ($perm, $creator, $wild) = &repo_rights($repo);
|
||||
return $perm =~ /R/;
|
||||
return ( ($GL_ALL_INCLUDES_SPECIAL || $user !~ /^(gitweb|daemon)$/)
|
||||
? $perm =~ /R/
|
||||
: $perm =~ /R /
|
||||
);
|
||||
}
|
||||
|
||||
# ----------------------------------------------------------------------------
|
||||
|
|
|
@ -3,113 +3,132 @@ for wr in 0 1
|
|||
do
|
||||
for bc in 0 1
|
||||
do
|
||||
cd $TESTDIR
|
||||
$TESTDIR/rollback || die "rollback failed"
|
||||
editrc GL_WILDREPOS $wr
|
||||
editrc GL_BIG_CONFIG $bc
|
||||
for ais in 0 1
|
||||
do
|
||||
cd $TESTDIR
|
||||
$TESTDIR/rollback || die "rollback failed"
|
||||
editrc GL_WILDREPOS $wr
|
||||
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"
|
||||
echo "
|
||||
@leads = u1 u2
|
||||
@devs = u1 u2 u3 u4
|
||||
name "INTERNAL"
|
||||
echo "
|
||||
@leads = u1 u2
|
||||
@devs = u1 u2 u3 u4
|
||||
|
||||
@gbar = bar
|
||||
repo @gbar
|
||||
RW+ = @leads
|
||||
RW = @devs
|
||||
" | ugc
|
||||
expect_push_ok "master -> master"
|
||||
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"
|
||||
runremote ls -al projects.list
|
||||
expect "gitolite-test gitolite-test 12 .* projects.list"
|
||||
runremote cat projects.list
|
||||
expect "testing.git"
|
||||
@gbar = bar
|
||||
repo @gbar
|
||||
RW+ = @leads
|
||||
RW = @devs
|
||||
" | ugc
|
||||
expect_push_ok "master -> master"
|
||||
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"
|
||||
runremote ls -al 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
|
||||
[ "$ais" = "0" ] && notexpect "testing.git"
|
||||
[ "$ais" = "1" ] && expect "testing.git"
|
||||
|
||||
name "add daemon access to bar"
|
||||
echo "
|
||||
R = daemon
|
||||
" | ugc
|
||||
runremote ls -al repositories/bar.git/git-daemon-export-ok
|
||||
expect "gitolite-test gitolite-test .* repositories/bar.git/git-daemon-export-ok"
|
||||
runremote ls -al projects.list
|
||||
expect "gitolite-test gitolite-test 12 .* projects.list"
|
||||
name "add daemon access to bar"
|
||||
echo "
|
||||
R = daemon
|
||||
" | ugc
|
||||
runremote ls -al repositories/bar.git/git-daemon-export-ok
|
||||
expect "gitolite-test gitolite-test .* repositories/bar.git/git-daemon-export-ok"
|
||||
runremote ls -al 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"
|
||||
echo "
|
||||
@leads = u1 u2
|
||||
@devs = u1 u2 u3 u4
|
||||
name "add foo with gitweb access"
|
||||
echo "
|
||||
@leads = u1 u2
|
||||
@devs = u1 u2 u3 u4
|
||||
|
||||
@gfoo = foo
|
||||
repo @gfoo
|
||||
RW+ = @leads
|
||||
RW = @devs
|
||||
R = gitweb
|
||||
" | ugc
|
||||
expect_push_ok "master -> master"
|
||||
runremote ls -al projects.list
|
||||
expect "gitolite-test gitolite-test 20 .* projects.list"
|
||||
runremote cat projects.list
|
||||
expect "testing.git"
|
||||
expect "foo.git"
|
||||
@gfoo = foo
|
||||
repo @gfoo
|
||||
RW+ = @leads
|
||||
RW = @devs
|
||||
R = gitweb
|
||||
" | ugc
|
||||
expect_push_ok "master -> master"
|
||||
runremote ls -al 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
|
||||
[ "$ais" = "0" ] && notexpect "testing.git"
|
||||
[ "$ais" = "1" ] && expect "testing.git"
|
||||
expect "foo.git"
|
||||
|
||||
name "add gitweb access to bar"
|
||||
echo "
|
||||
repo @gbar
|
||||
R = gitweb
|
||||
" | ugc
|
||||
expect_push_ok "master -> master"
|
||||
runremote ls -al projects.list
|
||||
expect "gitolite-test gitolite-test 28 .* projects.list"
|
||||
runremote cat projects.list
|
||||
expect "testing.git"
|
||||
expect "foo.git"
|
||||
expect "bar.git"
|
||||
name "add gitweb access to bar"
|
||||
echo "
|
||||
repo @gbar
|
||||
R = gitweb
|
||||
" | ugc
|
||||
expect_push_ok "master -> master"
|
||||
runremote ls -al 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
|
||||
[ "$ais" = "0" ] && notexpect "testing.git"
|
||||
[ "$ais" = "1" ] && expect "testing.git"
|
||||
expect "foo.git"
|
||||
expect "bar.git"
|
||||
|
||||
name "add repo baz with description"
|
||||
echo "
|
||||
@gbaz = baz
|
||||
repo @gbaz
|
||||
RW = @leads
|
||||
name "add repo baz with description"
|
||||
echo "
|
||||
@gbaz = baz
|
||||
repo @gbaz
|
||||
RW = @leads
|
||||
|
||||
baz = \"this is repo baz\"
|
||||
" | ugc
|
||||
expect_push_ok "master -> master"
|
||||
expect "remote: Initialized empty Git repository in /home/gitolite-test/repositories/baz.git/"
|
||||
runremote ls -al projects.list
|
||||
expect "gitolite-test gitolite-test 36 .* projects.list"
|
||||
runremote cat projects.list
|
||||
expect "testing.git"
|
||||
expect "foo.git"
|
||||
expect "bar.git"
|
||||
expect "baz.git"
|
||||
runremote ls -al repositories/baz.git/description
|
||||
expect "gitolite-test gitolite-test 17 .* repositories/baz.git/description"
|
||||
runremote cat repositories/baz.git/description
|
||||
expect "this is repo baz"
|
||||
baz = \"this is repo baz\"
|
||||
" | ugc
|
||||
expect_push_ok "master -> master"
|
||||
expect "remote: Initialized empty Git repository in /home/gitolite-test/repositories/baz.git/"
|
||||
runremote ls -al 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
|
||||
[ "$ais" = "0" ] && notexpect "testing.git"
|
||||
[ "$ais" = "1" ] && expect "testing.git"
|
||||
expect "foo.git"
|
||||
expect "bar.git"
|
||||
expect "baz.git"
|
||||
runremote ls -al repositories/baz.git/description
|
||||
expect "gitolite-test gitolite-test 17 .* repositories/baz.git/description"
|
||||
runremote cat repositories/baz.git/description
|
||||
expect "this is repo baz"
|
||||
|
||||
name "add owner to testing repo"
|
||||
echo "
|
||||
testing \"sitaram\" = \"this is the testing repo\"
|
||||
" | ugc
|
||||
expect_push_ok "master -> master"
|
||||
runremote ls -al projects.list
|
||||
expect "gitolite-test gitolite-test 36 .* projects.list"
|
||||
runremote cat projects.list
|
||||
expect "testing.git"
|
||||
expect "foo.git"
|
||||
expect "bar.git"
|
||||
expect "baz.git"
|
||||
runremote cat repositories/testing.git/config
|
||||
expect "\[gitweb\]"
|
||||
expect "owner = sitaram"
|
||||
runremote ls -al repositories/testing.git/description
|
||||
expect "gitolite-test gitolite-test 25 .* repositories/testing.git/description"
|
||||
runremote cat repositories/testing.git/description
|
||||
expect "this is the testing repo"
|
||||
name "add owner to testing repo"
|
||||
echo "
|
||||
testing \"sitaram\" = \"this is the testing repo\"
|
||||
" | ugc
|
||||
expect_push_ok "master -> master"
|
||||
runremote ls -al projects.list
|
||||
expect "gitolite-test gitolite-test 36 .* projects.list"
|
||||
runremote cat projects.list
|
||||
expect "testing.git"
|
||||
expect "foo.git"
|
||||
expect "bar.git"
|
||||
expect "baz.git"
|
||||
runremote cat repositories/testing.git/config
|
||||
expect "\[gitweb\]"
|
||||
expect "owner = sitaram"
|
||||
runremote ls -al repositories/testing.git/description
|
||||
expect "gitolite-test gitolite-test 25 .* repositories/testing.git/description"
|
||||
runremote cat repositories/testing.git/description
|
||||
expect "this is the testing repo"
|
||||
|
||||
name INTERNAL
|
||||
name INTERNAL
|
||||
done
|
||||
done
|
||||
done
|
||||
|
|
|
@ -1,140 +1,160 @@
|
|||
# vim: syn=sh:
|
||||
for bc in 0 1
|
||||
do
|
||||
cd $TESTDIR
|
||||
$TESTDIR/rollback || die "rollback failed"
|
||||
editrc GL_WILDREPOS 1
|
||||
editrc GL_BIG_CONFIG $bc
|
||||
for ais in 0 1
|
||||
do
|
||||
cd $TESTDIR
|
||||
$TESTDIR/rollback || die "rollback failed"
|
||||
editrc GL_WILDREPOS 1
|
||||
editrc GL_BIG_CONFIG $bc
|
||||
echo "\$GL_ALL_INCLUDES_SPECIAL = $ais;" | addrc
|
||||
|
||||
# ----------
|
||||
# ----------
|
||||
|
||||
name "INTERNAL"
|
||||
echo "
|
||||
@leads = u1 u2
|
||||
@devs = u1 u2 u3 u4
|
||||
name "INTERNAL"
|
||||
echo "
|
||||
@leads = u1 u2
|
||||
@devs = u1 u2 u3 u4
|
||||
|
||||
@gbar = bar/CREATOR/..*
|
||||
repo @gbar
|
||||
C = @leads
|
||||
RW+ = @leads
|
||||
RW = @devs
|
||||
" | ugc
|
||||
expect_push_ok "master -> master"
|
||||
runlocal git ls-remote u1:bar/u1/try1
|
||||
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"
|
||||
runremote ls -al projects.list
|
||||
expect "gitolite-test gitolite-test 12 .* projects.list"
|
||||
runremote cat projects.list
|
||||
expect "testing.git"
|
||||
notexpect "bar/u1/try1.git"
|
||||
@gbar = bar/CREATOR/..*
|
||||
repo @gbar
|
||||
C = @leads
|
||||
RW+ = @leads
|
||||
RW = @devs
|
||||
" | ugc
|
||||
expect_push_ok "master -> master"
|
||||
runlocal git ls-remote u1:bar/u1/try1
|
||||
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"
|
||||
runremote ls -al 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
|
||||
[ "$ais" = "0" ] && notexpect "testing.git"
|
||||
[ "$ais" = "1" ] && expect "testing.git"
|
||||
notexpect "bar/u1/try1.git"
|
||||
|
||||
name "add daemon access"
|
||||
echo "
|
||||
R = daemon
|
||||
" | ugc
|
||||
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"
|
||||
runremote ls -al projects.list
|
||||
expect "gitolite-test gitolite-test 12 .* projects.list"
|
||||
name "add daemon access"
|
||||
echo "
|
||||
R = daemon
|
||||
" | ugc
|
||||
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"
|
||||
runremote ls -al 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"
|
||||
runlocal git ls-remote u1:bar/u1/try2
|
||||
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"
|
||||
runremote ls -al projects.list
|
||||
expect "gitolite-test gitolite-test 12 .* projects.list"
|
||||
runremote cat projects.list
|
||||
expect "testing.git"
|
||||
notexpect "bar/u1/try1.git"
|
||||
notexpect "bar/u1/try2.git"
|
||||
name "add one more repo"
|
||||
runlocal git ls-remote u1:bar/u1/try2
|
||||
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"
|
||||
runremote ls -al 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
|
||||
[ "$ais" = "0" ] && notexpect "testing.git"
|
||||
[ "$ais" = "1" ] && expect "testing.git"
|
||||
notexpect "bar/u1/try1.git"
|
||||
notexpect "bar/u1/try2.git"
|
||||
|
||||
name "add descriptions for try1 and try3 and compile"
|
||||
echo "
|
||||
bar/u1/try1 = \"this is bar/u1/try1\"
|
||||
bar/u1/try3 = \"this is bar/u1/try3\"
|
||||
" | ugc
|
||||
runremote ls -al projects.list
|
||||
expect "gitolite-test gitolite-test 28 .* projects.list"
|
||||
runremote cat projects.list
|
||||
expect "testing.git"
|
||||
expect "bar/u1/try1.git"
|
||||
notexpect "bar/u1/try2.git"
|
||||
notexpect "bar/u1/try3.git"
|
||||
runremote cat repositories/bar/u1/try1.git/description
|
||||
expect "this is bar/u1/try1"
|
||||
name "add descriptions for try1 and try3 and compile"
|
||||
echo "
|
||||
bar/u1/try1 = \"this is bar/u1/try1\"
|
||||
bar/u1/try3 = \"this is bar/u1/try3\"
|
||||
" | ugc
|
||||
runremote ls -al 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
|
||||
[ "$ais" = "0" ] && notexpect "testing.git"
|
||||
[ "$ais" = "1" ] && expect "testing.git"
|
||||
expect "bar/u1/try1.git"
|
||||
notexpect "bar/u1/try2.git"
|
||||
notexpect "bar/u1/try3.git"
|
||||
runremote cat repositories/bar/u1/try1.git/description
|
||||
expect "this is bar/u1/try1"
|
||||
|
||||
name "add try3 project"
|
||||
runlocal git ls-remote u1:bar/u1/try3
|
||||
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"
|
||||
runremote ls -al projects.list
|
||||
expect "gitolite-test gitolite-test 28 .* projects.list"
|
||||
runremote cat projects.list
|
||||
expect "testing.git"
|
||||
expect "bar/u1/try1.git"
|
||||
notexpect "bar/u1/try2.git"
|
||||
notexpect "bar/u1/try3.git"
|
||||
runremote cat repositories/bar/u1/try1.git/description
|
||||
expect "this is bar/u1/try1"
|
||||
runremote cat repositories/bar/u1/try3.git/description
|
||||
expect "Unnamed repository; edit this file 'description' to name the repository."
|
||||
name "add try3 project"
|
||||
runlocal git ls-remote u1:bar/u1/try3
|
||||
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"
|
||||
runremote ls -al 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
|
||||
[ "$ais" = "0" ] && notexpect "testing.git"
|
||||
[ "$ais" = "1" ] && expect "testing.git"
|
||||
expect "bar/u1/try1.git"
|
||||
notexpect "bar/u1/try2.git"
|
||||
notexpect "bar/u1/try3.git"
|
||||
runremote cat repositories/bar/u1/try1.git/description
|
||||
expect "this is bar/u1/try1"
|
||||
runremote cat repositories/bar/u1/try3.git/description
|
||||
expect "Unnamed repository; edit this file 'description' to name the repository."
|
||||
|
||||
name "now compile and recheck try3 stuff"
|
||||
echo "
|
||||
" | ugc
|
||||
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"
|
||||
runremote ls -al projects.list
|
||||
expect "gitolite-test gitolite-test 44 .* projects.list"
|
||||
runremote cat projects.list
|
||||
expect "testing.git"
|
||||
expect "bar/u1/try1.git"
|
||||
notexpect "bar/u1/try2.git"
|
||||
expect "bar/u1/try3.git"
|
||||
runremote cat repositories/bar/u1/try1.git/description
|
||||
expect "this is bar/u1/try1"
|
||||
runremote cat repositories/bar/u1/try3.git/description
|
||||
expect "this is bar/u1/try3"
|
||||
name "now compile and recheck try3 stuff"
|
||||
echo "
|
||||
" | ugc
|
||||
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"
|
||||
runremote ls -al 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
|
||||
[ "$ais" = "0" ] && notexpect "testing.git"
|
||||
[ "$ais" = "1" ] && expect "testing.git"
|
||||
expect "bar/u1/try1.git"
|
||||
notexpect "bar/u1/try2.git"
|
||||
expect "bar/u1/try3.git"
|
||||
runremote cat repositories/bar/u1/try1.git/description
|
||||
expect "this is bar/u1/try1"
|
||||
runremote cat repositories/bar/u1/try3.git/description
|
||||
expect "this is bar/u1/try3"
|
||||
|
||||
name "add owner for try2 and compile"
|
||||
echo "
|
||||
bar/u1/try2 \"owner2\" = \"this is bar/u1/try1\"
|
||||
" | ugc
|
||||
runremote cat repositories/bar/u1/try2.git/config
|
||||
expect "\[gitweb\]"
|
||||
expect "owner = owner2"
|
||||
runremote ls -al projects.list
|
||||
expect "gitolite-test gitolite-test 60 .* projects.list"
|
||||
runremote cat projects.list
|
||||
expect "bar/u1/try2.git"
|
||||
name "add owner for try2 and compile"
|
||||
echo "
|
||||
bar/u1/try2 \"owner2\" = \"this is bar/u1/try1\"
|
||||
" | ugc
|
||||
runremote cat repositories/bar/u1/try2.git/config
|
||||
expect "\[gitweb\]"
|
||||
expect "owner = owner2"
|
||||
runremote ls -al 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
|
||||
expect "bar/u1/try2.git"
|
||||
|
||||
name "add gitweb access to all"
|
||||
echo "
|
||||
repo @gbar
|
||||
R = gitweb
|
||||
" | ugc
|
||||
expect_push_ok "master -> master"
|
||||
runremote ls -al projects.list
|
||||
expect "gitolite-test gitolite-test 60 .* projects.list"
|
||||
runremote cat projects.list
|
||||
expect "testing.git"
|
||||
expect "bar/u1/try1.git"
|
||||
expect "bar/u1/try2.git"
|
||||
expect "bar/u1/try3.git"
|
||||
name "add gitweb access to all"
|
||||
echo "
|
||||
repo @gbar
|
||||
R = gitweb
|
||||
" | ugc
|
||||
expect_push_ok "master -> master"
|
||||
runremote ls -al 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
|
||||
[ "$ais" = "0" ] && notexpect "testing.git"
|
||||
[ "$ais" = "1" ] && expect "testing.git"
|
||||
expect "bar/u1/try1.git"
|
||||
expect "bar/u1/try2.git"
|
||||
expect "bar/u1/try3.git"
|
||||
|
||||
name "add try4 project"
|
||||
runlocal git ls-remote u1:bar/u1/try4
|
||||
runremote ls -al projects.list
|
||||
expect "gitolite-test gitolite-test 76 .* projects.list"
|
||||
runremote cat projects.list
|
||||
expect "testing.git"
|
||||
expect "bar/u1/try1.git"
|
||||
expect "bar/u1/try2.git"
|
||||
expect "bar/u1/try3.git"
|
||||
expect "bar/u1/try4.git"
|
||||
runremote cat repositories/bar/u1/try4.git/description
|
||||
expect "Unnamed repository; edit this file 'description' to name the repository."
|
||||
name "add try4 project"
|
||||
runlocal git ls-remote u1:bar/u1/try4
|
||||
runremote ls -al 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
|
||||
[ "$ais" = "0" ] && notexpect "testing.git"
|
||||
[ "$ais" = "1" ] && expect "testing.git"
|
||||
expect "bar/u1/try1.git"
|
||||
expect "bar/u1/try2.git"
|
||||
expect "bar/u1/try3.git"
|
||||
expect "bar/u1/try4.git"
|
||||
runremote cat repositories/bar/u1/try4.git/description
|
||||
expect "Unnamed repository; edit this file 'description' to name the repository."
|
||||
|
||||
name "INTERNAL"
|
||||
name "INTERNAL"
|
||||
done
|
||||
done
|
||||
|
|
|
@ -1,119 +1,170 @@
|
|||
# vim: syn=sh:
|
||||
for bc in 0 1
|
||||
do
|
||||
cd $TESTDIR
|
||||
$TESTDIR/rollback || die "rollback failed"
|
||||
editrc GL_WILDREPOS 1
|
||||
editrc GL_BIG_CONFIG $bc
|
||||
for ais in 0 1
|
||||
do
|
||||
cd $TESTDIR
|
||||
$TESTDIR/rollback || die "rollback failed"
|
||||
editrc GL_WILDREPOS 1
|
||||
editrc GL_BIG_CONFIG $bc
|
||||
echo "\$GL_ALL_INCLUDES_SPECIAL = $ais;" | addrc
|
||||
|
||||
name "INTERNAL"
|
||||
echo "
|
||||
@leads = u1 u2
|
||||
@devs = u1 u2 u3 u4
|
||||
name "INTERNAL"
|
||||
echo "
|
||||
@leads = u1 u2
|
||||
@devs = u1 u2 u3 u4
|
||||
|
||||
@gbar = bar/CREATOR/..*
|
||||
repo @gbar
|
||||
C = @leads
|
||||
RW+ = @leads
|
||||
RW = WRITERS @devs
|
||||
R = READERS
|
||||
" | ugc
|
||||
name "nothing set yet"
|
||||
expect_push_ok "master -> master"
|
||||
@gbar = bar/CREATOR/..*
|
||||
repo @gbar
|
||||
C = @leads
|
||||
RW+ = @leads
|
||||
RW = WRITERS @devs
|
||||
R = READERS
|
||||
" | ugc
|
||||
name "nothing set yet"
|
||||
expect_push_ok "master -> master"
|
||||
|
||||
runlocal git ls-remote u1:bar/u1/try1
|
||||
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"
|
||||
runremote ls -al projects.list
|
||||
expect "gitolite-test gitolite-test 12 .* projects.list"
|
||||
runremote cat projects.list
|
||||
notexpect "bar/u1/try1.git"
|
||||
runlocal git ls-remote u1:bar/u1/try1
|
||||
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"
|
||||
runremote ls -al 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
|
||||
notexpect "bar/u1/try1.git"
|
||||
|
||||
runlocal git ls-remote u1:bar/u1/try2
|
||||
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"
|
||||
runremote ls -al projects.list
|
||||
expect "gitolite-test gitolite-test 12 .* projects.list"
|
||||
runremote cat projects.list
|
||||
notexpect "bar/u1/try2.git"
|
||||
runlocal git ls-remote u1:bar/u1/try2
|
||||
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"
|
||||
runremote ls -al 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
|
||||
notexpect "bar/u1/try2.git"
|
||||
|
||||
name "add daemon access to try1"
|
||||
echo R daemon | runlocal ssh u1 setperms bar/u1/try1
|
||||
expect "R daemon"
|
||||
name "add daemon access to try1"
|
||||
echo R daemon | runlocal ssh u1 setperms bar/u1/try1
|
||||
expect "R daemon"
|
||||
|
||||
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"
|
||||
runremote ls -al projects.list
|
||||
expect "gitolite-test gitolite-test 12 .* projects.list"
|
||||
runremote cat projects.list
|
||||
notexpect "bar/u1/try1.git"
|
||||
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"
|
||||
runremote ls -al 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
|
||||
notexpect "bar/u1/try1.git"
|
||||
|
||||
name "add gitweb access to try2"
|
||||
echo R gitweb | runlocal ssh u1 setperms bar/u1/try2
|
||||
expect "R gitweb"
|
||||
name "add gitweb access to try2"
|
||||
echo R gitweb | runlocal ssh u1 setperms bar/u1/try2
|
||||
expect "R gitweb"
|
||||
|
||||
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"
|
||||
runremote ls -al projects.list
|
||||
expect "gitolite-test gitolite-test 28 .* projects.list"
|
||||
runremote cat projects.list
|
||||
expect "bar/u1/try2.git"
|
||||
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"
|
||||
runremote ls -al 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
|
||||
expect "bar/u1/try2.git"
|
||||
|
||||
echo "\$GL_WILDREPOS_DEFPERMS = 'R daemon';" | addrc
|
||||
echo "\$GL_WILDREPOS_DEFPERMS = 'R daemon';" | addrc
|
||||
|
||||
name "add default daemon access"
|
||||
runlocal git ls-remote u1:bar/u1/try3
|
||||
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"
|
||||
runremote ls -al projects.list
|
||||
expect "gitolite-test gitolite-test 28 .* projects.list"
|
||||
runremote cat projects.list
|
||||
notexpect "bar/u1/try3.git"
|
||||
name "add default daemon access"
|
||||
runlocal git ls-remote u1:bar/u1/try3
|
||||
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"
|
||||
runremote ls -al 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
|
||||
notexpect "bar/u1/try3.git"
|
||||
|
||||
name "add default gitweb access"
|
||||
echo "\$GL_WILDREPOS_DEFPERMS = 'R gitweb';" | addrc
|
||||
name "add default gitweb access"
|
||||
echo "\$GL_WILDREPOS_DEFPERMS = 'R gitweb';" | addrc
|
||||
|
||||
runlocal git ls-remote u1:bar/u1/try4
|
||||
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"
|
||||
runremote ls -al projects.list
|
||||
expect "gitolite-test gitolite-test 44 .* projects.list"
|
||||
runremote cat projects.list
|
||||
expect "bar/u1/try4.git"
|
||||
runlocal git ls-remote u1:bar/u1/try4
|
||||
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"
|
||||
runremote ls -al 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
|
||||
expect "bar/u1/try4.git"
|
||||
|
||||
name "add default both access"
|
||||
echo "\$GL_WILDREPOS_DEFPERMS = 'R daemon gitweb';" | addrc
|
||||
name "add default both access"
|
||||
echo "\$GL_WILDREPOS_DEFPERMS = 'R daemon gitweb';" | addrc
|
||||
|
||||
runlocal git ls-remote u1:bar/u1/try5
|
||||
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"
|
||||
runremote ls -al projects.list
|
||||
expect "gitolite-test gitolite-test 60 .* projects.list"
|
||||
runremote cat projects.list
|
||||
expect "bar/u1/try5.git"
|
||||
runlocal git ls-remote u1:bar/u1/try5
|
||||
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"
|
||||
runremote ls -al 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
|
||||
expect "bar/u1/try5.git"
|
||||
|
||||
name "add default both access with @all also"
|
||||
echo "\$GL_WILDREPOS_DEFPERMS = 'R @all daemon gitweb';" | addrc
|
||||
name "add default both access with @all also"
|
||||
echo "\$GL_WILDREPOS_DEFPERMS = 'R @all daemon gitweb';" | addrc
|
||||
|
||||
runlocal git ls-remote u1:bar/u1/try6
|
||||
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"
|
||||
runremote ls -al projects.list
|
||||
expect "gitolite-test gitolite-test 76 .* projects.list"
|
||||
runremote cat projects.list
|
||||
expect "bar/u1/try6.git"
|
||||
runlocal git ls-remote u1:bar/u1/try6
|
||||
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"
|
||||
runremote ls -al 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
|
||||
expect "bar/u1/try6.git"
|
||||
|
||||
name "remove all from u6"
|
||||
< /dev/null runlocal ssh u1 setperms bar/u1/try6
|
||||
name "remove all from u6"
|
||||
< /dev/null runlocal ssh u1 setperms bar/u1/try6
|
||||
|
||||
runlocal git ls-remote u1:bar/u1/try6
|
||||
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"
|
||||
runremote ls -al projects.list
|
||||
expect "gitolite-test gitolite-test 60 .* projects.list"
|
||||
runremote cat projects.list
|
||||
notexpect "bar/u1/try6.git"
|
||||
runlocal git ls-remote u1:bar/u1/try6
|
||||
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"
|
||||
runremote ls -al 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
|
||||
notexpect "bar/u1/try6.git"
|
||||
|
||||
name "INTERNAL"
|
||||
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"
|
||||
|
||||
done
|
||||
done
|
||||
|
|
Loading…
Reference in a new issue