简体   繁体   中英

Multiple svn repositories privileges

I have configured two repositories sites on my server. The first is on /home/svn/repoA and the second on /home/svn/repoB .

I have built a virtualhost on Apache with this information:

<Location />
    DAV svn
    SVNParentPath /home/svn
    AuthType Basic
    AuthName "Servidor SVN"
    AuthUserFile /etc/apache2/dav_svn.passwd
    <LimitExcept GET PROPFIND OPTIONS REPORT>
        Require valid-user
    </LimitExcept>
</Location>

Now this the URL, I can get access to the server with http://svn.mydomain.com/repoA and http://svn.mydomain.com/repoB , but I want to make the repoB private, only allow access with a user and password previously created with the htpasswd on dav_svn.passwd.

If I take out the <LimitExcept GET PROPFIND OPTIONS REPORT> line, and it's closer tag, it asks me the user and the password, but in the two repositories.

Is there a way to make one readable only for anonymous and read/write for logged users and the second repository only read/write rights for logged users?

What resources have you used to get this far? I know there is a free Subversion book (Version Control with Subversion) that has the answer in it:

Apache authn/authz: http://svnbook.red-bean.com/nightly/en/svn.serverconfig.httpd.html#svn.serverconfig.httpd.authz

Path-based authz: http://svnbook.red-bean.com/nightly/en/svn.serverconfig.pathbasedauthz.html

I'd just have 2 location blocks. RepoA should have "Satisfy Any" turned on in the Apache location block for anonymous read-only access, and a corresponding Auth file allowing anonymous access. RepoB's Auth file should deny anonymous access.

ie

Apache repoA conf

<Location /repoA>
  DAV svn
  SVNPath /home/svn/repoA
  AuthType Basic

  Satisfy Any
  AuthName "Servidor SVN"
  AuthUserFile /etc/apache2/dav_svn.passwd
  AuthzSVNAccessFile /path/to/authFileA
</Location>

authFileA

[/]
* = r

[/repoA]
* = r
mark = rw
bill = rw

Apache repoB conf

<Location /repoB>
  DAV svn
  SVNPath /home/svn/repoB
  AuthType Basic
  AuthName "Servidor SVN"
  AuthUserFile /etc/apache2/dav_svn.passwd
  AuthzSVNAccessFile /path/to/authFileB
</Location>

authFileB

[/]
* =

[/repoB]
* = 
mark = rw
bill = rw

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM