gitsosis、redmine、passenger:“不是 git 存储库”错误

发布于 2024-09-11 15:03:19 字数 970 浏览 14 评论 0原文

我安装了 gitosis 和 redmine,并通过 CentOS 上的 apache/passenger 运行它。问题是我无法通过 redmine 访问存储库。错误是“在存储库中找不到条目或修订版本。

我的存储库存储在

/home/zenna/repositories/myproject.git

错误(在 apache 日志中找到)是 ”致命:不是 git 存储库: '/home/zenna/repositories/myproject.git'"

它显然是一个存储库,因为它在 WeBrick 服务器上运行良好。我认为这可能是 apache/passenger 权限的问题

所以我尝试 chowning myproject.git 文件夹与 apache:apache 不起作用。 我认为 apache 用户可能也可以访问该目录的父目录,因此我尝试在 /myproject.git 处创建一个到 /home/zenna/repositories/myproject.git 的符号链接。这也不起作用

论坛中有人建议:

您运行脚本/服务器的用户是 拥有 gitosis 的公共证书 存储库,但是 apache/passenger 用户 没有。简单的解决方案......创建一个 您的乘客用户的证书。添加它 到 gitosis 服务器并分配 gitosis.conf 中的权限。我给了我的 apache 用户读取权限 整个 direstory 和所有文件 / 内的文件夹。

但是,我使用 sudo /usr/sbin/apachectl start 运行 apache 用户,

这是否意味着我必须为 root 创建一个公钥并将 root 添加到我的 gitosis.conf 中?尝试通过 redmine 访问存储库的实际用户是什么,root?阿帕奇?乘客?

谢谢

I installed gitosis and redmine and am running it through apache/passenger on CentOS. The problem is I cannot access the repositories through redmine. The error being "The entry or revision was not found in the repository.

My repository is stored at

/home/zenna/repositories/myproject.git

The error (found in the apache logs) is "fatal: Not a git repository: '/home/zenna/repositories/myproject.git'"

It clearly is a repository as it all works fine with the WeBrick server. I think it's probably an issue with the apache/passenger permissions

So I tried chowning the myproject.git folder with apache:apache. That didn't work
I thought perhaps the directory's parents must also be accessible by the apache user, so I tried creating a symbolic link at /myproject.git to /home/zenna/repositories/myproject.git. That didn't work either

Someone in the forums suggested:

You run script/server w/a user that
has a public cert in the gitosis
repos, but the apache/passenger user
doesn’t. Simple solution… create a
cert for your passenger user. Add it
to gitosis server and assign
permissions in gitosis.conf. I gave my
apache user read permissions on the
entire direstory and all files /
folders within.

However, I run apache user with sudo /usr/sbin/apachectl start

Does this mean I would have to create a public key for root and add root to my gitosis.conf? What is the actual user trying to access the repository through redmine, root? apache? passenger?

Thanks

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

怪我入戏太深 2024-09-18 15:03:19

尝试 /home/zenna/repositories/myproject.git/.git 还要确保 Apache 用户可以读取它。

Try /home/zenna/repositories/myproject.git/.git Also make sure it's readable by the Apache user.

家住魔仙堡 2024-09-18 15:03:19

如果 myproject.git 是一个裸存储库并且与 redmine 驻留在同一服务器上,则输入 myproject.git 的完整文件路径。

因此,不要使用 gituser@domain:myproject.git,而是使用 /home/gituser/repositories/myproject.git

If myproject.git is a bare repo and resides on the same server as redmine, then put in the full file path to myproject.git.

So instead of gituser@domain:myproject.git, use /home/gituser/repositories/myproject.git

昇り龍 2024-09-18 15:03:19

使用 Passenger 时,实际用户是 nobody,因此必须确保该目录(包括其所有父目录)对于 nobody 用户是可读的。

When using passenger the actual user is nobody so one has to make sure that the directory (which includes all of its parent directories) are readable by the nobody user.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文