【问题标题】:How to get a fine grained ACL for repositories with smart http access in gitolite?如何在 gitolite 中获得具有智能 http 访问权限的存储库的细粒度 ACL?
【发布时间】:2017-04-20 05:37:25
【问题描述】:

我们如何在 gitolite 中使用智能 http 实现细粒度 ACL?

这究竟意味着:如果我在 gitolite 中使用 ssh 限制某些用户的某些 repo,并且如果我尝试克隆受限制的 repo,gitolite 会告诉:

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

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

【问题讨论】:

    标签: git apache2 gitolite


    【解决方案1】:

    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
    

    您需要通过authentication basic provider(文件、ldap、dbm、...)之一将其与to authenticate yourself 结合起来
    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
    

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

    【讨论】:

    • 我试过上面提到的代码。但我仍然找不到答案。您能否按顺序发布步骤(代码),以便我清楚地了解首先执行哪个步骤以及最后执行哪个步骤。我阅读了很多关于“smart-http”实现的文档,这实际上非常令人困惑,每个人都以多种方式实现了相同的主题,这对于像我这样的初学者来说似乎非常复杂。请帮我解决这个问题。
    猜你喜欢
    • 1970-01-01
    • 2022-11-22
    • 1970-01-01
    • 1970-01-01
    • 2014-11-18
    • 2021-02-06
    • 2011-06-23
    • 2019-01-20
    • 2019-07-01
    相关资源
    最近更新 更多