多个svn仓库权限

发布于 2024-10-20 08:54:21 字数 817 浏览 3 评论 0原文

我在我的服务器上配置了两个存储库站点。第一个位于 /home/svn/repoA 上,第二个位于 /home/svn/repoB 上。

我已经使用以下信息在 Apache 上构建了一个虚拟主机:

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

现在这是 URL,我可以使用 http://svn.mydomain.com/repoAhttp:// 访问服务器svn.mydomain.com/repoB,但我想将 repoB 设为私有,只允许使用之前在 dav_svn.passwd 上使用 htpasswd 创建的用户和密码进行访问。

如果我取出 行,并且它是更接近的标记,它会询问我用户和密码,但在两个存储库中。

有没有一种方法可以使一个存储库仅对匿名用户可读,对登录用户具有读/写权限,而第二个存储库仅对登录用户具有读/写权限?

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?

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

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

发布评论

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

评论(2

雨落星ぅ辰 2024-10-27 08:54:21

您使用了哪些资源来实现这一目标?我知道有一本免费的 Subversion 书(使用 Subversion 进行版本控制),里面有答案:

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

基于路径的身份验证:http://svnbook。 red-bean.com/nightly/en/svn.serverconfig.pathbasedauthz.html

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

月亮邮递员 2024-10-27 08:54:21

我只有 2 个位置块。 RepoA 应该在 Apache 位置块中打开“满足任何”以进行匿名只读访问,并且相应的 Auth 文件允许匿名访问。 RepoB 的 Auth 文件应拒绝匿名访问。

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

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.

i.e.

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