I'm having some problems setting up access to my Subversion repositories on a Linux server. The problem is that I can only seem to get an all-or-nothing structure going. Either everyone gets read access to everything or noone gets read or write access to anything.
SVN repos are located in /www/svn/repoA,repoB,repoC...
Repositories are served by Apache, with Locations defined in etc/httpd/conf.d/subversion.conf as:
<Location /svn/repoA> DAV svn SVNPath /var/www/svn/repoA AuthType Basic AuthName "svn repo" AuthUserFile /var/www/svn/svn-auth.conf AuthzSVNAccessFile /var/www/svn/svn-access.conf Require valid-user </Location> <Location /svn/repoB> DAV svn SVNPath /var/www/svn/repoB AuthType Basic AuthName "svn repo" AuthUserFile /var/www/svn/svn-auth.conf AuthzSVNAccessFile /var/www/svn/svn-access.conf Require valid-user </Location> ...
svn-access.conf is set up as:
[/] * = [/repoA] * = userA = rw [/repoB] * = userB = rw
But checking out URL/svn/repoA as userA results in Access Forbidded.
Changing it to
[/] * = userA = r [/repoA] * = userA = rw [/repoB] * = userB = rw
gives userA read access to ALL repositories (including repoB) but only read access to repoA!
so in order for userA to get read-write access to repoB i need to add
[/] userA = rw
which is mental.
I also tried changing
Require user userA
for repoA in subversion.conf, but that only gave me read access to it.
I need a way to default deny everyone access to every repository, giving read/write access only when explicitly defined.
Can anyone tell me what I'm doing wrong here? I have spent a couple of hours testing and googling but come up empty, so now I'm doing the post of shame.
I went with Shane's first solution and ended up with the following working config:
<Location /svn> DAV svn SVNParentPath /var/www/svn AuthType Basic AuthName "Subversion repo" AuthUserFile /var/svn-auth.conf Require valid-user </Location>
[/] * = [repoA:/] * = userA = rw [repoB:/] * = userB = rw