Commit Graph
2 Commits
Author SHA1 Message Date
57_WolveandClaude Opus 5.5 5cc4614ad7 Keep print jobs on disk in state.dir
Breaking: with state.dir set, jobs still waiting when the daemon stops
or crashes print after the next start, in order and however old,
instead of being marked failed or forgotten; a client that resends such
jobs must stop. The Docker image sets state.dir, so a container keeps
its jobs in /var/lib/uberbringer, and loses them with the container
unless a volume is mounted there.

The owner decided that jobs survive a restart and that a restart never
prints a receipt twice. When state.dir is set, the daemon now opens the
SQLite job store there, jobs.db, and the queue restores it before the
subscriptions are made and before anything is served, so restored jobs
go ahead of new ones and a second daemon on the directory stops before
it reads the subscriptions' state. Without state.dir the queue keeps its
jobs in memory, as before. The store closes once the queue has stopped.

A job's sending mark is synced before its first byte, so one caught mid
write reads uncertain after the restart and is never sent again; a job
that had not reached the printer prints once. A store that cannot be
opened stops the start with an error naming the file, rather than
starting empty and forgetting which receipts are in doubt.

The unit gains UMask=0077, so the store's files are its user's alone,
and says why systemd's 90 s stop timeout is enough; the Dockerfile and
docs/docker.md ask for --stop-timeout 40. design.md replaces "The queue
lives in memory" with the store, the state machine, the sync policy,
store failures, stage 1a's numbers, and that the ARM builds ship the
store untested on ARM hardware. install.md and docker.md say how to set
aside a store that will not open; configuration.md, api.md, cli.md and
ntfy.md say what survives a restart. The license notices gain the
driver's modules.

TestServeRestart runs the daemon twice on one directory: jobs queued
when the first run stops, its printer refusing connections, print in
order after the restart, ahead of a new job, and a job seeded in sending
between the runs reads uncertain and never reaches the printer.

Part of stage 1d of docs/plans/job-store.md (decisions 14 and 15).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 16:48:57 -06:00
57_WolveandClaude Opus 5.5 3d451eb0b7 Split the README into focused docs under docs/
Security / Vulnerability check (push) Successful in 39s
Test / Lint and test (push) Successful in 1m57s
The README had grown to 658 lines. It is now a short overview: what
Überbringer is, a quick start, a table of the docs and the licence.
Each topic it held has a document of its own:

- docs/install.md: install.sh, what it leaves behind, and upgrading.
- docs/docker.md: the image behind a reverse proxy, the env file,
  health checks, and the ntfy state volume and token file.
- docs/configuration.md: loading, environment variables, a table of
  every key in every section, and what is logged. The list of log
  messages becomes a summary of what is logged and reported.
- docs/security.md: the API secret, issuing tokens and their scopes,
  the header-file recipe that keeps tokens off command lines (moved
  from docs/api.md), the reverse proxy, image URLs, and what is never
  logged.
- docs/ntfy.md: the ntfy subscriptions, securing the topics and the
  printer's token, with the token scripts unchanged.
- docs/cli.md: the command line.
- docs/development.md: running from source, the Go version, make
  targets, the gate, generated files, the layout, CI and releases.

CLAUDE.md names the new docs: a config key is now documented in
docs/configuration.md, and the layout and Go version in
docs/development.md. docs/api.md, design.md and the job-store plan
point to the docs that now hold what they referred to in the README.
The release archives also carry the docs on running the daemon.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-30 22:33:08 -06:00