tags:

views:

214

answers:

5

Hello,

I am about to set up a subversion server to be accessed via svn+ssh. I was wondering, where the default repository location is (on a unix box).

Do you put it in

/opt/svn

or

/home/svn

or

/usr/subversion

or even

/svn

or somewhere else?

I am looking for the place, most people put it. Is there a convention?

EDIT:

It is absolutely possible to "hide" the actual repository location from the user. For example (in my case) by wrapping the svnserve executable in a way that it is called like:

svnserve -r /var/svn/repos
+5  A: 

I typically place the repositories somewhere under /var, usually in /var/lib/svn - I'm trying to follow the Filesystem Hierarchy Standard which has this to say about the purpose of /var:

/var is specified here in order to make it possible to mount /usr read-only. Everything that once went into /usr that is written to during system operation (as opposed to installation and software maintenance) must be in /var.

Mihai Limbășan
+3  A: 

/home/svn here, mostly because I thought that at some point I might need a svn user...

agnul
I like having my svn repo in /home (and apache hosted files, etc.) so that everything that would need to persist in the event of an OS reinstall is on one partition. This makes backup a bit easier as well.
antik
+1  A: 

It should definitely be in /var. I keep mine in /var/lib/svn. /opt is useful for keeping applications that you might not necessarily want as part of the system, for example: Firefox or MySql. A repository is not an application so it doesn't make sense to keep it in /opt.

And like the comment above you can refer to the FHS

Joe Chin
+2  A: 

Based on the new FHS, you're supposed to put "Data for services provided by this system" into the /srv directory. There isn't any other guidance in the FHS except to put everything that is data for services in that directory, such as http, etc. I would suggest /srv/svn/.

dexedrine
+2  A: 

As far as the path for the repository goes, I like to partition and mount a directory called repository on it ;)

/repository

This way I can check the size easily using "df"

Is it possible to hide the absolute path from the users?

To answer this question, yes, but only if they don't have full access to the box. You set them up with an account, and have them generate a public/private key to login but you never give them the password.

Then you cat their key into /home/<_user>/.ssh/authorized_keys and you edit the settings so that logging in with said key launches svn-serve.

command="/usr/local/bin/svnserve -t -r /repository/"

Now create a project in the repository:

svnadmin create /repository/proj1

With SVN you have to give the user read/write access to the project directory. Then they are able to check out code like:

svn co svn+ssh://host/proj1

The user never sees or knows the absolute path of the repository.

ceretullis