Replace ntfy.state_dir with a top-level [state] dir
Security / Vulnerability check (push) Successful in 45s
Test / Lint and test (push) Successful in 2m1s

The job store is to keep its database in the directory that holds the
ntfy subscriptions' state files, so the directory moves to a section
of its own: [state] dir, or UBERBRINGER_STATE_DIR, in place of
[ntfy] state_dir. For now only the subscriptions use it. It still has
no default and is still required with a subscription, and the checks
at start name state.dir in their errors.

install.sh writes [state] dir into new configs, and the Docker image
sets UBERBRINGER_STATE_DIR. ntfy.state_dir has never been in a
release, so its CHANGELOG entry changes in place and there is no
fallback: a config that still sets it fails to load with an unknown
key until the line moves to [state].

The image itself was not built, since the workstation has no Docker.

Part of stage 1b of docs/plans/job-store.md.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
57_WolveandClaude Opus 5.5 committed 2026-12-01 12:21:29 -06:00
1 parent f0b5bf020e
commit 66531e7314
16 files changed
+92 -68

No files matched your search

+4 -4
View File
@@ -22,8 +22,8 @@ lists every key, and [ntfy](configuration.md#ntfy) the settings that shape
the cards.
```toml
[ntfy]
state_dir = "/var/lib/uberbringer"
[state]
dir = "/var/lib/uberbringer"
[[ntfy.subscriptions]]
name = "home"
@@ -36,7 +36,7 @@ the cards.
end = "07:00"
```
`install.sh` and the Docker image set `state_dir` already. In Docker, mount
`install.sh` and the Docker image set `state.dir` already. In Docker, mount
a volume for the state and the token file next to the config, as
[docker.md](docker.md#ntfy-subscriptions) shows.
@@ -86,7 +86,7 @@ a volume for the state and the token file next to the config, as
first message of a sequence prints plain, even when its publisher named
the sequence.
- **State.** The cursor, the IDs, the budget and the held messages are in
`<state_dir>/ntfy-<name>.json`, written through a temporary file and a
`<state.dir>/ntfy-<name>.json`, written through a temporary file and a
rename, so a crash leaves the old file or the new one. It is written
within a second of a message being printed, held or left out, at most
every 10 minutes when only keepalives have moved the cursor, and at