Repository navigation
chore(deploy): deploy with the narrow wizardsofodd Workers token - #53
Merged
Merged
Conversation
Route npm run deploy, db:migrate:remote and verify:db:remote through scripts/cf-deploy.sh, which pulls CLOUDFLARE_WORKERS_TOKEN_WIZARDSOFODD and CLOUDFLARE_ACCOUNT_ID from Infisical deploy/dev via keys-axi, maps the token to CLOUDFLARE_API_TOKEN, drops inherited global-key variables and runs the repo's lockfile-pinned wrangler. Replaces wrangler OAuth / account-wide credentials for these commands.
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.
Switches this Worker's Cloudflare commands from wrangler OAuth / account-wide credentials to the site's narrow deploy-only token.
Changes
scripts/cf-deploy.sh <command...>: runskeys-axi run --project deploy --env dev --only CLOUDFLARE_WORKERS_TOKEN_WIZARDSOFODD CLOUDFLARE_ACCOUNT_ID, maps the token toCLOUDFLARE_API_TOKEN, unsets inheritedCLOUDFLARE_EMAIL/CLOUDFLARE_API_KEY/CLOUDFLARE_API_TOKEN, and runs the command with the repo's lockfile-pinned wrangler (node_modules/.bin, 4.127.0) first on PATH. Same pattern as the metaobjects.com Pages deploy script.npm run deploy,npm run db:migrate:remoteandnpm run verify:db:remotego through it.verify:db:remoteis inpredeployand callswrangler d1 execute --remote, so it needs the same credentials.docs/runbook.mdgets a deploy-credentials paragraph. TheCLAUDE.mddeploy line now names the script.Verification (no token value printed)
/accounts/<id>/tokens/verify:success: true, status: active.CLOUDFLARE_EMAIL/CLOUDFLARE_API_KEY/CLOUDFLARE_API_TOKEN: onlyCLOUDFLARE_ACCOUNT_IDandCLOUDFLARE_API_TOKENreach the command, the inherited token is replaced, andwranglerresolves tonode_modules/.bin/wrangler4.127.0.wrangler whoamithrough the script reports API Token auth.wrangler deploy --dry-runthrough the script exits cleanly.