Repository navigation
Treat production DOMAINS as a Worker secret and drop keep_vars - #63
Merged
Merged
Conversation
keep_vars is unsupported by the cf CLI and this public Worker has no dashboard-only plains left. DOMAINS is sensitive inventory, so it is a Worker secret rather than wrangler vars. secrets.required lists DOMAINS so Builds fails closed when the secret is missing. Real domains stay out of this public repository. Co-authored-by: Mark Danielson <stc93025mn@users.noreply.github.com>
Add a dedicated Production DOMAINS secret section that tells operators and forks how to set or rotate the secret (dashboard Secrets or wrangler secret put DOMAINS), never commit the value, and keep example.com / example.org / example.net only in tests and .dev.vars.example. Agent docs point at that section. Co-authored-by: Mark Danielson <stc93025mn@users.noreply.github.com>
stc93025mn
marked this pull request as ready for review
September 29, 2026 02:47
stc93025mn
enabled auto-merge (squash)
September 29, 2026 02:47
Raise the existing fast-uri 3.x floor from <3.1.5 to official 3.1.7 so ajv's transitive fast-uri resolves the GHSA-58mr-gqgx-xq4g / GHSA-qw65-cvwx-89v3 first_patched release. The prior ^3.1.5 override still resolved 3.1.6, which osv-scanner scores as two 7.5 groups. Co-authored-by: Mark Danielson <stc93025mn@users.noreply.github.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.
Summary
Closed draft #62 committed production
DOMAINSintowrangler.jsoncvars. That approach is forbidden in this public repository.This PR takes the fleet direction (config owns plains; drop
keep_vars) without putting the domain list in git:keep_varsfromwrangler.jsoncand--keep-varsfrompnpm deploy:cloudflare.DOMAINSas a Cloudflare Worker secret, not a plain var.secrets.required: ["DOMAINS"]so Builds/wrangler deployfails closed if the secret is missing..dev.vars.examplestay on example.com / example.org / example.net.Runtime is unchanged:
src/index.tsstill readsenv.DOMAINSas a comma-separated string. Secrets bind the same way.Security floor (unblocks merge)
The org Public Token-Free Security ruleset requires the Security workflow to pass. osv-scanner reported 2 high-severity (≥7.0) groups on
fast-uri@3.1.6:This matches prior security-floor PRs (#61 hono, #59
@humanfs/node, #58 adm-zip): raise thepnpm-workspace.yamloverride to the official first-patched 3.x release (fast-uri@>=3.0.0 <3.1.7: 3.1.7) and refresh the lockfile so ajv's transitivefast-uriis 3.1.7. Secrets /keep_vars/ README work is unchanged. No real domains. No deploy.Local
osv-scannerafter the pin: 0 groups withmax_severity >= 7.0. Remaining findings are below the ruleset floor (ip-address6.9/6.3,qs6.3,undici5.9).Primary user-facing guidance
README.md Production
DOMAINSsecret is the operator and fork guide:DOMAINSis a Cloudflare Worker secret.wrangler secret put DOMAINS..dev.vars.exampleuse only example.com / example.org / example.net.Quick Start, local/dev, deploy, and add/remove-domain sections link to that section. AGENTS.md and CLAUDE.md defer to it.
Why a secret
The one "plain" that would have lived in config is sensitive inventory (which domains this Worker serves). Making it a secret lets us remove
keep_vars(unsupported by the cf CLI) without committing the list.Ops before first Builds deploy after merge
Convert the existing dashboard plain
DOMAINSvariable to a secret first (see README). Secrets survive deploys; leftover plains do not oncekeep_varsis gone.Adding a domain is the same as before, except the list is a secret: update the Worker secret, then dashboard routes and
openpgpkeyDNS.Do not set or rotate the secret from GitHub Actions or a Cloud Agent. This PR does not deploy, touch DNS, or use
CLOUDFLARE_API_TOKEN.Docs
No sibling MNPPI Workers used
secrets.required; this follows the official Wranglersecretsconfiguration property so Builds fails closed instead of shipping a Worker that 500s on missingDOMAINS.Verification
Local checks on this branch (example domains only; no deploy):
pnpm run format:check— passpnpm run typecheck— passpnpm run lint— passpnpm run coverage— 17/17 tests pass, 100% statements/branches/functions/linespnpm run knip— passpnpm cf:check(wrangler deploy --dry-run) — pass; dry-run reports no config bindings (the secret is not invars) and does not deployWrangler 4.123 warns that the
secretsfield is experimental. Tests bind exampleDOMAINSviavitest.config.ts, so the local-dev "missing required secrets" warning does not fail CI.