Check state.dir at start, with or without subscriptions
Breaking: the Docker image sets state.dir, so a container that cannot write /var/lib/uberbringer, one started --read-only without a volume there or with a bind mount owned by root, no longer starts, ntfy subscriptions or not: mount a named volume or a directory owned by 10001:10001. The daemon created state.dir and checked that it could write there only when an ntfy subscription was configured, since only subscriptions kept files in it. The job store will keep its database there too, so the check now runs once at start whenever state.dir is set: the directory is created 0700 if it is missing, and one that cannot be made or written stops the start with an error naming state.dir, before any subscription is made. A state.dir of only spaces is refused whether or not a subscription is configured, rather than made as a directory of that name. Without state.dir nothing changes. Part of stage 1d of docs/plans/job-store.md. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
2926a69598
commit
4eb620dde0
9 files changed
+105
-30
No files matched your search
@@ -180,7 +180,7 @@ Quiet hours are off unless the subscription has a
|
||||
|
||||
| Key | Default | Meaning |
|
||||
|-----|---------|---------|
|
||||
| `dir` | none | The directory the [ntfy subscriptions](#ntfy-subscriptions) keep their state in, one `ntfy-<name>.json` file each, readable by the daemon's user only. Required with a subscription. `install.sh` and the Docker image set it to `/var/lib/uberbringer` |
|
||||
| `dir` | none | The directory the [ntfy subscriptions](#ntfy-subscriptions) keep their state in, one `ntfy-<name>.json` file each, readable by the daemon's user only. Required with a subscription, and never only spaces. When it is set, the daemon creates it, readable by its user only, if it is missing, and does not start if it cannot write there. `install.sh` and the Docker image set it to `/var/lib/uberbringer` |
|
||||
|
||||
### images
|
||||
|
||||
|
||||
+4
-3
@@ -54,9 +54,10 @@ alerting better than restarting the container.
|
||||
## ntfy subscriptions
|
||||
|
||||
[ntfy subscriptions](ntfy.md) keep their state in `/var/lib/uberbringer`,
|
||||
which the image sets as `state.dir`. Mount a volume there: without one
|
||||
the state lives in the container, and a new container, after a pull or an
|
||||
upgrade, forgets what was printed and what was held.
|
||||
which the image sets as `state.dir`. The daemon does not start if it
|
||||
cannot write there. Mount a volume there: without one the state lives in
|
||||
the container, and a new container, after a pull or an upgrade, forgets
|
||||
what was printed and what was held.
|
||||
|
||||
```sh
|
||||
docker run -d -p 127.0.0.1:8080:8080 -v "$PWD/config.toml:/etc/uberbringer/config.toml:ro" \
|
||||
|
||||
Reference in new issue
Block a user