allow gitolite to be used when the users already have real IDs

Fedora (for example) runs like this:

  * each user has his own userid and login
  * his/her ~/.ssh/authkeys file (containing only his/her key) has a
    "command=" clause invoking just "gl-auth-command"
  * trusted users have "gl-auth-command -s" meaning they can get a shell if
    they want to

As a result, there is no specific $HOME where you can look for
.gitolite.rc.  Hence this patch

----

Side note: in addition, Fedora may have one or more of the following
characteristics (writing them here for convenience; they're not directly
relevant to this patch):

  * actual git repos are under "git" (or some such), and include the chmod g+s
    (git init --shared) unix perms tricks for shared access

  * but since they're coming through gl-auth, branch-level acls are in effect

  * the gitolite config file is generated from some database and compiled (all
    via cron)

  * they keydir/ is empty; in fact they probably don't use the admin repo at
    all, AFAIK
This commit is contained in:
Sitaram Chamarty 2010-12-28 13:58:53 +05:30
parent 5b9bf700cc
commit e98bde322e

View file

@ -265,8 +265,15 @@ sub where_is_rc
return if $ENV{GL_RC}; return if $ENV{GL_RC};
my $glrc = $ENV{HOME} . "/.gitolite.rc"; # Fedora doesn't actually have a "hosting user" at all (yeah -- bet you
$ENV{GL_RC} = $glrc if (-f $glrc); # didn't know gitolite was *that* flexible!), so there's no fixed $HOME,
# and they prefer to keep their RC file in /etc/gitolite.
for my $glrc ( $ENV{HOME} . "/.gitolite.rc", "/etc/gitolite/gitolite.rc" ) {
if (-f $glrc) {
$ENV{GL_RC} = $glrc;
last;
}
}
} }
# ---------------------------------------------------------------------------- # ----------------------------------------------------------------------------