[deploy] Cloudflare Worker for go.moleculesai.app/* (closes internal#71 phase 1) #1
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Deploy the worker.js + wrangler.toml in this repo to a Cloudflare Worker bound to
go.moleculesai.app/*. Phase 1 of molecule-ai/internal#71's staged rollout — the migration PRs (plugin-gh-identity#3, molecule-cli#2, molecule-controlplane#32, molecule-core#82) build self-referentially today, but externalgo install go.moleculesai.app/<area>@latestresolves only after this responder is live.Acceptance criteria
Prerequisites
/etc/molecule-bootstrap/all-credentials.envon operator (5.78.80.188) asCLOUDFLARE_API_TOKEN=<token>:moleculesai.app)moleculesai.app)wranglerinstalled on operator host (or wherever the deploy runs from). One-time:npm install -g wrangler.Deploy command
wrangler.tomlalready declares the route:{ pattern = "go.moleculesai.app/*", zone_name = "moleculesai.app" }— so binding happens automatically. DNS forgo.moleculesai.appneeds to point at Cloudflare's edge (typically a CNAME flattened to themoleculesai.approot or a separate proxied A record); Cloudflare's "Workers + Pages" UI will surface the binding once the worker is published.Smoke tests after deploy
The five
curlcommands above. All five must pass.Rollback
The migrated PRs still build internally without the responder. Rolling back a botched deploy returns the system to the current pre-deploy state (external
go install <vanity>fails; internal builds unaffected). Zero state to migrate.Out of scope
registry.go.moleculesai.app/...) — separate RFC.Related
worker.js,wrangler.toml,README.mdalready pushed to main as commit56306dd).Reporter
Hongming directed staged repo creation to track responder deploy as Gitea issue (post-internal#71 sweep). 2026-05-07.
Deploy progress — 2/3 done
id=go-import-responder(ES module, 7059 bytes, multipart upload via REST API)pattern=go.moleculesai.app/*→script=go-import-responder(route id6fc72368860a4df3bc934a62c68a8a6d)go.moleculesai.appZone:DNS:Editscope. Needs manual step OR token-scope widening.Smoke test
go.moleculesai.appdoesn't resolve yet — DNS record below would unblock.What's needed for step ③
Add a DNS record on the
moleculesai.appzone in Cloudflare (5 fields, ~20 seconds):go100::The
100::placeholder is the standard CF Workers pattern: it's a non-routable address that signals "this is a Worker-served hostname." Cloudflare's edge intercepts the request at the route binding (already wired) and serves it via the Worker. No actual origin server is needed.(Alternative:
CNAME go → moleculesai.appproxied=true also works. AAAA 100:: is preferred because it skips the upstream-origin lookup entirely.)Alternatively — widen the token
If you'd rather have me complete this without a manual step, the existing
CLOUDFLARE_API_TOKEN(id12ab594f85ddd…) needsZone.DNS.Editadded to its scope on themoleculesai.appzone. With that, I can re-run the deploy and add the DNS record via API.Verification once DNS lands
Worker code update
The initial commit (
56306dd) had both Service-Worker (addEventListener('fetch', …)) and ES-module (export default { fetch }) syntax for vendor-portability. CF Workers rejects mixed syntax during upload (Uncaught SyntaxError: Unexpected token 'export' at line 165). Pushed a follow-up commit replacing the file with ES-module-only — same external behavior, runs unchanged on CF Workers + Vercel Edge + Deno Deploy. The deployed Worker reflects the corrected file.Tracking