diff --git a/conf/example.gitolite.rc b/conf/example.gitolite.rc index d7b18d8..24e52a5 100644 --- a/conf/example.gitolite.rc +++ b/conf/example.gitolite.rc @@ -189,6 +189,16 @@ $SVNSERVE = ""; $GL_WILDREPOS = 0; +# -------------------------------------- +# DEFAULT WILDCARD PERMISSIONS + +# If set, this value will be used as the default user-level permission rule of +# new wildcard repositories. The user can change this value with the setperms command +# as desired after repository creation; it is only a default. Note that @all can be +# used here but is special; no other groups can be used in user-level permissions. + +# $GL_WILDREPOS_DEFPERMS = 'R = @all'; + # -------------------------------------- # HOOK CHAINING diff --git a/contrib/adc/fork b/contrib/adc/fork index b61f415..3baab01 100755 --- a/contrib/adc/fork +++ b/contrib/adc/fork @@ -13,8 +13,14 @@ get_rights_and_owner $to # clone $from to $to git clone --bare -l $GL_REPO_BASE_ABS/$from.git $GL_REPO_BASE_ABS/$to.git +[ $? -ne 0 ] && exit 1 # fix up creator, and hooks cd $GL_REPO_BASE_ABS/$to.git echo $GL_USER > gl-creater cp -R $GL_REPO_BASE_ABS/$from.git/hooks/* $GL_REPO_BASE_ABS/$to.git/hooks + +if [ -n "$GL_WILDREPOS_DEFPERMS" ]; then + echo "$GL_WILDREPOS_DEFPERMS" > gl-perms +fi + diff --git a/src/gl-auth-command b/src/gl-auth-command index 8ca43d9..a161dca 100755 --- a/src/gl-auth-command +++ b/src/gl-auth-command @@ -23,7 +23,7 @@ use warnings; # ---------------------------------------------------------------------------- # these are set by the "rc" file -our ($GL_LOGT, $GL_CONF_COMPILED, $REPO_BASE, $GIT_PATH, $REPO_UMASK, $GL_ADMINDIR, $RSYNC_BASE, $HTPASSWD_FILE, $GL_WILDREPOS, $GL_ADC_PATH, $SVNSERVE); +our ($GL_LOGT, $GL_CONF_COMPILED, $REPO_BASE, $GIT_PATH, $REPO_UMASK, $GL_ADMINDIR, $RSYNC_BASE, $HTPASSWD_FILE, $GL_WILDREPOS, $GL_WILDREPOS_DEFPERMS, $GL_ADC_PATH, $SVNSERVE); # and these are set by gitolite.pm our ($R_COMMANDS, $W_COMMANDS, $REPONAME_PATT, $REPOPATT_PATT); our %repos; @@ -46,6 +46,9 @@ $ENV{GL_BINDIR} = $bindir; # add a custom path for git binaries, if specified $ENV{PATH} .= ":$GIT_PATH" if $GIT_PATH; +# set default permission of wildcard repositories +$ENV{GL_WILDREPOS_DEFPERMS} = $GL_WILDREPOS_DEFPERMS if $GL_WILDREPOS_DEFPERMS; + # set the umask before creating any files umask($REPO_UMASK);