Some help on mod_dav, svn and Limit-ing access please.

耗尽温柔 提交于 2020-01-05 08:56:30

问题


Here's the entry in my Apache configuration file

 <Location /svn/repo1>
DAV svn
SVNPath /var/svn/repositories/repo1
AuthType Basic
AuthName "SVNRepo"
AuthUserFile /var/httpd/passwd
Order deny,allow
Require valid-user
<Limit PUT POST DELETE PROPFIND PROPPATCH MKCOL COPY MOVE LOCK UNLOCK>
    Require user svn
</Limit>

Not sure if its obvious what I'm trying to do, but I want to allow ANY authenticated user read-only access to the repository, but LIMIT PUT POST etc to only 1 particular (authenticated) user. Haven't been able to crack this, was hoping somebody had come across this before?

Thanks in advance.


回答1:


I would do it the other way around:

<Location /svn>
  DAV svn
  SVNParentPath /var/svn

  # Authentication: Digest
  AuthName "Subversion repository"
  AuthType Digest
  AuthUserFile /etc/svn-auth.htdigest

  Require valid-user

  # Authorization: Authenticated users only for non-read-only
  #                (write) operations; allow anonymous reads
  <LimitExcept GET PROPFIND OPTIONS REPORT>
    Require user svn
  </LimitExcept>
</Location>

as suggested in for example: http://svnbook.red-bean.com/en/1.6/svn-book.html#svn.serverconfig.httpd.authz.blanket

the location you use (/svn/repo1) indicates you have several svn repositories you would like to manage? If so I would use the per directory config of svn: http://svnbook.red-bean.com/en/1.6/svn-book.html#svn.serverconfig.httpd.authz.perdir It prevents apache server reloads if you need to adjust the permsissions.



来源:https://stackoverflow.com/questions/9311197/some-help-on-mod-dav-svn-and-limit-ing-access-please

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!