whiskers.git / web / worker / wrangler.toml
1name = "whiskers"
2main = "build/index.js"
3compatibility_date = "2026-09-01"
4
5# Two homes: the account's workers.dev address (as lmjtfy began), and the custom domain
6# whiskers.lmjtfy.fun, whose DNS record a Workers custom domain creates on deploy, as it does for
7# lmjtfy.fun (~/lmjtfy/apps/lmjtfy/wrangler.toml). The link preview's absolute addresses come from
8# SITE_ORIGIN, which the deploy names per home with `--var SITE_ORIGIN:https://whiskers.lmjtfy.fun`
9# (or `https://<name>.<account>.workers.dev`), so this file carries no account name. The deployment
10# procedure is kept by the owner, outside this repository.
11workers_dev = true
12preview_urls = false
13routes = [{ pattern = "whiskers.lmjtfy.fun", custom_domain = true }]
14
15[build]
16# The Worker and the link preview's PNG and MP4 (tools/build). Runs from this directory.
17command = "../tools/build"
18# wrangler rebuilds when these change; the build itself decides whether the preview is stale.
19watch_dir = ["src", "../cat", "../site", "../previewgen", "../../third-party/jevcrates/jev-ui", "../../crates/whiskers-judge", "../../crates/whiskers-core/src"]
20
21# The link preview's files, built into public/preview/. The PNG is served by Cloudflare before
22# this Worker runs. The MP4 is not: link-preview players (Discord, Twitter, iOS) fetch a video
23# in byte ranges, which static assets do not answer, so `/preview/loop.mp4` runs the Worker
24# first (src/media.rs), which reads the file through the ASSETS binding and slices it.
25# Both run the Worker first, so an old address (anything but `SITE_ORIGIN`'s host) can send the
26# link preview on to the canonical one (src/host.rs via site::host); the PNG is then passed to the
27# assets by src/lib.rs. Anything else is the Worker's.
28[assets]
29directory = "./public"
30binding = "ASSETS"
31run_worker_first = ["/preview/*"]
32
33[vars]
34# Where the site is, for the link preview's absolute addresses. `wrangler dev --var
35# SITE_ORIGIN:http://localhost:8788` previews itself.
36SITE_ORIGIN = "http://localhost:8788" # production: https://whiskers.lmjtfy.fun, passed at deploy
37
38# Cloudflare's own record of what the Worker did. Invocation logs are off: they record each
39# request, and this site's rule is that no visitor is written down by it. The Worker's own
40# lines (src/log.rs) carry a route, a status and a time, and nothing else.
41[observability]
42enabled = true
43
44[observability.logs]
45enabled = true
46invocation_logs = false
47head_sampling_rate = 1