【问题标题】:Cannot clone repository with HTTP from a Gitolite server无法从 Gitolite 服务器使用 HTTP 克隆存储库
【发布时间】:2019-02-17 15:10:26
【问题描述】:

我在 centOS 7 的 ssh 和 http 模式下运行 Gitolite。我照原样按照 this 教程进行操作。

我的问题是我可以通过 ssh 克隆所有 repo,但即使在向所有添加 R = daemon 访问规则后也只能通过 http 克隆 testing.git repo我想通过 http 提供的存储库。

gitolite.conf 看起来像这样:

cat gitolite.conf

repo gitolite-admin
    RW+     =   Git-Admin

repo testing
    RW+     =   @all

repo avengers
    RW+     =   Git-Admin

repo @all
    R       =   daemon gitweb

ssh git@192.168.15.2 信息

hello Git-Admin, this is git@osboxes running gitolite3 v3.6.9-0-g144d8a2 on git 1.8.3.1

 R W    avengers
 R W    gitolite-admin
 R W    testing

卷曲http://admin:admin@192.168.15.2/git/info

hello admin, this is httpd@osboxes running gitolite3 v3.6.9-0-g144d8a2 on git 1.8.3.1

 R W    testing

我不知道哪里出错了。

提前致谢

[root@osboxes repositories]# vim /var/www/bin/gitolite-suexec-wrapper.sh

#!/bin/bash 
# 
#Suexec wrapper for gitolite-shell 
# 

export GIT_PROJECT_ROOT="/home/git/repositories" 
export GITOLITE_HTTP_HOME="/home/git" 

exec ${GITOLITE_HTTP_HOME}/gitolite/src/gitolite-shell

[root@osboxes 存储库]# cat /etc/httpd/conf/httpd.conf

<VirtualHost *:80> 
  # You can comment out the below 3 lines and put correct value as per your server information
  #  ServerName        gitserver.example.com
  #  ServerAlias       gitserver
    ServerAdmin       youremailid@example.com

    DocumentRoot /var/www/git
    <Directory /var/www/git>
        Options       None
        AllowOverride none
        Order         allow,deny
        Allow         from all

    </Directory>

    SuexecUserGroup git git
    ScriptAlias /git/ /var/www/bin/gitolite-suexec-wrapper.sh/
    ScriptAlias /gitmob/ /var/www/bin/gitolite-suexec-wrapper.sh/
    #ScriptAlias /git/ /home/git/gitolite/src/gitolite-shell
    #ScriptAlias /gitmob/ /home/git/gitolite/src/gitolite-shell

    <Location /git>
        AuthType Basic
        AuthName "Git Access"
        Require valid-user
        AuthUserFile /etc/httpd/conf/git.passwd
    </Location>
</VirtualHost>

【问题讨论】:

    标签: linux git apache github gitolite


    【解决方案1】:

    在您的 Gitolite 服务器上检查 /etc/httpd/conf/git.passwd 的内容。

    如果它不包含admin/&lt;encrypted password&gt;,它会将您验证为“匿名”,这意味着您只能访问来自@all 组的存储库。

    【讨论】:

    • 但我的 git.passwd 文件确实包含 admin/
    • 和git daemon服务有关系吗?
    • @VedantAggrawal 可能不是 admin 作为 密码。那或您的/var/www/bin/gitolite-suexec-wrapper.sh/ 没有正确地将您的用户名传递给gitolite。不应该涉及 git 守护进程。实际上,正如我在这里评论的那样,stackoverflow.com/questions/21289643/…,你不应该需要一个包装器。
    • @VedantAggrawal 所以这与使用最近的 gitolite 和过时的教程有关。
    • 所以您建议的可能解决方案是我删除 gitolite-suexec-wrapper.sh 并直接在 httpd.conf 中添加指向 gitolite-shell 的路径?
    猜你喜欢
    • 2011-09-16
    • 1970-01-01
    • 1970-01-01
    • 2020-09-02
    • 1970-01-01
    • 1970-01-01
    • 2013-06-24
    • 1970-01-01
    • 2013-07-01
    相关资源
    最近更新 更多