tags:

views:

649

answers:

5

If I use multiple repositories, all located under a single root folder, how can I set it up so that they will use a single master svnconf/passwd file for setup but still allow me to customize each if the need arises?

This is on windows but I guess the process would be similar on other systems.

Update: I am using svnserve as a service.

+1  A: 

If you are using svnserve, then the conf/svnserve.conf file in each repository has a configuration item which names the password database file. This is the password-db item in the [general] section, just set them all to point to the same file.

If you're not using svnserve, then this probably doesn't apply.

Greg Hewgill
+2  A: 

svnserve isn't intended for use in large deployments. If you need more fine-grained permissions, or integration etc, use a web server (Apache)

MarkR
+1  A: 

There are different ways of doing that depending on what exactly you want to achieve and the setup you are using

svnserve

If you use svnserve there is a file in each repository which is called svnserve.conf where you can define the password file in use, you could put a password file in the server root and point all your repositories there

it would look like this :

c:\svn\passwd
c:\svn\project1\conf\svnserve.conf
c:\svn\project2\conf\svnserve.conf

then in both svnserve.conf a section like this

[general]
password-db = c:\svn\passwd

should do the trick and will still keep different ACLs (authz file) for each repository

apache

that is a bit more complicated but

<Location /project1>
  DAV svn
  SVNPath C:/Repositories/project1

  AuthType Basic
  AuthName "Subversion Project1 repository"
  AuthUserFile c:/etc/svn-auth-file

  Require valid-user

  AuthzSVNAccessFile c:/etc/svn-acl
</Location>
<Location /project2>
  DAV svn
  SVNPath C:/Repositories/project2

  AuthType Basic
  AuthName "Subversion Project2 repository"
  AuthUserFile c:/etc/svn-auth-file

  Require valid-user

  AuthzSVNAccessFile c:/etc/svn-acl
</Location>

as long as you use the same authuserfile for each svn enabled location you will get your result

Jean
Does the password-db work with relative paths? Are Windows style or Unix style paths required or is it whatever the native path syntax is for the system? These are the questions I wish were answered better in the documentation.
jpierson
Just an FYI, I've tested using relative Windows style paths and all seems to work as expected. +1 for the answer Jean.
jpierson
A: 

I am trying to do SVN-LDAP authentication for multiple projects (Ex, 100 projects, 10 user per project).I have found 2 approaches to do the same.

1) Having common authz file for all the projects like below.

#Project1
[groups]
pm = Sudha,user2
dev = user1

[project:/tag]
@dev= r
@pm = rw

Kind of similar configuration for trunk and branches #Project 2 [groups] dev=user4,user5 [project2:/tag] ..

Now I have located the same authz file in apache and it works fine .

AuthzSVNAccessFile /opt/svn/authz.

Second approach:

Instead to have common authz file, I have single authz file per project.

<Location  /svn/Project1>
........
AuthLDAPURL
"ldap://localhost:3268/dc=aspiresys,dc=com?sAMAccountName?sub?(objectClass=*)" NONE
AuthLDAPBindDN "[email protected]"
AuthLDAPBindPassword somepassword
AuthzSVNAccessFile /opt/svn/repos/Project1/conf/authz
require valid-user
</Location>

<Location /svn/Project2>
.......
AuthLDAPURL
"ldap://localhost:3268/dc=aspiresys,dc=com?sAMAccountName?sub?(objectClass=*)" NONE
AuthLDAPBindDN "[email protected]"
AuthLDAPBindPassword somepassword
AuthzSVNAccessFile /opt/svn/repos/Project2/conf/authz
require valid-user
</Location>

But if I go with this approach I need to restart apache when I am adding new project which might leads to performance issue. But If I go with first approach, and if I made any mistake in authz file it will affect my entire SVN(Consider If i have around 200 project details in common authz file).

Please Let me know what is the best solution for this problem? or Please let me know, if we have any other soln for SVN-LDAP for multiple projects .

If you have a question then I suggest you raise your own question and not try to hijack old threads.
graham.reeds
A: 

This question is similar another question for which I gave this answer.

markonian