No description
  • Java 98.8%
  • Shell 1.2%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Nicolas de Jong 82fe2b6b2c POST /render takes a body of at most 64 KB; contract change proposed
Callers are not authenticated and the body is read before anything else, and
nothing bounded it. Api now reads one byte past 64 KB and no further, whether
the body has a length, chunks or gzip, and answers the contract's own
400 bad_request. A body that cannot be read (broken gzip) is one too.

Silver's maxRequestBodySize is set explicitly, to 1 MB: above the endpoint's
limit, because Silver's 413 is empty where the contract's errors are JSON. It
works the same with the Silver whose default becomes 1 MB (d34fc08).

CONTRACT.md changes for every caller: the body's limit, and the empty 413 for
a Content-Length over 1 MB, the one failure without a JSON body. Both are
marked proposed, not agreed. CasaFlux, the only caller, needs no change: it
sends about 15 KB for a house like this one and about 36 KB with a full Hue
bridge and every bounded list at its longest (worked out from its code, not
measured), and takes any answer that is not a 200 as a failure, with or
without an error body.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 09:07:57 +01:00
src POST /render takes a body of at most 64 KB; contract change proposed 2026-11-24 09:07:57 +01:00
.gitignore Plan a shared headless Chrome rendering service for the Mac Mini 2026-10-10 14:23:57 +02:00
CLAUDE.md POST /render takes a body of at most 64 KB; contract change proposed 2026-11-24 09:07:57 +01:00
CONTRACT.md POST /render takes a body of at most 64 KB; contract change proposed 2026-11-24 09:07:57 +01:00
deploy.sh Service skeleton: /health on a loopback-only Silver server; planning is over 2026-10-10 20:07:04 +02:00
lombok.config Service skeleton: /health on a loopback-only Silver server; planning is over 2026-10-10 20:07:04 +02:00
pom.xml Version 1.3: rebuilt on Silver 8ff3633 2026-11-23 15:20:16 +01:00
provision.sh Record that ops' internal-services list is built 2026-10-11 08:39:48 +02:00
README.md Version 1.3: rebuilt on Silver 8ff3633 2026-11-23 15:20:16 +01:00
TASKS.md Task 7: the second option is authentication, not a key per caller 2026-11-23 08:08:38 +01:00

HeadlessChrome

A shared rendering service for the Mac Mini: one headless Chrome, owned by this service, which every other service on the Mini may ask to render a page. Callers never touch Chrome. They call a narrow HTTP API — "render this *.rutilo.nl page at this size and scale into a PNG" — and get an image back. The API listens on loopback only and callers are not authenticated: only a process on the Mini can reach it (decided 2026-10-10; see CLAUDE.md).

The contract — the request, what a rendered page must do, the errors and the limits — is in CONTRACT.md.

Status

Live on the Mac Mini since 2026-10-11 on 127.0.0.1:18219 (version 1.3 since 2026-11-23), internal-only (no nginx, no subdomain), with chrome-headless-shell 155 kept at Stable by a weekly ops job. Callers on the Mini use POST http://127.0.0.1:18219/render. The first caller, CasaFlux's widget image, has been rendering since 2026-10-11 (CLAUDE.md, "The first caller: CasaFlux's widget"). The decisions are in CLAUDE.md, the contract in CONTRACT.md.

First consumer

CasaFlux. Its backend asks for a PNG of one Overview widget, which a Scriptable widget on Nicolas's iPhone home screen displays. The image is drawn by the frontend's own widget code (widget.html in ~/dev/CasaFlux/frontend), so a style change on the web reaches the home screen with no second design to maintain. The consumer's side is SPEC-WIDGET.md in ~/dev/CasaFlux/frontend, and src/main/java/nl/rutilo/casaflux/widget/HeadlessChrome.java in ~/dev/CasaFlux/backend.

Why a service and not a library

Chrome's remote-debugging interface can do anything the browser can: open any page, read local files, use any stored cookie. Handing it to every service that wants a picture would hand all of that over too. One service owns Chrome and exposes only "render this allowed page", and one Chrome kept warm serves everyone — the stated goal is that no second instance is ever needed.

See CLAUDE.md for the decisions and their reasons.