Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Admin

An admin dashboard at /admin lets you tune the live limits (paint rate limit and window — or switch the rate limit off entirely, registration delay, token TTL, presence timings, and the SSE coalescing window that controls server fan-out), resize the canvas (8–512 px per side, which resets it), flip the canvas into read-only maintenance mode, reset the canvas, edit the preset colour palette (optionally hide the native colour picker, or enforce the palette server-side so off-palette colours are rejected by the API too — not just hidden in the UI), set a custom maintenance message, post a site-wide announcement banner, open or close registration, remove a player (revokes their token, frees their pseudo, drops them from the leaderboard), revoke legacy unbound tokens, and watch live stats (viewers online, pixels painted, tokens issued).

The admin is disabled unless the ADMIN_PASSWORD environment variable is set, so it is off by default. Set it to turn it on:

ADMIN_PASSWORD='a-long-random-secret' task run    # then open /admin

Login opens a short-lived, HttpOnly SameSite=Strict session cookie; the password is compared in constant time and never stored. Settings are persisted in Redis and propagated to every replica over a config:events pub/sub channel, so a change applies fleet-wide instantly (in-memory when Redis is absent).

Enabling the admin on Kubernetes

The Deployment reads ADMIN_PASSWORD from an optional Secret named pixelflux-admin (so the admin stays off until you create it). Create it once, then restart the pods so the env var is injected — no task k3s:up re-run needed:

kubectl -n pixelflux create secret generic pixelflux-admin \
  --from-literal=password='a-long-random-secret'
kubectl -n pixelflux rollout restart deploy/pixelflux

The Secret is created outside GitOps, so Argo CD’s prune/selfHeal leaves it alone. Serve /admin over HTTPS in production. To rotate the password, update the Secret and rollout restart again.