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";
|
$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
|
||||||
|
|
|
@ -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 /
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
# ----------------------------------------------------------------------------
|
# ----------------------------------------------------------------------------
|
||||||
|
|
|
@ -3,113 +3,132 @@ for wr in 0 1
|
||||||
do
|
do
|
||||||
for bc in 0 1
|
for bc in 0 1
|
||||||
do
|
do
|
||||||
cd $TESTDIR
|
for ais in 0 1
|
||||||
$TESTDIR/rollback || die "rollback failed"
|
do
|
||||||
editrc GL_WILDREPOS $wr
|
cd $TESTDIR
|
||||||
editrc GL_BIG_CONFIG $bc
|
$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"
|
name "INTERNAL"
|
||||||
echo "
|
echo "
|
||||||
@leads = u1 u2
|
@leads = u1 u2
|
||||||
@devs = u1 u2 u3 u4
|
@devs = u1 u2 u3 u4
|
||||||
|
|
||||||
@gbar = bar
|
@gbar = bar
|
||||||
repo @gbar
|
repo @gbar
|
||||||
RW+ = @leads
|
RW+ = @leads
|
||||||
RW = @devs
|
RW = @devs
|
||||||
" | ugc
|
" | ugc
|
||||||
expect_push_ok "master -> master"
|
expect_push_ok "master -> master"
|
||||||
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"
|
||||||
runremote cat projects.list
|
[ "$ais" = "1" ] && expect "gitolite-test gitolite-test 12 .* projects.list"
|
||||||
expect "testing.git"
|
runremote cat projects.list
|
||||||
|
[ "$ais" = "0" ] && notexpect "testing.git"
|
||||||
|
[ "$ais" = "1" ] && expect "testing.git"
|
||||||
|
|
||||||
name "add daemon access to bar"
|
name "add daemon access to bar"
|
||||||
echo "
|
echo "
|
||||||
R = daemon
|
R = daemon
|
||||||
" | ugc
|
" | ugc
|
||||||
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 "
|
||||||
@leads = u1 u2
|
@leads = u1 u2
|
||||||
@devs = u1 u2 u3 u4
|
@devs = u1 u2 u3 u4
|
||||||
|
|
||||||
@gfoo = foo
|
@gfoo = foo
|
||||||
repo @gfoo
|
repo @gfoo
|
||||||
RW+ = @leads
|
RW+ = @leads
|
||||||
RW = @devs
|
RW = @devs
|
||||||
R = gitweb
|
R = gitweb
|
||||||
" | 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"
|
||||||
runremote cat projects.list
|
[ "$ais" = "1" ] && expect "gitolite-test gitolite-test 20 .* projects.list"
|
||||||
expect "testing.git"
|
runremote cat projects.list
|
||||||
expect "foo.git"
|
[ "$ais" = "0" ] && notexpect "testing.git"
|
||||||
|
[ "$ais" = "1" ] && expect "testing.git"
|
||||||
|
expect "foo.git"
|
||||||
|
|
||||||
name "add gitweb access to bar"
|
name "add gitweb access to bar"
|
||||||
echo "
|
echo "
|
||||||
repo @gbar
|
repo @gbar
|
||||||
R = gitweb
|
R = gitweb
|
||||||
" | 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"
|
||||||
runremote cat projects.list
|
[ "$ais" = "1" ] && expect "gitolite-test gitolite-test 28 .* projects.list"
|
||||||
expect "testing.git"
|
runremote cat projects.list
|
||||||
expect "foo.git"
|
[ "$ais" = "0" ] && notexpect "testing.git"
|
||||||
expect "bar.git"
|
[ "$ais" = "1" ] && expect "testing.git"
|
||||||
|
expect "foo.git"
|
||||||
|
expect "bar.git"
|
||||||
|
|
||||||
name "add repo baz with description"
|
name "add repo baz with description"
|
||||||
echo "
|
echo "
|
||||||
@gbaz = baz
|
@gbaz = baz
|
||||||
repo @gbaz
|
repo @gbaz
|
||||||
RW = @leads
|
RW = @leads
|
||||||
|
|
||||||
baz = \"this is repo baz\"
|
baz = \"this is repo baz\"
|
||||||
" | ugc
|
" | ugc
|
||||||
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"
|
||||||
runremote cat projects.list
|
[ "$ais" = "1" ] && expect "gitolite-test gitolite-test 36 .* projects.list"
|
||||||
expect "testing.git"
|
runremote cat projects.list
|
||||||
expect "foo.git"
|
[ "$ais" = "0" ] && notexpect "testing.git"
|
||||||
expect "bar.git"
|
[ "$ais" = "1" ] && expect "testing.git"
|
||||||
expect "baz.git"
|
expect "foo.git"
|
||||||
runremote ls -al repositories/baz.git/description
|
expect "bar.git"
|
||||||
expect "gitolite-test gitolite-test 17 .* repositories/baz.git/description"
|
expect "baz.git"
|
||||||
runremote cat repositories/baz.git/description
|
runremote ls -al repositories/baz.git/description
|
||||||
expect "this is repo baz"
|
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"
|
name "add owner to testing repo"
|
||||||
echo "
|
echo "
|
||||||
testing \"sitaram\" = \"this is the testing repo\"
|
testing \"sitaram\" = \"this is the testing repo\"
|
||||||
" | 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 36 .* projects.list"
|
expect "gitolite-test gitolite-test 36 .* projects.list"
|
||||||
runremote cat projects.list
|
runremote cat projects.list
|
||||||
expect "testing.git"
|
expect "testing.git"
|
||||||
expect "foo.git"
|
expect "foo.git"
|
||||||
expect "bar.git"
|
expect "bar.git"
|
||||||
expect "baz.git"
|
expect "baz.git"
|
||||||
runremote cat repositories/testing.git/config
|
runremote cat repositories/testing.git/config
|
||||||
expect "\[gitweb\]"
|
expect "\[gitweb\]"
|
||||||
expect "owner = sitaram"
|
expect "owner = sitaram"
|
||||||
runremote ls -al repositories/testing.git/description
|
runremote ls -al repositories/testing.git/description
|
||||||
expect "gitolite-test gitolite-test 25 .* repositories/testing.git/description"
|
expect "gitolite-test gitolite-test 25 .* repositories/testing.git/description"
|
||||||
runremote cat repositories/testing.git/description
|
runremote cat repositories/testing.git/description
|
||||||
expect "this is the testing repo"
|
expect "this is the testing repo"
|
||||||
|
|
||||||
name INTERNAL
|
name INTERNAL
|
||||||
|
done
|
||||||
done
|
done
|
||||||
done
|
done
|
||||||
|
|
|
@ -1,140 +1,160 @@
|
||||||
# vim: syn=sh:
|
# vim: syn=sh:
|
||||||
for bc in 0 1
|
for bc in 0 1
|
||||||
do
|
do
|
||||||
cd $TESTDIR
|
for ais in 0 1
|
||||||
$TESTDIR/rollback || die "rollback failed"
|
do
|
||||||
editrc GL_WILDREPOS 1
|
cd $TESTDIR
|
||||||
editrc GL_BIG_CONFIG $bc
|
$TESTDIR/rollback || die "rollback failed"
|
||||||
|
editrc GL_WILDREPOS 1
|
||||||
|
editrc GL_BIG_CONFIG $bc
|
||||||
|
echo "\$GL_ALL_INCLUDES_SPECIAL = $ais;" | addrc
|
||||||
|
|
||||||
# ----------
|
# ----------
|
||||||
|
|
||||||
name "INTERNAL"
|
name "INTERNAL"
|
||||||
echo "
|
echo "
|
||||||
@leads = u1 u2
|
@leads = u1 u2
|
||||||
@devs = u1 u2 u3 u4
|
@devs = u1 u2 u3 u4
|
||||||
|
|
||||||
@gbar = bar/CREATOR/..*
|
@gbar = bar/CREATOR/..*
|
||||||
repo @gbar
|
repo @gbar
|
||||||
C = @leads
|
C = @leads
|
||||||
RW+ = @leads
|
RW+ = @leads
|
||||||
RW = @devs
|
RW = @devs
|
||||||
" | ugc
|
" | ugc
|
||||||
expect_push_ok "master -> master"
|
expect_push_ok "master -> master"
|
||||||
runlocal git ls-remote u1:bar/u1/try1
|
runlocal git ls-remote u1:bar/u1/try1
|
||||||
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"
|
||||||
runremote cat projects.list
|
[ "$ais" = "1" ] && expect "gitolite-test gitolite-test 12 .* projects.list"
|
||||||
expect "testing.git"
|
runremote cat projects.list
|
||||||
notexpect "bar/u1/try1.git"
|
[ "$ais" = "0" ] && notexpect "testing.git"
|
||||||
|
[ "$ais" = "1" ] && expect "testing.git"
|
||||||
|
notexpect "bar/u1/try1.git"
|
||||||
|
|
||||||
name "add daemon access"
|
name "add daemon access"
|
||||||
echo "
|
echo "
|
||||||
R = daemon
|
R = daemon
|
||||||
" | ugc
|
" | ugc
|
||||||
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"
|
||||||
runremote cat projects.list
|
[ "$ais" = "1" ] && expect "gitolite-test gitolite-test 12 .* projects.list"
|
||||||
expect "testing.git"
|
runremote cat projects.list
|
||||||
notexpect "bar/u1/try1.git"
|
[ "$ais" = "0" ] && notexpect "testing.git"
|
||||||
notexpect "bar/u1/try2.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"
|
name "add descriptions for try1 and try3 and compile"
|
||||||
echo "
|
echo "
|
||||||
bar/u1/try1 = \"this is bar/u1/try1\"
|
bar/u1/try1 = \"this is bar/u1/try1\"
|
||||||
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"
|
||||||
runremote cat projects.list
|
[ "$ais" = "1" ] && expect "gitolite-test gitolite-test 28 .* projects.list"
|
||||||
expect "testing.git"
|
runremote cat projects.list
|
||||||
expect "bar/u1/try1.git"
|
[ "$ais" = "0" ] && notexpect "testing.git"
|
||||||
notexpect "bar/u1/try2.git"
|
[ "$ais" = "1" ] && expect "testing.git"
|
||||||
notexpect "bar/u1/try3.git"
|
expect "bar/u1/try1.git"
|
||||||
runremote cat repositories/bar/u1/try1.git/description
|
notexpect "bar/u1/try2.git"
|
||||||
expect "this is bar/u1/try1"
|
notexpect "bar/u1/try3.git"
|
||||||
|
runremote cat repositories/bar/u1/try1.git/description
|
||||||
|
expect "this is bar/u1/try1"
|
||||||
|
|
||||||
name "add try3 project"
|
name "add try3 project"
|
||||||
runlocal git ls-remote u1:bar/u1/try3
|
runlocal git ls-remote u1:bar/u1/try3
|
||||||
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"
|
||||||
runremote cat projects.list
|
[ "$ais" = "1" ] && expect "gitolite-test gitolite-test 28 .* projects.list"
|
||||||
expect "testing.git"
|
runremote cat projects.list
|
||||||
expect "bar/u1/try1.git"
|
[ "$ais" = "0" ] && notexpect "testing.git"
|
||||||
notexpect "bar/u1/try2.git"
|
[ "$ais" = "1" ] && expect "testing.git"
|
||||||
notexpect "bar/u1/try3.git"
|
expect "bar/u1/try1.git"
|
||||||
runremote cat repositories/bar/u1/try1.git/description
|
notexpect "bar/u1/try2.git"
|
||||||
expect "this is bar/u1/try1"
|
notexpect "bar/u1/try3.git"
|
||||||
runremote cat repositories/bar/u1/try3.git/description
|
runremote cat repositories/bar/u1/try1.git/description
|
||||||
expect "Unnamed repository; edit this file 'description' to name the repository."
|
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"
|
name "now compile and recheck try3 stuff"
|
||||||
echo "
|
echo "
|
||||||
" | ugc
|
" | ugc
|
||||||
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"
|
||||||
runremote cat projects.list
|
[ "$ais" = "1" ] && expect "gitolite-test gitolite-test 44 .* projects.list"
|
||||||
expect "testing.git"
|
runremote cat projects.list
|
||||||
expect "bar/u1/try1.git"
|
[ "$ais" = "0" ] && notexpect "testing.git"
|
||||||
notexpect "bar/u1/try2.git"
|
[ "$ais" = "1" ] && expect "testing.git"
|
||||||
expect "bar/u1/try3.git"
|
expect "bar/u1/try1.git"
|
||||||
runremote cat repositories/bar/u1/try1.git/description
|
notexpect "bar/u1/try2.git"
|
||||||
expect "this is bar/u1/try1"
|
expect "bar/u1/try3.git"
|
||||||
runremote cat repositories/bar/u1/try3.git/description
|
runremote cat repositories/bar/u1/try1.git/description
|
||||||
expect "this is bar/u1/try3"
|
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"
|
name "add owner for try2 and compile"
|
||||||
echo "
|
echo "
|
||||||
bar/u1/try2 \"owner2\" = \"this is bar/u1/try1\"
|
bar/u1/try2 \"owner2\" = \"this is bar/u1/try1\"
|
||||||
" | ugc
|
" | ugc
|
||||||
runremote cat repositories/bar/u1/try2.git/config
|
runremote cat repositories/bar/u1/try2.git/config
|
||||||
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"
|
||||||
runremote cat projects.list
|
[ "$ais" = "1" ] && expect "gitolite-test gitolite-test 60 .* projects.list"
|
||||||
expect "bar/u1/try2.git"
|
runremote cat projects.list
|
||||||
|
expect "bar/u1/try2.git"
|
||||||
|
|
||||||
name "add gitweb access to all"
|
name "add gitweb access to all"
|
||||||
echo "
|
echo "
|
||||||
repo @gbar
|
repo @gbar
|
||||||
R = gitweb
|
R = gitweb
|
||||||
" | 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"
|
||||||
runremote cat projects.list
|
[ "$ais" = "1" ] && expect "gitolite-test gitolite-test 60 .* projects.list"
|
||||||
expect "testing.git"
|
runremote cat projects.list
|
||||||
expect "bar/u1/try1.git"
|
[ "$ais" = "0" ] && notexpect "testing.git"
|
||||||
expect "bar/u1/try2.git"
|
[ "$ais" = "1" ] && expect "testing.git"
|
||||||
expect "bar/u1/try3.git"
|
expect "bar/u1/try1.git"
|
||||||
|
expect "bar/u1/try2.git"
|
||||||
|
expect "bar/u1/try3.git"
|
||||||
|
|
||||||
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"
|
||||||
runremote cat projects.list
|
[ "$ais" = "1" ] && expect "gitolite-test gitolite-test 76 .* projects.list"
|
||||||
expect "testing.git"
|
runremote cat projects.list
|
||||||
expect "bar/u1/try1.git"
|
[ "$ais" = "0" ] && notexpect "testing.git"
|
||||||
expect "bar/u1/try2.git"
|
[ "$ais" = "1" ] && expect "testing.git"
|
||||||
expect "bar/u1/try3.git"
|
expect "bar/u1/try1.git"
|
||||||
expect "bar/u1/try4.git"
|
expect "bar/u1/try2.git"
|
||||||
runremote cat repositories/bar/u1/try4.git/description
|
expect "bar/u1/try3.git"
|
||||||
expect "Unnamed repository; edit this file 'description' to name the repository."
|
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
|
done
|
||||||
|
|
|
@ -1,119 +1,170 @@
|
||||||
# vim: syn=sh:
|
# vim: syn=sh:
|
||||||
for bc in 0 1
|
for bc in 0 1
|
||||||
do
|
do
|
||||||
cd $TESTDIR
|
for ais in 0 1
|
||||||
$TESTDIR/rollback || die "rollback failed"
|
do
|
||||||
editrc GL_WILDREPOS 1
|
cd $TESTDIR
|
||||||
editrc GL_BIG_CONFIG $bc
|
$TESTDIR/rollback || die "rollback failed"
|
||||||
|
editrc GL_WILDREPOS 1
|
||||||
|
editrc GL_BIG_CONFIG $bc
|
||||||
|
echo "\$GL_ALL_INCLUDES_SPECIAL = $ais;" | addrc
|
||||||
|
|
||||||
name "INTERNAL"
|
name "INTERNAL"
|
||||||
echo "
|
echo "
|
||||||
@leads = u1 u2
|
@leads = u1 u2
|
||||||
@devs = u1 u2 u3 u4
|
@devs = u1 u2 u3 u4
|
||||||
|
|
||||||
@gbar = bar/CREATOR/..*
|
@gbar = bar/CREATOR/..*
|
||||||
repo @gbar
|
repo @gbar
|
||||||
C = @leads
|
C = @leads
|
||||||
RW+ = @leads
|
RW+ = @leads
|
||||||
RW = WRITERS @devs
|
RW = WRITERS @devs
|
||||||
R = READERS
|
R = READERS
|
||||||
" | ugc
|
" | ugc
|
||||||
name "nothing set yet"
|
name "nothing set yet"
|
||||||
expect_push_ok "master -> master"
|
expect_push_ok "master -> master"
|
||||||
|
|
||||||
runlocal git ls-remote u1:bar/u1/try1
|
runlocal git ls-remote u1:bar/u1/try1
|
||||||
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"
|
||||||
runremote cat projects.list
|
[ "$ais" = "1" ] && expect "gitolite-test gitolite-test 12 .* projects.list"
|
||||||
notexpect "bar/u1/try1.git"
|
runremote cat projects.list
|
||||||
|
notexpect "bar/u1/try1.git"
|
||||||
|
|
||||||
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 "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"
|
||||||
runremote cat projects.list
|
[ "$ais" = "1" ] && expect "gitolite-test gitolite-test 12 .* projects.list"
|
||||||
notexpect "bar/u1/try2.git"
|
runremote cat projects.list
|
||||||
|
notexpect "bar/u1/try2.git"
|
||||||
|
|
||||||
name "add daemon access to try1"
|
name "add daemon access to try1"
|
||||||
echo R daemon | runlocal ssh u1 setperms bar/u1/try1
|
echo R daemon | runlocal ssh u1 setperms bar/u1/try1
|
||||||
expect "R daemon"
|
expect "R daemon"
|
||||||
|
|
||||||
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"
|
||||||
runremote cat projects.list
|
[ "$ais" = "1" ] && expect "gitolite-test gitolite-test 12 .* projects.list"
|
||||||
notexpect "bar/u1/try1.git"
|
runremote cat projects.list
|
||||||
|
notexpect "bar/u1/try1.git"
|
||||||
|
|
||||||
name "add gitweb access to try2"
|
name "add gitweb access to try2"
|
||||||
echo R gitweb | runlocal ssh u1 setperms bar/u1/try2
|
echo R gitweb | runlocal ssh u1 setperms bar/u1/try2
|
||||||
expect "R gitweb"
|
expect "R gitweb"
|
||||||
|
|
||||||
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"
|
||||||
runremote cat projects.list
|
[ "$ais" = "1" ] && expect "gitolite-test gitolite-test 28 .* projects.list"
|
||||||
expect "bar/u1/try2.git"
|
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"
|
name "add default daemon access"
|
||||||
runlocal git ls-remote u1:bar/u1/try3
|
runlocal git ls-remote u1:bar/u1/try3
|
||||||
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"
|
||||||
runremote cat projects.list
|
[ "$ais" = "1" ] && expect "gitolite-test gitolite-test 28 .* projects.list"
|
||||||
notexpect "bar/u1/try3.git"
|
runremote cat projects.list
|
||||||
|
notexpect "bar/u1/try3.git"
|
||||||
|
|
||||||
name "add default gitweb access"
|
name "add default gitweb access"
|
||||||
echo "\$GL_WILDREPOS_DEFPERMS = 'R gitweb';" | addrc
|
echo "\$GL_WILDREPOS_DEFPERMS = 'R gitweb';" | addrc
|
||||||
|
|
||||||
runlocal git ls-remote u1:bar/u1/try4
|
runlocal git ls-remote u1:bar/u1/try4
|
||||||
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"
|
||||||
runremote cat projects.list
|
[ "$ais" = "1" ] && expect "gitolite-test gitolite-test 44 .* projects.list"
|
||||||
expect "bar/u1/try4.git"
|
runremote cat projects.list
|
||||||
|
expect "bar/u1/try4.git"
|
||||||
|
|
||||||
name "add default both access"
|
name "add default both access"
|
||||||
echo "\$GL_WILDREPOS_DEFPERMS = 'R daemon gitweb';" | addrc
|
echo "\$GL_WILDREPOS_DEFPERMS = 'R daemon gitweb';" | addrc
|
||||||
|
|
||||||
runlocal git ls-remote u1:bar/u1/try5
|
runlocal git ls-remote u1:bar/u1/try5
|
||||||
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"
|
||||||
runremote cat projects.list
|
[ "$ais" = "1" ] && expect "gitolite-test gitolite-test 60 .* projects.list"
|
||||||
expect "bar/u1/try5.git"
|
runremote cat projects.list
|
||||||
|
expect "bar/u1/try5.git"
|
||||||
|
|
||||||
name "add default both access with @all also"
|
name "add default both access with @all also"
|
||||||
echo "\$GL_WILDREPOS_DEFPERMS = 'R @all daemon gitweb';" | addrc
|
echo "\$GL_WILDREPOS_DEFPERMS = 'R @all daemon gitweb';" | addrc
|
||||||
|
|
||||||
runlocal git ls-remote u1:bar/u1/try6
|
runlocal git ls-remote u1:bar/u1/try6
|
||||||
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"
|
||||||
runremote cat projects.list
|
[ "$ais" = "1" ] && expect "gitolite-test gitolite-test 76 .* projects.list"
|
||||||
expect "bar/u1/try6.git"
|
runremote cat projects.list
|
||||||
|
expect "bar/u1/try6.git"
|
||||||
|
|
||||||
name "remove all from u6"
|
name "remove all from u6"
|
||||||
< /dev/null runlocal ssh u1 setperms bar/u1/try6
|
< /dev/null runlocal ssh u1 setperms bar/u1/try6
|
||||||
|
|
||||||
runlocal git ls-remote u1:bar/u1/try6
|
runlocal git ls-remote u1:bar/u1/try6
|
||||||
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"
|
||||||
runremote cat projects.list
|
[ "$ais" = "1" ] && expect "gitolite-test gitolite-test 60 .* projects.list"
|
||||||
notexpect "bar/u1/try6.git"
|
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
|
done
|
||||||
|
|
Loading…
Reference in a new issue