Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions packages/api/wrangler.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,16 @@
// Custom domain / route the redirect endpoint should live on.
// Leave this out entirely to use the workers.dev subdomain instead.
// "routes": [{ "pattern": "links.example.com", "custom_domain": true }],
//
// t.nutfes.net is attached to this Worker as a Custom Domain in the Cloudflare
// dashboard, not here — declaring it in both places is how you get a deploy
// that fights the dashboard. It is the host printed into QR codes; see
// VITE_FWD_BASE_URL in packages/web/.env.production for why (20 characters
// against 50, which is 37x37 modules instead of 49x49).
//
// Do not disable the workers.dev subdomain. QR codes printed before the custom
// domain existed carry it, and both hostnames have to keep resolving for as
// long as that paper is on a wall.
// Rate limiter for POST /auth/login. `unsafe` bindings are excluded from
// `wrangler types`, so the interface is declared by hand in src/auth/types.ts.
// The limiter is per-colo, not global — plenty for an admin panel.
Expand Down
11 changes: 8 additions & 3 deletions packages/web/.env.example
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
# Copy to `.env.local` for local development.
VITE_API_URL=http://localhost:8789

# Optional: base URL encoded into generated QR codes, if it should differ
# from VITE_API_URL (e.g. a custom domain in front of the same Worker).
# VITE_FWD_BASE_URL=https://links.example.com
# Optional: base URL encoded into generated QR codes, if it should differ from
# VITE_API_URL (a short custom domain in front of the same Worker). Every
# character here is printed into every QR code, so a short host is worth more
# than any other shortening — production uses https://t.nutfes.net.
#
# Leave it unset locally: QR codes then point at your local Worker, which is what
# makes a scan testable without deploying.
# VITE_FWD_BASE_URL=https://t.example.com
12 changes: 12 additions & 0 deletions packages/web/.env.production
Original file line number Diff line number Diff line change
@@ -1 +1,13 @@
VITE_API_URL=https://trackinglink.nutfes-nutmeg9488.workers.dev

# Domain baked into generated QR codes. Both hostnames reach the same Worker, so
# this only changes what gets printed — https://t.nutfes.net is 20 characters
# against the workers.dev subdomain's 50, which takes the printed symbol from
# 49x49 modules down to 37x37 at the same error-correction level.
#
# The admin API deliberately stays on workers.dev: its URL length costs nothing,
# and leaving it alone means ALLOWED_ORIGINS and the login session are untouched.
#
# workers.dev must stay enabled regardless — QR codes already printed carry that
# hostname, and paper cannot be reissued.
VITE_FWD_BASE_URL=https://t.nutfes.net
Loading