Configuration
Everything is in wrangler.jsonc at the root of the repository (your copy of it, if you used the Deploy to Cloudflare button), plus a few secrets.
Variables (vars)
| Name | What it does |
|---|---|
PREVIEW_HOST | The second hostname that serves dev-server previews. It must also be one of the Worker's routes. |
VAPID_SUBJECT | The contact (mailto: or a URL) sent with push notifications. |
DOWNLOAD_BASE | Where install.sh and the site's Mac download get builds: https://dl.coderail.codes by default, which always has the newest build. Point it at your own copy if you build and host CodeRail yourself (it must serve a latest.json in the same format). |
Secrets
Set with npx wrangler secret put <NAME> at the root of the repository, or in the Cloudflare dashboard under your Worker's Settings → Variables and Secrets.
| Name | What it does |
|---|---|
SETUP_TOKEN | Required once, to create the first admin at /setup. Any long random string. |
VAPID_PUBLIC_KEY, VAPID_PRIVATE_KEY | Optional. The key pair for web push (bun scripts/vapid.ts makes one). Without them there are no push notifications. |
Bindings
| Binding | What |
|---|---|
DB | The D1 database: users, sign-in sessions, invites, computers, grants, pairing codes, the audit log, push subscriptions. Its tables are made on first use. |
MACHINE | The Durable Object class Machine, one per computer: the relay and the session history. |
ASSETS | The web app's files. |
Limits worth knowing
- A session's history keeps its most recent 20,000 entries.
- Files open up to about 700 KB, diffs up to about 800 KB; larger ones are cut off with a note.
- A request to a computer times out after 120 seconds.