请提供一些有关 mod_dav、svn 和限制访问的帮助。

发布于 2025-01-06 08:41:57 字数 474 浏览 1 评论 0 原文

这是我的 Apache 配置文件中的条目

 <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>

不确定我想要做什么是否显而易见,但我想允许任何经过身份验证的用户对存储库进行只读访问,但将 PUT POST 等限制为仅 1 个特定(经过身份验证的)用户。无法破解这个问题,希望有人以前遇到过这个问题吗?

提前致谢。

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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

_畞蕅 2025-01-13 08:41:57

我会用相反的方式来做:

<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>

例如:http://svnbook.red-bean.com/en/1.6/svn-book.html#svn.serverconfig.httpd.authz.blanket

您使用的位置 (/svn/repo1 ) 表示您有多个想要管理的 svn 存储库?如果是这样,我将使用 svn 的每个目录配置: http://svnbook.red-bean.com/en/1.6/svn-book.html#svn.serverconfig.httpd.authz.perdir
如果您需要调整权限,它可以防止 apache 服务器重新加载。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文