fix(web): wire DOCS_PROXY_URL into deployed Worker env#30
Merged
cooper (czxtm) merged 1 commit intomainfrom May 2, 2026
Merged
fix(web): wire DOCS_PROXY_URL into deployed Worker env#30cooper (czxtm) merged 1 commit intomainfrom
cooper (czxtm) merged 1 commit intomainfrom
Conversation
Every link on stackpanel.com pointing under `/docs/*` (Quick start, Why
Stackpanel, Changelog, Stacks, License, …) currently returns HTTP 503
with `{"error":"DOCS_PROXY_URL environment variable is not configured"}`.
The proxy route at `apps/web/src/routes/docs/$.ts` + `index.ts` reads
`process.env.DOCS_PROXY_URL` and short-circuits with that 503 when the
binding is missing.
Root cause: the proxy was added on 2026-04-23 (74fca2e "Make environment
variables required by default") but `apps/web/alchemy.run.ts` was never
updated to forward the URL into `Cloudflare.Vite({ env })`. The recent
`feat(env): build-time secret injection` commit established the env-
forwarding pattern for `BETTER_AUTH_SECRET` + Polar values but didn't
include this one. So the binding has been absent on every deploy since
the route landed — the docs site itself (`docs.stackpanel.com`) is
healthy, only the apex proxy is broken.
Fix: derive `DOCS_PROXY_URL` per stage to mirror `hostnameFor` in
`apps/docs/alchemy.run.ts` (production → docs.stackpanel.com,
staging → docs.staging.stackpanel.com), and forward it through the same
`Cloudflare.Vite({ env })` block the secrets use. PR previews and dev
fall back to the production docs site since we don't deploy per-PR
docs workers; serving real content is preferable to 503'ing.
The CI memo-bust from PR #27 (.build-info stamp) will force a fresh
upload on push so this actually reaches the deployed Worker.
Contributor
|
Preview deployed to |
PR SummaryLow Risk Overview
Reviewed by Cursor Bugbot for commit 125f274. Configure here. |
cooper (czxtm)
added a commit
that referenced
this pull request
May 2, 2026
fix(web): wire DOCS_PROXY_URL into deployed Worker env
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
Every
/docs/*link on the marketing page (stackpanel.com) currently returns HTTP 503:The proxy route at
apps/web/src/routes/docs/$.ts+index.tsreadsprocess.env.DOCS_PROXY_URLand short-circuits with that 503 when the binding is missing.Root cause: The proxy was added on 2026-04-23 (74fca2e "Make environment variables required by default") but
apps/web/alchemy.run.tswas never updated to forward the URL intoCloudflare.Vite({ env }). The recentfeat(env): build-time secret injectioncommit established the env-forwarding pattern forBETTER_AUTH_SECRET+ Polar values but didn't include this one. So the binding has been absent on every deploy since the route landed —docs.stackpanel.comitself is healthy, only the apex proxy is broken.Fix: Derive
DOCS_PROXY_URLper stage to mirrorhostnameForinapps/docs/alchemy.run.ts, and forward it through the sameCloudflare.Vite({ env })block the secrets use:production→https://docs.stackpanel.comstaging→https://docs.staging.stackpanel.comhttps://docs.stackpanel.com(we don't deploy per-PR docs Workers; serving real content beats 503'ing)The CI memo-bust from #27 (
.build-infostamp) will force a fresh upload on push so this actually reaches the deployed Worker.Test plan
curl -sI https://<preview-url>/docs/quick-startreturns 200 and the rendered Fumadocs page (not the 503 JSON blob)curl -sI https://stackpanel.com/docs/quick-startreturns 200stackpanel.comand confirm each rendershttps://docs.stackpanel.com/...direct hits continue to work unchangedGenerated by Claude Code