clone

nostr relays on demand at <name>.bind.ws: claim one with your key, pay in zaps past the free allowance

hosting: the catch-all route waits for Cloudflare for SaaS

Dami committed 52460f9
The API refuses a wildcard host route until the zone has Cloudflare for SaaS
enabled, so every deploy ended in an error. The route is a commented line in
wrangler.jsonc and the last of the one-time custom domain steps.
commit
52460f99737e85ed3b29b21ce41e899b29949985
parent
cdd249726732c33037e592d6bc975f7d9c5cd06b
author
Dami <dami.etoile@gmail.com>
2 files changed, +5 -3
Mdocs/11-hosting-bindws.md2+-
Mwrangler.jsonc6++++--
M docs/11-hosting-bindws.md +1 -1
@@ -80,7 +80,7 @@ One-time setup, in this order:
8080 | `CNAME` | `customers` | `fallback.<domain>` | on |8181 8282 `CNAME_TARGET` in `wrangler.jsonc` must match: `customers.<domain>`.83-4. **Routes.** `wrangler.jsonc` declares a `*/*` route on the zone next to the wildcard, which is what makes custom hostname traffic reach the Worker. Deploy once after the change and confirm in Workers Routes that the zone lists `*/*` for `bindws-relay`. If wrangler refuses the pattern, add it by hand on that page: route `*/*`, Worker `bindws-relay`.83+4. **Routes.** Only now can the zone take a catch-all route, which is what makes custom hostname traffic reach the Worker; before Cloudflare for SaaS is enabled the API refuses it with code 10022. Uncomment the `*/*` route in `wrangler.jsonc` and deploy, then confirm in Workers Routes that the zone lists `*/*` for `bindws-relay`. If wrangler still refuses the pattern, add it by hand on that page.8484 5. **KV namespace.** `npx wrangler kv namespace create HOSTS` and put the id in both `kv_namespaces` entries of `wrangler.jsonc` (the repo carries the bind.ws one).8585 6. **API token.** My Profile, API Tokens, Create Token, Custom token: permission **Zone, SSL and Certificates, Edit**, zone resources limited to your zone. Store it as a secret: `npx wrangler secret put CF_API_TOKEN`. `ZONE_ID` in `wrangler.jsonc` is the zone the hostnames are created in (the same id the routes use). Without the secret the console reports custom domains as not enabled and the methods answer `unsupported:`.8686
M wrangler.jsonc +4 -2