How can I adjust subversion repository file permissions automatically for use w. Apache/DAV?

Solution 1:

When you access the repository with Apache, the user Apache runs as must have write permission. So, the simplest solution is to give the repository to this user.

Here is how it looks on my Debian machine where Apache runs as www-data:

    % ls -ald /home/Subversion-Repository 
    drwxr-xr-x 7 www-data www-data 4096 Nov 14 10:02 /home/Subversion-Repository

This is only a problem if you want the same repository to be accessible via Apache/DAV and via another mean. But this practice is discouraged. I quote:

Fortunately, most repository administrators will never need to have such a complex configuration. Users who wish to access repositories that live on the same machine are not limited to using file:// access URLs—they can typically contact the Apache HTTP server or svnserve using localhost for the server name in their http:// or svn:// URL. And maintaining multiple server processes for your Subversion repositories is likely to be more of a headache than necessary. We recommend that you choose a single server that best meets your needs and stick with it!

Solution 2:

The long term solution is to use ACLS to allow the www user write access to the directory tree and all future directories created in the tree.

Try this URL to get started.

http://www.onlamp.com/pub/a/bsd/2005/09/22/FreeBSD_Basics.html

-Brian