Subversion Backend Selection and Authentication Configuration

After a few DB corruption and journal 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 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 a 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:

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:

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 file system (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:

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.