如何在gitolite中使用智能http访问获取存储库的细粒度ACL?

时间:2017-04-20 05:37:26

标签: git apache2 gitolite

我们怎样才能在gitolite中使用智能http实现细粒度ACL?

这究竟意味着什么:如果我使用ssh限制某些用户使用gitolite的某些用户,如果我尝试克隆受限制的回购,gitolite告诉:

Fatal R any (some_username) is denied. 
Please make sure the repository exists". 

如何使用智能http实现上述ACL?
如果可能,请指定设置(apache2)以实现相同目的。

1 个答案:

答案 0 :(得分:0)

gitolite 与智能http兼容,正如我提到in 2012in here

您需要做的就是设置those 4 lines

SetEnv GIT_PROJECT_ROOT @H@/repositories
SetEnv GIT_HTTP_EXPORT_ALL
SetEnv GITOLITE_HTTP_HOME @H@
ScriptAlias /hgit/ /path/to/gitolite/sbin/gitolite-shell/
SetEnv GIT_HTTP_BACKEND "/path/to/git/libexec/git-core/git-http-backend"

这样,以 /hgit 开头的任何url with a path都会首先查询gitolite(通过其src/gitolite-shell perl脚本)

git clone http://myserver/hgit/myrepo.git

您需要通过to authenticate yourself之一(文件,ldap,dbm,...)以authentication basic provider的方式将其耦合在一起 在my httpd.conf, I use LDAP

    AuthName "LDAP authentication for ITSVC Smart HTTP Git repositories"
    AuthType Basic
    AuthBasicProvider ldap
    AuthLDAPBindDN "@LDAP_BINDDN@"
    AuthLDAPBindPassword @LDAP_PASSWORD@
    AuthLDAPURL @LDAP_URL@
    AuthLDAPGroupAttribute member

您可以用their actual values替换占位符字符串@xxx@

相关问题