【问题标题】:VisualSVN authentication exclusionVisualSVN 身份验证排除
【发布时间】:2019-02-13 13:55:36
【问题描述】:

我已经从 Apache 2.2 托管的 subversion 存储库迁移到了带有 Windows 身份验证(基本)的 VisualSVN(v3.9.2 和 Apache 2.4)。 这是一个新设置,没有升级,在导入存储库后,我可以很好地签出、更新和提交。 此外,可以使用浏览器访问 Web 界面(需要名称和密码)。

现在我想将 pdf 文件排除在身份验证的需要之外,以便任何知道正确 URL 的人都可以使用浏览器查看它们。

在旧设置中,我添加了这个位置部分:

<LocationMatch ^.+\.[pP][dD][fF](\?[pr]=\d+)*$>
    AuthType None   
    Allow from all
    Satisfy Any   
    Require all granted
</LocationMatch>

删除不再受支持的 Allow.../Satisfy... 指令让我可以启动服务器,但在访问 pdf 文件时会给出 500 错误代码。

如果我只有Require all granted 指令,它仍然会要求输入名称和密码。

经过一些研究并与自动生成的 httpd.conf 进行比较后,我添加了一些选项并尝试了它们的不同组合,但都没有奏效:

<LocationMatch "^.+\.[pP][dD][fF]\/?(\?[pr]=\d+)?$">
  AuthType None
  AuthMerging Or
  SVNPathAuthz off
  AuthzVisualSVNAuthoritative off
  SVNOverrideAll on
  Require all granted
</LocationMatch>

如果我将浏览器导航到存储库中的文件夹并输入凭据,然后才导航到它可以工作的 pdf 文件。仅当我在没有事先身份验证的情况下打开指向 pdf 文件的链接时,我才会收到服务器错误。 在服务器上,事件日志显示以下错误消息:

AH00027: No authentication done but request not allowed without authentication for /svn/Test/trunk/test.pdf. Authentication not configured?
[client 10.1.1.254]

Apache 服务器的日志级别更高,我在访问 pdf 时获得了以下信息:

AH01626: authorization result of Require valid-user : denied (no authenticated user yet)
AH01626: authorization result of <RequireAny>: denied (no authenticated user yet)
AH01626: authorization result of Require all granted: granted
AH01626: authorization result of <RequireAny>: granted
AH01626: authorization result of AuthMerging Any: granted

所以看起来 Apache 授予访问权限,但 VisualSVN 仍然需要身份验证。

有没有人做过类似的事情并找到了解决方案?

【问题讨论】:

    标签: svn visualsvn-server


    【解决方案1】:

    VisualSVN 服务器现在不支持匿名访问。用户必须经过身份验证和授权才能查看存储库内容。并且您不应修改服务器的 httpd.conf 或 httpd-custom.conf 文件以启用匿名访问 - 这可能会导致意外行为。

    不要调整 VisualSVN 服务器的配置,而是考虑另一种选择。编写一个脚本,从存储库中获取所需的 PDF 文件,并通过另一个不需要身份验证的 HTTP 服务器使用户可以使用它们。这可以是提交后脚本或轮询存储库并在有更改时下载文件的脚本。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-05-10
      • 1970-01-01
      • 1970-01-01
      • 2023-04-07
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多