Files
JakeHillion 413af716cf
commit-validation / validate-single-commit (pull_request) Successful in 8s
buildbot/nix-eval Build done. (655 warnings)
buildbot/nix-build Build done.
buildbot/nix-effects Build done.
hearthd: serve a template per kiosk
The portals server had one template for every device and matched its
request path exactly. Kiosks now ask for themselves by name, so the state
endpoint moves from /state to /extra/portals/NAME/state. A kiosk resolves
its template URL relative to that, so template requests are served both
bare and under a kiosk prefix; the prefix is ignored, since the hash alone
determines the body.

Templates are keyed by kiosk name and indexed at startup both by name and
by content hash, so identical templates share a hash and a fetch. A name
with no template is a 404. The module derives one kiosk per template file
in the directory, named after the file, so dropping a template in is the
whole act of adding a kiosk. The single template splits into bedroom, desk
and hallway: desk shows the photo screensaver over a clock, hallway drops
the screensaver. Screensavers render once per screen class, landscape
1280x800 and portrait 800x1280, each set served under its own prefix.

The desk portal gets a DHCP reservation at 10.239.19.18, and joins the
Home Assistant vhost allowlist and its trusted-network auth alongside the
bedroom portal. hallway-wall-tablet was already in both.

Also drops the IoT vhost's IP allowlist. Caddy sorts respond after handle,
so the catch-all handle answered every request and the 403 was never
reachable.

Test plan:
- CI
- Ran serve.py behind a Caddy vhost matching the deployed one: each kiosk
  name returns its own template hash, that hash resolves both at
  NAME/template/HASH and at template/HASH, the body matches the source
  file, an unknown name or hash is a 404, and the state blob is identical
  across kiosks
- Confirmed the rendered screensaver tree carries 16 solar frames per
  wallpaper at both 1280x800 and 800x1280
- Checked the rendered kea reservation and Home Assistant configuration
  carry the desk portal
2026-09-24 20:45:57 +01:00
..
2026-09-24 20:45:57 +01:00