Subversion Administration
Hi all,
Can someone help me or point me to a decent tutorial on Subversion administration?
I have jailshell access to a shared hosting server with SVN installed. I have set up a repository under my user account, but have been unsuccessful in accessing it using a client.
We run Apache 1.3, so as far as I know I need to use svnserve. I've started it using the following command:
# svnserve -d --listen-host example.com -r /home/$USER/repos
This runs without producing any messages.
However, when attempting to connect (I'm using TortoiseSVN—if anyone can recommend any other clients, that would be appreciated too) I receive the following error:
Error * Can't connect to host 'example.com': A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.
I've read bits of Chapter 5 of the Version Control with Subversion book, but found it rather difficult to follow.
Any pointers would be greatly appreciated.
Cheers,
- P
Edit: Ah—I suppose I have to get port 3690 forwarded?
Re: Subversion Administration
You could try installing the windows command-line svn programs. I find it easier to work from a commandline interface with subversion, but i'm usually working on OSX/Linux. Last time I used TortoiseSVN (about a year ago), I found it to be lacking in features and not always working properly. I could not get it to connect to svn repositories over ssh (didn't try http/apache).
Take a look at Version Control with Subversion, a free book on subversion published by O'Reilly.
EDIT:
Looks like you want to read chapter 6 of the book, not chapter 5 :)
The Subversion page from the Ubuntu help has some basic info on how to access a repository via svnserve.
You probably need to edit the conf/svnserve.conf file in your repository directory if you haven't already, to allow external svnserve access.
Re: Subversion Administration
Thanks. I am waiting for the server owner to get back from a holiday, so that I can discuss it with him and hopefully get the port forwarding configured correctly.
In the meantime, I am trying to access the repository locally (on the server).
I can check it out, and add files, but when I then try to commit these I receive the following error message:
# svn ci
[...]
svn: Commit failed (details follow):
svn: Authorization failed
svn: Your commit message was left in a temporary file:
At a guess, I think I need to add users to the repository.
How do I do this?
Edit: Didn't see your last edit. I will check out that link now.
Re: Subversion Administration
Great! That last article was just what I needed.
Thanks for that. I'll mark this resolved once the port forwarding is set up.
Re: Subversion Administration
You might also have to configure iptables on the server to allow connections from particular subnets / machines on that port. I usually find that iptables is a likely culprit in a lot of situations.
Re: Subversion Administration
Cheers Woss; I'll look into that too.
Re: Subversion Administration
Two things that I don't yet understand:
- If I connect to the repository using svn+ssh, as far as I know the authentication is handled through SSH. So where does the logged user name come from when I check in a file? Is it the remote system account name? If so, how can I get multiple users to access a repository through a single system account?
- When connecting using svn+ssh, a new svnserve process is spawned. How can I set its -r option? Is there some configurable default?
Re: Subversion Administration
Quote:
Originally Posted by penagate
Two things that I don't yet understand:
- If I connect to the repository using svn+ssh, as far as I know the authentication is handled through SSH. So where does the logged user name come from when I check in a file? Is it the remote system account name? If so, how can I get multiple users to access a repository through a single system account?
- When connecting using svn+ssh, a new svnserve process is spawned. How can I set its -r option? Is there some configurable default?
- On linux/mac systems the svn information for a particular working copy (checkout) is stored in the .svn folder of that directory. The repository information is stored here, including the username to access the repository. The syntax for the commandline svn+ssh command is svn+ssh://user@host/path/to/repository (on linux/mac) so you're specifying the user of the account on the remote machine that contains the repository. If you want multiple people to access the repository then they all must have access to the user account on the remote machine, either through password access or the more secure ssh-keys access.
- I'm not really sure how svnserve works, but is there anything stopping you from just providing the absolute path to the repository?
Re: Subversion Administration
- OK, I get that part. But what then determines the name that is logged against the revision when someone checks in an entry?
- No, but if there's a way not to, I'd rather do that, if merely for the sake of prettiness and a shorter URL.
Re: Subversion Administration
I don't know enough about subversion to answer your question about log names, but when I did a simple test just now using two client computers and a server hosting the svn repository, the only name that seemed to be logged in the repository was the user on the server that hosted the repository. There might be other data that I don't know about though.
Re: Subversion Administration
Oh—I'm a bit of an idiot—I think you might have already answered that with the .svn data. Can you specify the repository username/password when checking out an initial revision using svn+ssh?
I'd test it, but so far I can only get one computer to access the server.
Thanks for all your help so far. :thumb:
Re: Subversion Administration
Quote:
Originally Posted by penagate
Can you specify the repository username/password when checking out an initial revision using svn+ssh?
As far as i know, you have to specify these details since you are effectively logging in to the remote server via ssh, just sending svn data over the connection instead of a normal login shell.
Re: Subversion Administration
I think if you wish to allow multiple people to commit with different usernames, but you only have one username on the server, you might be able to do so inside of a chroot environment.
Re: Subversion Administration
If subversion works the same way as CVS, you can probably set up CVS specific users which will all use a single system account but stuff will be checked into CVS with the CVS specific user name. Check out the "users" file if SVN has such a thing :)