views:

2121

answers:

6

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?

+1  A: 

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:

Damian Powell
+1  A: 

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.

eelco
A: 

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.

JtR
+2  A: 

This helped a bunch!

For some odd reason, root owned the .subversion folder in my $HOME, so i deleted it and ran 'svn up' again. Everything is good now.

Voted Up because I googled for this answer and this pointed me in the right direction. '(p)' failing is because ~/.subversion is not owned by the current owner. fix it. if in doubt, run 'strace e-trace=file svn up' and see what file it silently errors on trying to write
Kent Fredric
I had always wondered why SVN would not remember my saved passwords or trusted certs, and this was the answer I needed. Thanks!
Greg W
+1  A: 

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.. :)

Ice_Blade
A: 

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.

dave.zap