fix(deploy): core 主域改 zone 路径路由——同 host 上 Custom Domain 优先于路径路由 - #65
Merged
Conversation
#59 真机部署前发现:Cloudflare 语义是 Custom Domain 优先于同 host 的路径 路由,core 挂 Custom Domain 会吞掉模块的 <domain>/m/<id>/*(模块路由拿不到 任何流量)。§5.3 正解:core 与模块全部 zone 路径路由(core=<domain>/*, 模块=<domain>/m/<id>/*,最长前缀胜出)。 - assemble.ts:core routes 改 {pattern: '<domain>/*'}(去 custom_domain) - dns.ts(新):部署期 DNS 自愈——core 改路由形态后 Custom Domain 解绑会 删 CF 自建 DNS 记录,部署脚本幂等补建代理 A 记录(192.0.2.1 占位), zone 逐级上溯探测(无需 config zone 字段,#59 待定案①定案) - steps.ts:core 部署后立即 ensureDns(先于模块部署与冒烟),测试注入口 ensureDns + configOverride - 测试:assemble/三方一致性断言同步 zone 形态;dns.test.ts 5 用例(上溯/ 幂等/无 token/未找到/创建);steps.test 顺序断言(deploy → ensureDns → registry);README 权限表补 DNS Edit、路由形态章节、删假设段 Signed-off-by: huangyinghui <18666119673@163.com>
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.
真机部署前发现的硬约束
Cloudflare 路由语义:同一 host 上 Custom Domain 优先于路径路由(官方文档 + 社区证实:Worker A 挂
example.comCustom Domain,Worker B 挂example.com/shop*路由 → B 拿不到任何流量)。#61 合入的形态是「core 保留 Custom Domain + 模块 zone 路径路由」——真机一部署,模块路由会被 core 全吞,#57 修完等于没修。这正是 #59 验收清单里的「真机重验」环节要抓的东西,现在提前在部署前抓到了。
修法:core 也走 zone 路径路由(§5.3 正解)
<domain>/*,模块 =<domain>/m/<id>/*,最长前缀胜出dns.ts):幂等补建代理 A 记录(192.0.2.1 占位),zone 逐级上溯探测,不引入 config zone 字段(deploy: 回归 §5.3 路径制(B 方案)——zone 路径路由 + API Token + 三方一致性红测(含 hello 页 ESM 修复) #59 待定案①就此定案)改动
<domain>/*验证
Ref #59