无法从Gitolite服务器使用HTTP克隆存储库

时间:2018-09-12 22:24:03

标签: linux git apache github gitolite

我在centOS 7上的ssh和http模式下都运行Gitolite。我照着进行了this教程。

我的问题,我能够通过ssh克隆所有存储库,但是即使将 R = daemon 访问规则添加到所有存储库后,也只能通过http克隆testing.git存储库我想通过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存储库]#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>

1 个答案:

答案 0 :(得分:1)

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

如果不包含admin/<encrypted password>,它将以“匿名”身份验证您的身份,这意味着您只能访问@all组中的存储库。

相关问题