Skip to content

Preserve Cloudflare Access configuration across deploys - #1495

Merged
RhysSullivan merged 1 commit into
UsefulSoftwareCo:mainfrom
davidwrossiter:fix/1494-cloudflare-access-config
Jul 29, 2026
Merged

Preserve Cloudflare Access configuration across deploys#1495
RhysSullivan merged 1 commit into
UsefulSoftwareCo:mainfrom
davidwrossiter:fix/1494-cloudflare-access-config

Conversation

@davidwrossiter

Copy link
Copy Markdown
Contributor

Fixes #1494.

By default, Wrangler replaces a Worker's live variables with the vars declared in each deployment. The repository placeholders could therefore replace an installation's real Access domain, audience and administrator list. Wrangler still reported success, but the Worker then rejected every request.

  • Enable keep_vars and remove installation-specific Access values from wrangler.jsonc.
  • Keep ENABLE_DEV_AUTH explicitly false so a stale remote override cannot survive a production deploy.
  • Fail closed with an actionable 503 response until ACCESS_TEAM_DOMAIN and ACCESS_AUD are set. Keep authentication failures at 401.
  • Update the setup guidance and add regression coverage for runtime and Wrangler configuration.

Validation:

  • bun run format:check
  • bun run lint
  • bun run typecheck (42/42 tasks)
  • bun run test (36/36 tasks)
  • bun run build in apps/host-cloudflare
  • bunx wrangler deploy --dry-run with normal and bootstrap variables

@RhysSullivan
RhysSullivan merged commit c333ea2 into UsefulSoftwareCo:main Jul 29, 2026
1 check passed
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.

Cloudflare redeploy can overwrite live Access configuration with placeholders

2 participants