- Java 98.8%
- Shell 1.2%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
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> |
||
| src | ||
| .gitignore | ||
| CLAUDE.md | ||
| CONTRACT.md | ||
| deploy.sh | ||
| lombok.config | ||
| pom.xml | ||
| provision.sh | ||
| README.md | ||
| TASKS.md | ||
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.