gpt4 book ai didi

gitweb 和每个项目的 http 身份验证

转载 作者:太空狗 更新时间:2023-10-29 13:23:32 25 4
gpt4 key购买 nike

我已经在所有经过身份验证的用户都可以访问的 apache vHost 上成功设置了 gitweb。

服务器本身通过 https 提供了几个 git 存储库,并且每个用户/组都可以访问这些项目。例如,test1.git 只能由组 test1 读取/写入,而 test2.git 只能由组 test2 读取/写入。

现在我也只希望那些组在 gitweb 界面中看到他们相应的 git 存储库。是否有可能拥有 gitweb 的那些精细访问权限?

如果没有,是否有一个用于 git 的轻量级 web gui,它可以处理每个项目的基本 http 身份验证(以及可能用于以后的 ldap 身份验证)?

编辑只是为了让事情更清楚(因为评论中似乎有些困惑):示例:

  • 有 10 个存储库(test1、test2、... test10)

  • 用户 lockdoc 在组 test1test3

  • 一旦使用用户名 lockdoc 和他/她的密码通过 http 进行身份验证,此用户只能看到 git 项目 test1test3并且无法浏览/查看任何其他项目

  • 无需通过网络界面编写(推送),因为这已经实现

最佳答案

没有 GUI,但我建议使用 gitolite对于这种细粒度authorization .

查看此 httpd.conf for LDAP and gitolite access :

  • 你可以定义一个 gitweb 访问,这反过来会调用 gitolite,参见 gitweb.conf.pl脚本
  • 你可以定义一个https acces s 也将调用 gitolite(以允许或拒绝访问,具体取决于您的 ID)

https 配置如下所示:

ScriptAlias /hgit/ @H@/sbin/gitolite-shell/
SetEnv GIT_HTTP_BACKEND "@H@/usr/local/apps/git/libexec/git-core/git-http-backend"
<Location /hgit>
...
</Location>

在这两种情况下,您都可以使用基于 LDAP 的身份验证来保护这些 http 地址:

AuthName "LDAP authentication for ITSVC Smart HTTP Git repositories"
AuthType Basic
AuthBasicProvider myldap companyldap
AuthzLDAPAuthoritative Off
Require valid-user

然后您将在 gitolite.conf configuration file 中注册您的用户/组/存储库与 gitolite 有关。

@lockdoc_repos           =   test1 test3 # group of repo

repo @lockdoc_repos
R = lockdoc # read-only access for lockdoc
R = gitweb daemon # can be browsed

请参阅“testing/info/refs not found in gitolite after removing R @all rule”以了解有关如何允许浏览存储库的更多信息,作者 sitaram ( Sitaram Chamarty ),gitolite 的创造者。

关于gitweb 和每个项目的 http 身份验证,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14099737/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com