Subversion 挂钩不会永久接受证书
我希望有人能够回答我的问题。
我设置了 Subversion,由 Apache2+SSL 提供服务,进行 Web 开发。
我想要一个在我的测试服务器上运行 svn update 的提交后挂钩,这样当有人提交时,它会自动更新测试站点。 该挂钩不起作用,因为证书是自行生成的并且不受信任。
我试图永久地接受,但事实并非如此。
有任何想法吗?
I hope someone will be able to answer my question.
I have Subversion set up, served by Apache2+SSL, doing web development.
I want a post-commit hook that runs svn update on my testing server, so when someone commits, it will automatically update the testing site. The hook doesn't work because the certificate is a self generated one and it's not trusted.
I've tried to accept (p)ermanently, but it doesn't.
Any ideas?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(7)
root 拥有我的 $HOME 中的 .subversion 文件夹,因此我将其删除并再次运行“svn up”。 现在一切都很好。
root owned the .subversion folder in my $HOME, so i deleted it and ran 'svn up' again. Everything is good now.
在Linux下:
这里我通过将$HOME/.subversion/auth/svn.ssl.server中的文件chmod到-rw-r--r--来解决这个问题。
显然,如果服务器获得新的或升级的证书,它会写入新文件,但不会为其自身添加写入权限。 使用 -r--r--r-- 权限,svn 程序可以工作,但它无法将“永久接受”标志写入文件..:)
Under Linux:
Here I fixed the problem by chmodding the files in $HOME/.subversion/auth/svn.ssl.server to -rw-r--r--.
Apparently, if a server gets a new or upgraded certificate, It writes the new file, but doesn't add write-rights for itself. with -r--r--r-- rights the svn program works, but it can't write the "Accept permanently" flag to the file.. :)
您没有说明您的测试服务器正在运行什么平台,但如果它是 Windows 机器,那么您需要将证书添加到测试服务器的证书存储中。 以下 technet 文章可能会有一定用处:
You didn't say what platform your testing server is running, but if it's a Windows box, then you need to add the certificate to your testing server's certificate store. The following technet articles might be of some use:
Subversion 可能以与您在钩子调用时接受证书的用户不同的用户身份运行。 尝试找出用户(例如,在提交后挂钩脚本中放入“echo $USER > /tmp/svn-hook-user”)并使用 sudo 作为该用户接受证书。
或者,查看 Subversion 书籍,了解如何设置配置以便接受自签名证书:SSL 证书管理。
It might be that subversion is running as a different user then the one you accepted the certificate with when called by the hook. Try to figure out the user (e.g., put "echo $USER > /tmp/svn-hook-user" in the post-commit hook script) and use sudo to accept the certificate as that user.
Alternatively, check out the Subversion book on how to set up your configuration so that self-signed certificates are accepted: SSL certificate management.
您在脚本中使用 sudo 还是其他东西? Sudo 通常会清理环境变量,因此 HOME 不存在。 您必须有可写的主目录,其中 subversion 可以存储有关永久接受的证书的信息。 因此,在脚本的开头自行设置 HOME 变量,它应该可以工作。
Are you using sudo or something in the script? Sudo usually cleans the environment variables so HOME doesn't exist. You must have writable home directory where subversion can store the information about permanently accepted certificate. So set HOME variable yourself in the beginning of the script and it should work.
在使用 Apache 的 Window Server 上进行设置时遇到了同样的问题。 提交后挂钩将会失败。 我不确定 SVN 是否独立,但我使用作为 Windows 服务运行的 VisualSVN Server。 该服务的默认用户帐户是网络服务 - 所以我只需将该帐户更改为我自己的管理员帐户,一切就都正常了。
Had the same issue setting this up on Window Server with Apache. The post commit hook would fail. I'm not sure about SVN stand alone but I use VisualSVN Server that runs as a Windows Service. The default user account for this service was Network Service - So I simply changed the account to my own admin account and every thing worked.
当您的测试站点位于同一服务器上时,请使用 file:/// 签出存储库以避免证书检查。
When your tesing site is on the same server use file:/// to checkout the repository to avoid the cert check.