Subversion backend selection and authentication configuration

25.03.2006 at 23:31

After a few db corruption and jurnal recovering with the Berkley DB backend i strongly advise you to use the filesystem based backend instead. I think it is by now the default but to be sure set it on the command line. By the way here is a comparison of the thow different backends. Personally i like the fact that if needed the repository data can be manipulated by standard tools.

svndadmin create --fs-type fsfs repo

Once the repository is created you can add your files.

svn import . file:///home/svn/repo -m "Initial commit."

Authentication with svnserve (from the docs)

The default svnserve setup provides anonymous read-only access. This means that you can use an svn:// Url to checkout and update, or use the repo-browser in TortoiseSVN to view the repository, but you won't be able to commit any changes.

To enable write access to a repository, you need to edit the conf/svnserve.conf file in your repository directory. This file controls the configuration of the svnserve daemon, and also contains useful documentation.

You can enable anonymous write access by simply setting:

[general]
anon-access = write

However, you will not know who has made changes to a repository, as the svn:author property will be empty. You will also be unable to control who makes changes to a repository. This is a somewhat risky setup!

One way to overcome this is to create a password database:

[general]
anon-access = none
auth-access = write
password-db = userfile

Where userfile is a file which exists in the same directory as svnserve.conf. This file can live elsewhere in your filesytem (useful for when you have multiple repositories which require the same access rights) and may be referenced using an absolute path, or a path relative to the conf directory. The userfile should have a structure of:

[users]
username = password
...

This example would deny all access for unauthenticated (anonymous) users, and give read-write access to users listed in userfile.

Just in case you do not already know, there is an ebook online which covers Subversion in depth.

Marc

Comments (0)

There are currently no comments available