From d08aca63fffed65aed3dba2256afe0dba3ac7335 Mon Sep 17 00:00:00 2001 From: Sitaram Chamarty Date: Mon, 28 Nov 2011 22:48:59 +0530 Subject: [PATCH] gl-setup: dont try to 'git add' and all that when no key was provided Apparently some people want gitolite-admin as a non-repo. Completely outside gitolite, managed by puppet or such, and leaving only symlinks for 'conf' and 'keydir' in $GL_ADMINDIR. But then when they have to run 'gl-setup', the 'git add' complains about the symlink. Hence this patch. ---- Meanwhile, if you're one of those puppet masters, here's the script I gave them for the *compile* (this has nothing to do with this patch; I'm just throwing it in here so I won't lose it): #!/bin/bash # let's say you install using "non-root" method. (Adjust GL_BINDIR for root # method or package method). # install normally, then make changes directly in $GL_ADMINDIR/conf and # $GL_ADMINDIR/keydir. (Please leaves "logs/" and "hooks/" alone). # Then run this: export GL_ADMINDIR=$HOME/.gitolite export GL_BINDIR=$HOME/bin export GL_RC=$HOME/.gitolite.rc cd $GL_ADMINDIR $GL_BINDIR/gl-compile-conf # BE SURE TO REMOVE THE ADMIN REPO ITSELF FROM conf/gitolite.conf, as well as # repositories/gitolite-admin.git, lest a push by someone end up overwriting # this hand- (or machine-) crafted config. # you can get away even further from gitolite's control. You can, for # example, set GL_NO_SETUP_AUTHKEYS in the rc file, and manage even the keys # yourself. Just put the full path to $GL_BINDIR/gl-auth-command followed by # the username in the "command=" part of the authkeys file you generate. --- src/gl-setup | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/gl-setup b/src/gl-setup index 3a6c04b..6df75ae 100755 --- a/src/gl-setup +++ b/src/gl-setup @@ -124,7 +124,7 @@ touch $HOME/.ssh/authorized_keys gl-compile-conf -q # setup push-to-admin -( +[ -n "$pubkey_file" ] && ( cd $HOME; cd $REPO_BASE/gitolite-admin.git GIT_WORK_TREE=$GL_ADMINDIR; export GIT_WORK_TREE git add conf/gitolite.conf keydir @@ -142,3 +142,5 @@ gl-install -q # the never-ending quest to help with bloody ssh issues... cd $GL_ADMINDIR/keydir [ -n "$pubkey_file" ] && $GL_BINDIR/sshkeys-lint < $HOME/.ssh/authorized_keys -q -a $admin_name + +exit 0