在 SVN 中执行提交后挂钩时出现身份验证错误

发布于 2024-08-18 13:44:15 字数 809 浏览 3 评论 0原文

我有一个 SVN 提交后挂钩,可以在向存储库提交时更新工作副本。提交后挂钩执行以下命令:

/usr/bin/svn update /path/to/working/copy

在我启用 Apache mod_dav Require valid-user 指令之前,它工作正常。使用 Windows 版 tortoisesvn 客户端时,身份验证很好,因为它会要求您提供用户名和密码并保存详细信息。但由于这是一个非交互式过程,因此未提供用户名和密码,因此更新失败。

Apache 以用户和组 nobodynogroup 运行,这也是拥有存储库和工作副本的用户和组。

nobody 用户没有密码,因为它无法登录。它只是用于运行 Apache 等。我尝试将 nobody 添加到 dav_svn.passwd 文件使用以下命令:

htpasswd dav_svn.passwd nobody

尝试直接在命令行运行提交后脚本时出现以下错误:

Authentication realm:

更新:

将以下内容添加到 dav_svn.conf:

Allow from 127.0.0.1
Satisfy any

修复了问题,但随后导致另一个问题,因为tortoisesvn 客户端不再需要身份验证。

I've got a SVN post-commit hook that updates a working copy when a commit is made to the repository. The post-commit hook executes the following command:

/usr/bin/svn update /path/to/working/copy

It was working fine until I enabled the Apache mod_dav Require valid-user directive. Authentication is fine when using the tortoisesvn client for windows as it asks for your user name and password and saves the details. But as this is a non-interactive process the username and password is not supplied and the update fails.

Apache runs as user and group nobody and nogroup this is also the user and group that owns the repositories and the working copies.

The nobody user does not have a password as it cannot login in. It's just used to run Apache etc. I tried adding nobody to the dav_svn.passwd file using the following command:

htpasswd dav_svn.passwd nobody

I get the following error when trying to run the post-commit script directly at the command line:

Authentication realm:

Update:

Adding the following to the dav_svn.conf:

Allow from 127.0.0.1
Satisfy any

Fixes the issue but then causes another issue in that the tortoisesvn client no longer requires authentication.

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

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

发布评论

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

评论(2

撕心裂肺的伤痛 2024-08-25 13:44:15

看起来 Apache 正在向您的 svn update 进程询问密码。这对于非交互式过程来说有点烦人。 ;-)

我认为您可能想使用直接文件系统路径而不是通过 Apache 重新签出您的工作副本。

It looks like Apache is asking your svn update process for a password. Which is kind of annoying for a non-interactive process. ;-)

I think you might want to re-checkout your working copy using a direct file system path instead of going through Apache.

暖心男生 2024-08-25 13:44:15

这可能会有所帮助,因为它将允许服务器访问自身:

Allow from 127.0.0.1
Require valid-user
Satisfy any

This may help as it will allow the server to access itself:

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