Repository navigation
fix(api): a short deploy token disables only /api/admin - #31
Merged
Merged
Conversation
A CLOUDHAL_DEPLOY_TOKEN under 32 characters threw in createApi, so every /api request of the admin Worker failed with 500 (Cloudflare 1101). This happened when an owner edited CLOUDHAL_DEPLOY_TOKEN instead of CLOUDHAL_SETUP_TOKEN after a Deploy to Cloudflare install. Now the admin routes answer 503 deploy_token_invalid, the problem is logged once, /api/health reports it and the rest of the API keeps working. The Workers Builds setup steps and the deploy button guide say not to edit CLOUDHAL_DEPLOY_TOKEN. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Madraka <asker_17@msn.com>
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.
Merged
Madraka
added a commit
that referenced
this pull request
Oct 20, 2026
fix(api): a short deploy token disables only /api/admin
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.
Problem
A
CLOUDHAL_DEPLOY_TOKENshorter than 32 characters threw insidecreateApi, so every/apirequest of the admin Worker returned 500 (Cloudflare 1101). Studio loaded, but sign-in, publishing and health all failed. This happened in a real Deploy to Cloudflare test: the owner editedCLOUDHAL_DEPLOY_TOKENin the dashboard instead ofCLOUDHAL_SETUP_TOKEN.Change
packages/api/src/routes/admin-mount.ts(new): mounts/api/admin. With a short token it logs one clearconsole.errorand makes/api/admin/*answer 503deploy_token_invalid. Nothing else is affected./api/healthstill returns 200, now withproblems: ["deploy_token_invalid"]when the token is short.features.deployTransferbecomes false in that case.setupInstructions()(Workers Builds) anddocs/guides/deploy-button.mdsay plainly not to editCLOUDHAL_DEPLOY_TOKEN, because every build replaces it, and how to recover.@cloudhal/apiand@cloudhal/cli.createApishrank, so the size baseline was ratcheted down.Tests
short deploy tokentests inpackages/api/test/admin.test.ts. They replace the oldtoThrow(/32/)assertion.@cloudhal/apifull suite: 363 passed.deploy-workers-builds.test.ts: passed. api and cli typecheck: clean.size:checkand biome: clean.pnpm checkwas not run (machine-load constraint).🤖 Generated with Claude Code