Repository navigation
feat(system): 多站点地址访问控制台 (HQ-Task T261113-11) - #42
Merged
Merged
Conversation
新增选项 AlternateServerAddresses,同一部署可通过多个站点地址打开控制台。 给浏览器的链接跟随用户进来的线路:OAuth redirect_uri(流程开始时记录, 回调换 token 时复用)、密码重置邮件链接、支付完成后的回跳页、/api/status 的 server_address。Origin / Referer / Host 只在已配置地址中做精确匹配, 匹配不上一律回落 ServerAddress;已配置的 HTTPS 地址同时被会话 cookie 的 origin 检查信任。 移植自 71491b3cb,并覆盖其后新增的回跳点:Stripe 支付宝/微信充值、 订阅 Stripe 订阅与一次性 Checkout、订阅 Epay 的浏览器回跳。支付平台 异步通知地址与邮件 OAuth 的 redirect URI 仍使用 ServerAddress。 Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Merged
1 of 5 tasks
Owner
Author
|
HQ-Review R1 @ f08cd8a: REQUEST_CHANGES 审查范围:fork-main(09cca3d)...f08cd8a,三个提交全部看过;与原提交 71491b3cb 逐文件对照,后端核心(server_address.go、RequestServerAddress、RequestBrowserOrigin、auth_origin、oauth/*)与原提交一致,冲突处保留了 fork-main 的行为(completeEpaySubscriptionOrder、Stripe paymentMethod 参数、ValidateRedirectURL 校验、站点内容多语言等均未回退)。 阻塞项
非阻塞项
已核对、无问题
我实际运行的(Windows,Go 1.26.10,worktree 未改动)
|
请求路径不持锁读取、选项同步整体替换,改用 atomic.Pointer 并提供 AlternateServerAddresses / SetAlternateServerAddresses / IsAlternateServerAddress。 Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Owner
Author
|
回复 HQ-Review R1(head c6a2848)。三条修改在同一个提交 c6a2848 里(暂存时误把全部文件一起提交了,提交标题只写了 #3;不 force push,故保留)。
验证(Mac mini,macOS,Go 1.26.10 / Bun 1.4.4,head c6a2848):
未验证:这次没有重跑容器端到端和前端 build; |
Owner
Author
|
HQ-Review R2 @ c6a2848: APPROVE 审查范围:f08cd8ab4..c6a2848(修复提交,22 个文件),并核对它没有改变 R1 已认可的部分。 R1 各项状态
本提交的其他改动
非阻塞项
我实际运行的(Windows,Go 1.26.10,worktree 未改动,head c6a2848)
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
HQ-Task: T261113-11
本 PR 由 AI(Claude Code,claude-fable-5-2)生成,由 Project HQ 会话派发。移植本地提交 71491b3cb 到最新 fork-main(09cca3d97)。
Change
AlternateServerAddresses(每行一个 origin;保存时拒绝路径、通配、非 http(s))。service.RequestServerAddress:Origin / Referer / Host 只在已配置地址里做精确匹配,否则回落ServerAddress。多个或带逗号的 Origin、带 userinfo 的 Referer 视为无效。/api/status的server_address、密码重置链接、OAuth redirect_uri(流程开始时记录,回调时必须仍在配置里,否则回落)、Epay 充值回跳、Stripe 充值(含支付宝/微信)success/cancel、Stripe 订阅与一次性订阅 Checkout、Waffo 回跳、订阅 Epay 的浏览器 return_url 及其后的控制台跳转。ServerAddress/ 回调地址不变:Epay、订阅 Epay、Waffo 的 notify_url;邮件 OAuth redirect URI(未改动);Creem(无服务端回跳地址)、Waffo Pancake(管理员配置的 ReturnURL);额度提醒邮件里的充值链接(无请求上下文);MJ/任务媒体地址。CustomCallbackAddress)。这是原提交没有的新增判断,请审查。Verification
GOWORK=off go test ./common/... ./controller/... ./middleware/... ./model/... ./oauth/... ./service/... ./setting/...:全部 ok(a29dbf4b5;之后只改了一个前端测试夹具)。bun run typecheck无错误;bun run test244 文件 2715 项通过;bun run build成功;改动文件 oxlint 0 error。/api/status:Host/Origin 为 main → main;line2 → line2;未配置主机、配置主机作后缀的主机、带逗号的 Origin → main。未配置备用地址时 line2 的 Host → main。authorization_url的 redirect_uri:main → main,line2 → line2,未配置 → main。https://line2.example.com/app、https://*.example.com、line2.example.com均被拒绝。TestPaymentReturnPathFollowsConfiguredLineOnly、TestSubscriptionEpayReturnFollowsAlternateLineAndNotifyStays(controller/return_path_test.go),原提交的测试全部保留。Not verified / notes
paymentReturnPath("/wallet?pay=fail")(旧签名),两者都合并后需改为paymentReturnPath(c, ...)才能编译。server_address与重置链接现在会去掉ServerAddress末尾的/(前端保存时本来就会去掉)。🤖 Generated with Claude Code