Repository navigation
ONE-253: deploy via --secrets-file + .dev.vars.example + var provenance - #142
Merged
Merged
Conversation
- deploy workflow: add fail-closed 'Write secrets file' step (JWT_SECRET / TOTP_ENCRYPTION_KEY / SETUP_SECRET -> $RUNNER_TEMP/secrets.json, mode 600, per-key non-empty check naming any missing secret); Deploy step passes --secrets-file so wrangler uploads them as Cloudflare Secrets. - add apps/worker/.dev.vars.example listing the 7 keys with empty values. - CLAUDE.md / README.md / README.zh-CN.md: register provenance for APP_NAME / APP_URL / RP_ID / APP_ORIGIN (CF dashboard only, not migrated, values immutable).
Per parent ONE-249 final decision: the CI secrets list contains exactly two keys (JWT_SECRET, SETUP_SECRET), both fail-closed validated; TOTP_ENCRYPTION_KEY is not referenced, validated, or written by the deploy workflow.
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.
ONE-253 — 运行时密钥 CI 化(--secrets-file)+ .dev.vars.example + 出处登记
按父单 ONE-249 冻结契约实现,全部改动为 CI/文档,不改应用代码(env 读法不变)。
改动文件
.github/workflows/deploy.ymlJWT_SECRET/TOTP_ENCRYPTION_KEY/SETUP_SECRET三个 GitHub Secret 写入$RUNNER_TEMP/secrets.json(node 生成,mode 0600 并 chmod 600);写入前逐个校验非空,缺一立即::error::点名并中止(失败关闭),绝不用空值覆盖 CF 现有 Secret。pnpm run deploy -- --secrets-file "$RUNNER_TEMP/secrets.json",随部署上传为 Cloudflare Secret。$RUNNER_TEMP、不写仓库工作区。apps/worker/.dev.vars.example(新增):只列 7 个键名、值为空,无真实密钥。CLAUDE.md/README.md/README.zh-CN.md:登记APP_NAME/APP_URL/RP_ID/APP_ORIGIN四个普通 var 出处(CF Dashboard 设置、本单不迁动),值严禁变更(RP_ID/APP_ORIGIN 关系 WebAuthn 通行密钥)。自测证据
pnpm check:108 files,无错误pnpm typecheck:2 tasks successfulpnpm build:2 tasks successfulpnpm test:85 pass / 0 failshellcheck .github/scripts/*.sh:exit 0node --test .github/scripts/test-d1-migrations.mjs .github/scripts/test-deploy-checks.mjs:26 pass / 0 fail未跑项:workflow 本身需在 GitHub Actions 上运行(无 CF 凭据/无法本地触发),已按本地脚本等价演练核心逻辑。