【问题标题】:add gitlab repository to redmine将 gitlab 存储库添加到 redmine
【发布时间】:2013-12-17 15:56:31
【问题描述】:

我正在尝试将 gitlab 存储库添加到 redmine,但是当通过 redmine 访问存储库时,会显示以下消息:

“在存储库中找不到条目或修订版。”

我的仓库配置:

redmine: 2.4.1
操作系统: ubuntu

编辑:

www-data 权限测试:

root@Development:~# su www-data
$  ls /home/git/repositories/mapb_1990/test.git/
branches  config  description  HEAD  hooks  info  objects  refs

【问题讨论】:

  • 运行Redmine的进程是否有权访问该git repo?例如,如果您使用 Apache 为 Redmine 提供服务,那么 apache/httpd 用户是否有权访问文件系统中的 git repo 目录?
  • 是的。我用 www-data 用户运行 ls cmd 到 repos,运行没有问题。

标签: git ubuntu redmine gitlab


【解决方案1】:

如果您在 Apache 中使用Passenger 模块,它可能在nobody 用户(而不是www-data)下运行。 结帐:

root@Development:~# ps auxf | grep -A 8 -e "/usr/sbin/apache2 -k star[t]" -e /usr/local/share/redmin[e]

并查找以 PassengerRack 开头的进程:它们是否在 nobody 下运行(我遇到了完全相同的问题,现在已修复,所以我不能检查你应该有什么确切的输出)。

(Redmine 在我的设置中位于 /usr/local/share/redmine)。

而且,在默认设置中,nobody 无法访问 /home/git/repositories/

root@Development:~# su nobody
sh-4.2$ ls /home/git/repositories/
ls: cannot access /home/git/repositories/: Permission denied

你有两个选择:

  • 使“/home/git/repositories/mapb_1990/test.git/”的路径可供所有人使用 (chmod -R o=rx /home/git/repositories/mapb_1990/test.git/)
  • 通过在您的 VirtualHost 文件中添加以下行来更改 VirtualHost 配置中的乘客使用和组:

    <IfModule mod_passenger.c>
        PassengerUser www-data
        PassengerGroup www-data
    </IfModule>
    

    您可能还想运行这些命令以确保将以前 nobody:nogroup 拥有的文件传输到 www-data:www-data

    root@Development:~# find /usr/local/share/redmine -user nobody -exec chown www-data {} \;
    root@Development:~# find /usr/local/share/redmine -group nogroup -exec chgrp www-data {} \;
    

    然后重启 Apache:

    root@Development:~# service apache2 restart
    

【讨论】:

    猜你喜欢
    • 2021-04-02
    • 2018-03-12
    • 1970-01-01
    • 1970-01-01
    • 2018-03-09
    • 1970-01-01
    • 2019-10-13
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多