OpenListTeam / OpenListTeam/OpenList
[Feature] 为 S3 direct-link 302 与 Web Proxy 增加显式兼容性契约
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 24.7k
- Forks
- 2.3k
- Avg merge
- 1d 20h
- Merged PRs (30d)
- 36
Description
请确认以下事项
- 我已确认阅读并同意 AGPL-3.0 第15条 。本程序不提供任何明示或暗示的担保,使用风险由您自行承担。
- 我已确认阅读并同意 AGPL-3.0 第16条 。无论何种情况,版权持有人或其他分发者均不对使用本程序所造成的任何损失承担责任。
- 我确认我的描述清晰,语法礼貌,能帮助开发者快速定位问题,并符合社区规则。
- 我已确认阅读了 OpenList文档。
- 我已确认没有重复的问题或讨论。
- 我认为此问题必须由
OpenList处理,而非第三方。 - 我已确认此功能尚未被实现。
- 我已确认此功能是合理的,且有普遍需求,并非我个人需要。
- 我没有阅读这个清单,只是闭眼选中了所有的复选框,请关闭这个 Issue 。
需求描述
OpenList 的独立 S3 endpoint 在 storage 的 web_proxy=false 且没有其他强制代理条件时,已认证的普通对象 GET 如果获得可用的 provider URL-only 直链,可能返回 HTTP 302;并非所有 S3 GET 都会重定向。
在 server/s3/redirect.go 中,redirectHandler 会设置 Location 并返回 http.StatusFound。
对于某些严格的 S3 client(例如 restic),GetObject 收到跨 host 的云盘临时直链 302 后因不符合S3规范,无法读取对象。这个 redirect 不是典型的 S3 region/endpoint redirect,而是把 OpenList 的对象读取改道至 provider 的临时 URL。
将目标 storage 的 web_proxy=true 后,common.ShouldProxy() 会阻止 S3 redirect handler 返回 direct-link,OpenList 本机代理读取,可避开由该跨 host 302 引起的兼容性问题。
实现思路
- 在 S3 文档中明确:
web_proxy=false且满足直链条件时,S3 GET 可能返回 provider direct-link 302,部分 S3 client(包括 restic)可能不兼容。 - 考虑为 S3 endpoint 增加独立、显式的
s3_direct_redirectopt-in;默认以本地代理返回对象内容,或至少针对 repository/workload client 保持 S3 GET 语义稳定。 - 在 UI 中明确 storage 的 Web Proxy 对 S3 的影响。
附加信息
这不会移除 direct-link 优化;它会让管理员能明确选择吞吐优先还是 S3 客户端兼容性优先,并避免将 302 排查成 endpoint、bucket 或 credential 问题。
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with server/s3/redirect.go and trace how common.ShouldProxy() determines whether a provider URL-only direct link is returned. Review the S3 documentation and storage UI paths to define the compatibility contract, then confirm the selected default or opt-in behavior covers strict clients such as restic without removing the existing direct-link option.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- api, backend, cloud
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100