Skip to content

hop→waker 简化:删三变量、改为 key 启停(someday 极简形态) - #163

Merged
todosdev[bot] merged 1 commit into
mainfrom
tds/conv-01a181de-dcfb-7689-8ea0-d1ee4feb759d
Oct 28, 2026
Merged

todosdev[bot] merged 1 commit into
mainfrom
tds/conv-01a181de-dcfb-7689-8ea0-d1ee4feb759d

Conversation

@todosdev

@todosdev todosdev Bot commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • 将 hop 的 waker 调度接入从早期的「变量双模式」简化为 someday 的极简形态:彻底删除 WAKER_MODE、WAKER_URL、WAKER_TRIGGERS 三个变量。
  • 接收端启停只认 WAKER_SIGNING_KEY 单一开关:Secret 存在则验签执行同一份 cleanup,不存在则 fail closed(回 500 signing_key_missing),绝不穿透至 SPA 200 HTML。
  • wrangler.toml 的 [triggers] 静态留存,双跑为默认态;切换至 waker 单调度器作为后续独立小变更(删 [triggers])操作。

Changes

  • 运行时 (apps/worker):
    • src/routes/waker.ts:移除 callbackEnabled / isWakerEnabled / WAKER_URL 门禁,/_waker 恒转 SDK receiver;加 host.notFound 拦截未知路径为 JSON 404,杜绝 SPA 200 穿透。
    • src/types.ts、src/index.ts、src/services/waker.ts、src/waker/README.md、.dev.vars.example:清理模式变量声明与注释,更新为仅认 signing key 启停。
    • wrangler.toml:[triggers] 改为静态配置,移除流水线覆写与变量说明。
    • test/waker-callback.test.ts:更新测试覆盖 key 缺失/空白(500 fail closed)、未挂载路由(JSON 404)与验签正常执行两态。
  • 构建与部署流水线 (.github):
    • deploy.yml:移除 Configure waker mode 步骤及相关变量;Write secrets file 支持可选注入 WAKER_SIGNING_KEY 并输出 waker_signing_key=bound|absent。
    • verify-deployment.sh:移除模式分支,WAKER_SIGNING_KEY_EXPECTED=bound 时断言版本绑定存在,排期固定校验 0 3 * * *。
    • 删除 .github/scripts/configure-waker-mode.mjs 与 .github/scripts/test-waker-mode.mjs,新增 .github/scripts/test-waker-deploy.mjs。
    • turbo.json、ci.yml:清理透传环境变量与 CI 测试清单。
  • 文档:
    • README.md 与 README.zh-CN.md:改写为单 Secret 配置说明与双跑/切换/回滚操作指南。

Testing

  • pnpm test:通过全部 55 项 web 测试与 129 项 worker 单元测试(涵盖 key 两态、防 SPA 穿透、验签/防重放/幂等)。
  • node --test .github/scripts/test-deploy-checks.mjs:45 项部署验证脚本测试全绿。
  • node --test .github/scripts/test-waker-deploy.mjs:8 项 waker 部署契约及配置不变量测试全绿。

- Drop WAKER_MODE/WAKER_URL/WAKER_TRIGGERS from the deploy pipeline, the
  turbo env list and the README; nothing rewrites wrangler.toml any more.
- [triggers] stays static: dual run is the default, and switching to waker
  alone is a separate change that deletes the section.
- WAKER_SIGNING_KEY is injected when present and deploys still succeed when
  absent (receiver fails closed); verify asserts bound/absent.

Checkpoint: 8ecyONV4q3YURaBr6u2z9
@todosdev
todosdev Bot merged commit adfcd69 into main Oct 28, 2026
4 checks passed
@mapxn
mapxn deleted the tds/conv-01a181de-dcfb-7689-8ea0-d1ee4feb759d branch November 8, 2026 11:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants