feat: pluggable CDN deploy provider — Cloudflare R2 via Alchemy (Zephyr fallback) - #58
Open
elliotBraem wants to merge 4 commits into
Open
feat: pluggable CDN deploy provider — Cloudflare R2 via Alchemy (Zephyr fallback)#58elliotBraem wants to merge 4 commits into
elliotBraem wants to merge 4 commits into
Conversation
…2 via Alchemy Add deploy.cdn provider selection (zephyr default, cloudflare opt-in) with a bos-managed Alchemy sandbox in .bos/alchemy, alchemy.run.ts generation (R2 bucket + custom domain + CORS + per-workspace upload Actions), local SRI computation, publish orchestration with fail-fast credential checks, and a first-class bos cdn login command. Gate withZephyr behind BOS_CDN_PROVIDER in all build configs.
….md provider guide Add plans/infra/cloudflare-cdn-alchemy.md (phases 0-2 done), correct the stale toml-infra-alchemy.md phase status, and document the deploy.cdn option and bos cdn login in AGENTS.md.
Set deploy.cdn to cloudflare and adopt the cdn.citynode.app R2 URLs written by the deploy.
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
Implements Phases 0–2 of
plans/infra/cloudflare-cdn-alchemy.md: a pluggable CDN deploy provider forbos publish --deploy. Railway keeps the whole app (host executes api/ui/plugin MF remotes in-process); Cloudflare R2 (custom domaincdn.citynode.app, managed by Alchemy) replaces Zephyr for MF remote bundles. Zephyr stays the default and remains a selectable fallback.[deploy]config section —deploy.cdn: "zephyr" | "cloudflare"+ optionaldeploy.cloudflare(hostname,bucket,zone), ordered betweenciandapp, merged throughextends, staging-aware domain resolution, legacyci.railway.servicemapping (resolveDeployConfig)BOS_CDN_PROVIDERenv +useZephyrgate in all 8 rspack/rsbuild configs; cloudflare builds skip Zephyr and don't expect deploy URLseverything-dev/cdnmodule: pinned sandbox install in.bos/alchemy/(isolated Effect 4 peer resolution — alchemy 2.x peers on effect ≥4 while this repo pins 3.21), generatedalchemy.run.ts(R2 bucket + custom domain + CORS + per-workspace upload Actions), publish orchestration with fail-fast credential checks, local SRI computation, R2 URLs written intobos.config.jsonbefore the FastKV publishbos cdn login— first-class command (installs the sandbox, runs the alchemy OAuth flow)deploy.cdn: "cloudflare"+cdn.citynode.appURLs (deployed and published to FastKV)Usage
Rollback: set
"cdn": "zephyr"and re-runbos publish --deploy.Known issues
content-type: application/octet-streamand no cache-control — a@distilled.cloud/corebug (protocol-http.tsbody attachment unconditionally overwrites the explicitContent-Typeheader) plus the R2 REST PUT path not persistingCache-Control. Symptom: the deployed CDN serves stylesheets as octet-stream (browsers refuse them — "no CSS"). Root cause fully diagnosed; fix (S3-compatible uploads via aws4fetch + R2 S3 tokens, or upstream SDK bump) lands as a follow-up on this branch, followed by acdn.citynode.appedge-cache purge. Until then the deployed UI is unstyled.CLOUDFLARE_*secrets yet) — Phase 3 wiring is a follow-up; local deploys are unaffected.Follow-ups
.scratch/cloudflare-cdn/issues/02-r2-upload-metadata.md)CLOUDFLARE_API_TOKEN,CLOUDFLARE_ACCOUNT_ID,CI=true).scratch/cloudflare-cdn/issues/01-effect-4-migration-and-alchemy-desandbox.md)Verification
deploy-config,build-cdn-provider,cdn)bun typecheck(8 workspaces) andbun lint(605 files) cleaneffect@4.0.0-rc.112; generated stack imports cleanly;bos cdn login+ full local deploy executed end-to-end