WebSVN - 存储库中路径的身份验证

发布于 2024-10-05 00:41:55 字数 1734 浏览 4 评论 0原文

我需要简单的“切中要害”教程或如何使用 WebSVN 从单个 Subversion 存储库实现路径(签出目录)授权的简洁示例。

假设存储库是 /svn/repos/r_project 此存储库的两个签出(路径)是 /svn/repos/path1 和 /svn/repos/path2 ... 我想用不同的用户名/密码保护每个路径(目录)。

Subversion 和 WebSVN 安装在 Unix Apache (redhat) 上。我已经可以在 WebSVN 存储库首页中看到两条路径 - 没有任何保护,这工作正常。

我知道如何使用 .htpasswd 保护单个 Web 索引页面,但我尝试通过 WebSVN 页面保护存储库中的单个路径的任何操作都失败了。

Tx

[编辑 11 月 26 日]

最新情况以明确: 我拥有的路径:

Home path in unix: '/var/www/'
Path of WebSVN: '/var/www/websvn2'
Path to repository: '/svn/repos'
Created repository is '/svn/repos/r_project') // so r_project is the repository name 
Two checkout directories of that repository:'/svn/repos/path1' and '/svn/repos/path2'

httpd.conf 中,我有 SVN 和 WEBSVN 的位置(我确实有必要的模块):

<Location /repos>
  DAV svn
  SVNParentPath /var/www/svn/repos
  AuthType Basic
  AuthName "Subversion repository"
  AuthUserFile /etc/svn-auth-file
  Require valid-user
</Location>

<Location /websvn210/>
    Options FollowSymLinks
    AuthType Basic
    AuthName "Subversion Repository"
    Require valid-user
    AuthUserFile /etc/svn-auth-file
</Location>

目前,“svn-auth-file”包含一个用户名的密码。放入“/etc”目录中。

在 WebSVN 的 config.php 文件中,

$config->parentPath("/var/www/svn/repos");  
$config->useAuthenticationFile('/etc/svn-auth-file'); // Global access file

我可以看到签出目录“path1”和“path2”作为常规索引页面,其中包含浏览器中的文件(例如:“http://mydomain” /svn/repos/path1')。但是,当我在浏览器中输入“http://mydomain/websvn210”时,我只能获得登录(确定),而不是 WebSVN 的空主页 - 也就是说,没有存储库或结帐路径!

这是第一个问题:空白页面。 其次,每个路径都有不同的登录名。 注意:这些路径(签出)仅用于读取或下载(Subversion 未进行提交)。

谢谢。

I need simple 'to-the-point' tutorial or neat exemple of How to implement authorization for paths (checkout diretories) out of a single Subversion repository, using WebSVN.

Lets say repository is /svn/repos/r_project
Two checkout (paths) from this repos are /svn/repos/path1 and /svn/repos/path2 ...
I want to protect each path (directory) with a different username/password.

Subversion and WebSVN are installed on Unix Apache (redhat). Already i can see the two paths in the WebSVN repository front page - without any protection this is working fine.

I know how to protect individual web index page with .htpasswd but anything i have tried to protect individual paths in the repository through WebSVN page has failed.

Tx

[EDIT nov26]

Up to date situation to make it clear:
Paths i have:

Home path in unix: '/var/www/'
Path of WebSVN: '/var/www/websvn2'
Path to repository: '/svn/repos'
Created repository is '/svn/repos/r_project') // so r_project is the repository name 
Two checkout directories of that repository:'/svn/repos/path1' and '/svn/repos/path2'

In httpd.conf i have locations for SVN and WEBSVN (i do have the necessary modules):

<Location /repos>
  DAV svn
  SVNParentPath /var/www/svn/repos
  AuthType Basic
  AuthName "Subversion repository"
  AuthUserFile /etc/svn-auth-file
  Require valid-user
</Location>

<Location /websvn210/>
    Options FollowSymLinks
    AuthType Basic
    AuthName "Subversion Repository"
    Require valid-user
    AuthUserFile /etc/svn-auth-file
</Location>

For now, 'svn-auth-file' contains password for one user name. Put in '/etc' directory.

In config.php file of WebSVN i have:

$config->parentPath("/var/www/svn/repos");  
$config->useAuthenticationFile('/etc/svn-auth-file'); // Global access file

I'm able to see checkout directories 'path1' and 'path2' as regular index page with files in the browser (ex: 'http://mydomain/svn/repos/path1'). However, when i go for 'http://mydomain/websvn210' in the browser i only get the login (ok) than an empty home page of WebSVN - that is, no repository or checkout paths!

That's first problem: empty page.
Second, will be to have different login for each path.
Note: those paths (checkouts) are only for reading or downloading (no commit done from Subversion).

THanks.

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

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

发布评论

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

评论(1

孤凫 2024-10-12 00:41:55

您可能正在寻找“authz”。这是众多 之一提供教程

编辑
我认为你将两种不属于在一起的东西混合在一起。访问 Subversion 存储库的一种方法是通过 WebDAV,这似乎有效。另一方面,WebSVN 用于存储库浏览。您将无法提交对 WebSVN URL 的更改。

您的“SVNParentPath”应指向存储库而不是 WebSVN 目录。

SVNParentPath /svn/repos

You might be looking for 'authz'. This is one of the many tutorials available.

EDIT
I think you're mixing two things together which do not belong together. One way to access a subversion repository is via WebDAV, this seems to be working. WebSVN on the other hand is for repository browsing. You won't be able to commit changes to your WebSVN URL.

Your 'SVNParentPath' should point to the repository and not to the WebSVN directory.

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