Skip to content

[Enhancement] 明确并配置 S3 direct-link 302 与 Web Proxy 的兼容性行为 #2796

Description

@nostalume

背景

OpenList 的独立 S3 endpoint 在 storage 的 web_proxy=false 时,会对已认证的普通对象 GET 返回 provider direct-link 的 HTTP 302。

server/s3/redirect.go 中,redirectHandler 会设置 Location 并返回 http.StatusFound

兼容性问题

对于某些严格的 S3 client(例如 restic),GetObject 收到跨 host 的云盘临时直链 302 后不能可靠继续读取对象。这个 redirect 不是典型的 S3 region/endpoint redirect,而是把 OpenList 的对象读取改道至 provider 的临时 URL。

将目标 storage 的 web_proxy=true 后,common.ShouldProxy() 会阻止 S3 redirect handler 返回 direct-link,OpenList 本机代理读取,兼容性问题消失。

建议

请将此行为作为 S3 compatibility 的显式选项和文档化契约:

  1. 在 S3 文档中明确:web_proxy=false 会让 S3 GET 返回 provider direct-link 302,部分 S3 client(包括 restic)可能不兼容。
  2. 考虑为 S3 endpoint 增加独立、显式的 s3_direct_redirect opt-in;默认以本地代理返回对象内容,或至少针对 repository/workload client 保持 S3 GET 语义稳定。
  3. UI 中把 storage 的 Web Proxy 对 S3 的影响写清楚。

价值

这不会移除 direct-link 优化;它会让管理员能明确选择吞吐优先还是 S3 客户端兼容性优先,并避免将 302 排查成 endpoint、bucket 或 credential 问题。

Metadata

Metadata

Assignees

No one assigned

    Labels

    invalidInvalid Content/Cannot Reproduce

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions