Skip to content

armgit / bento

Public Imported from GitHub
0

Bento, the office suite that fits in a file

2.6 KB
Raw Blame
name = "bento-guestbook-daemon"
main = "src/worker.js"
workers_dev = true
compatibility_date = "2026-06-01"

# Serves the current guestbook epoch from R2 (shadows GitHub Pages for this
# one path — apex must be proxied/orange-cloud) + the admin surface.
routes = [
  { pattern = "bento.page/guestbook.bento.html*", zone_name = "bento.page" },
  { pattern = "bento.page/guestbook-admin/*", zone_name = "bento.page" },
]

# Archivist snapshot + (if due) epoch roll. LAUNCH PHASE: every 30 min so the
# room time-shards under load and spam auto-clears. Revert to ["0 1 * * *"]
# (daily) after launch. Cron is UTC.
[triggers]
crons = ["*/30 * * * *"]

[[kv_namespaces]]
binding = "STORE"
id = "ac9eeb2800ea4e848ccf303e31d6620f"

[vars]
# where a fresh shell is fetched from at roll time (never bundled)
SHELL_URL = "https://bento.page/releases/slides/Bento_Slides.bento.html"
# Fallback origin when KV holds no current epoch (GitHub Pages direct).
#
# THIS FALLBACK NO LONGER RESOLVES TO A FILE, and the deploy cannot be tested,
# so it is documented rather than changed. Two things happened to it:
#   · guestbook.bento.html was DELETED from the public mirror in release
#     v1.0.12, and publish-site.mjs now deliberately excludes it from the
#     mirror whenever the build has no local epoch — so it will not come back
#     on an ordinary publish.
#   · the mirror repo carries CNAME bento.page, so Pages 301s every
#     nyblnet.github.io/bento-site/* request to bento.page/* (measured:
#     .../bento-site/guestbook.bento.html → 301 → bento.page/guestbook.bento.html).
# That redirect target is THIS worker's own route, so the KV-empty path points
# back at the request it is meant to rescue. Whatever the platform does with a
# same-route subrequest, it cannot answer with a guestbook.
# Operationally: an empty KV is an OUTAGE, not a degraded mode — re-seed
# (README "Arming / operating"), do not wait for the fallback.
ORIGIN_FALLBACK = "https://nyblnet.github.io/bento-site"
# relay host baked into newly minted epochs
SYNC_HOST = "wss://sync.bento.page"
# automatic roll cadence in hours; 0 = manual rolls only (admin endpoint).
# The scheduled handler can only roll as often as the cron above fires, so this
# must be ≤ the cron interval to take effect. LAUNCH PHASE: 0.5 = every 30 min
# (matches the */30 cron) to time-shard the room and auto-clear spam. Revert to
# "0" (manual) after launch — and re-arm a v2 owner-moderated epoch locally
# (build-guestbook + seed) to restore People→Remove moderation.
ROLL_HOURS = "0.5"

# secrets (set with `npx wrangler secret put ADMIN_KEY`):
#   ADMIN_KEY — bearer for /guestbook-admin/*