diff --git a/conf/example.gitolite.rc b/conf/example.gitolite.rc index 72ad3dc..7a5068d 100644 --- a/conf/example.gitolite.rc +++ b/conf/example.gitolite.rc @@ -11,9 +11,9 @@ $GL_ADMINDIR=$ENV{HOME} . "/.gitolite"; # the ones below can be left as they are, unless for some reason you want them # elsewhere -$GL_CONF="$GL_ADMINDIR/gitolite.conf"; +$GL_CONF="$GL_ADMINDIR/conf/gitolite.conf"; $GL_KEYDIR="$GL_ADMINDIR/keydir"; -$GL_CONF_COMPILED="$GL_ADMINDIR/gitolite.conf-compiled.pm"; +$GL_CONF_COMPILED="$GL_ADMINDIR/conf/gitolite.conf-compiled.pm"; # -------------------------------------- # this should be the last line in this file, per perl rules diff --git a/src/gl-compile-conf b/src/gl-compile-conf index 78cc671..3388979 100755 --- a/src/gl-compile-conf +++ b/src/gl-compile-conf @@ -60,7 +60,7 @@ unless (my $ret = do $glrc) # ---------------------------------------------------------------------------- # command and options for authorized_keys -my $AUTH_COMMAND="$GL_ADMINDIR/gl-auth-command"; +my $AUTH_COMMAND="$GL_ADMINDIR/src/gl-auth-command"; my $AUTH_OPTIONS="no-port-forwarding,no-X11-forwarding,no-agent-forwarding,no-pty"; my $USERNAME_PATT=qr(^\@?[0-9a-zA-Z][0-9a-zA-Z._-]*$); # very simple pattern @@ -192,7 +192,7 @@ for my $repo (keys %repos) mkdir("$repo.git") or die "mkdir $repo.git failed: $!"; my_chdir("$repo.git"); system("git init --bare"); - system("cp $GL_ADMINDIR/update-hook.pl hooks/update"); + system("cp $GL_ADMINDIR/src/update-hook.pl hooks/update"); system("chmod 755 hooks/update"); my_chdir("$ENV{HOME}/$REPO_BASE"); } @@ -237,7 +237,7 @@ system("rm ~/.ssh/new_authkeys"); my_chdir($GL_ADMINDIR); if (-d ".git") { - system("git add -A keydir"); # stage all changes in keydir + system("git add -A conf keydir"); # stage all operational data # and if there are any if (system("git diff --cached --quiet") ) { diff --git a/src/install.sh b/src/install.sh new file mode 100755 index 0000000..c2156da --- /dev/null +++ b/src/install.sh @@ -0,0 +1,25 @@ +#!/bin/bash + +# install gitolite + +# quick safety check: do not run if ~/.gitolite.rc is present + +[[ -f ~/.gitolite.rc ]] && { + echo sorry\; \'~/.gitolite.rc\' already exists + exit 1 +} + +# this one is fixed to the location shown +cp conf/example.gitolite.rc ~/.gitolite.rc + +# the destinations below are defaults; if you change the paths in the "rc" +# file above, these destinations also must change accordingly + +# mkdir $REPO_BASE, $GL_ADMINDIR, it's subdirs, and $GL_KEYDIR +mkdir ~/repositories +mkdir ~/.gitolite +mkdir ~/.gitolite/{src,conf,doc,keydir} + +# copy conf, src, doc +cp -a src doc conf ~/.gitolite +cp conf/example.conf ~/.gitolite/conf/gitolite.conf