Two homes: the account's workers.dev address (as lmjtfy began), and the custom domain
whiskers.lmjtfy.fun, whose DNS record a Workers custom domain creates on deploy, as it does for
lmjtfy.fun (~/lmjtfy/apps/lmjtfy/wrangler.toml). The link preview's absolute addresses come from
SITE_ORIGIN, which the deploy names per home with --var SITE_ORIGIN:https://whiskers.lmjtfy.fun
(or https://<name>.<account>.workers.dev), so this file carries no account name. The deployment
procedure is kept by the owner, outside this repository.
15[build]
The Worker and the link preview's PNG and MP4 (tools/build). Runs from this directory.
17command = "../tools/build"
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"]
The link preview's files, built into public/preview/. The PNG is served by Cloudflare before
this Worker runs. The MP4 is not: link-preview players (Discord, Twitter, iOS) fetch a video
in byte ranges, which static assets do not answer, so /preview/loop.mp4 runs the Worker
first (src/media.rs), which reads the file through the ASSETS binding and slices it.
Both run the Worker first, so an old address (anything but SITE_ORIGIN's host) can send the
link preview on to the canonical one (src/host.rs via site::host); the PNG is then passed to the
assets by src/lib.rs. Anything else is the Worker's.
33[vars]
Where the site is, for the link preview's absolute addresses. wrangler dev --var SITE_ORIGIN:http://localhost:8788 previews itself.
36SITE_ORIGIN = "http://localhost:8788" # production: https://whiskers.lmjtfy.fun, passed at deploy
Cloudflare's own record of what the Worker did. Invocation logs are off: they record each request, and this site's rule is that no visitor is written down by it. The Worker's own lines (src/log.rs) carry a route, a status and a time, and nothing else.