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>
62 lines
2.3 KiB
Desktop File
62 lines
2.3 KiB
Desktop File
[Unit]
|
|
Description=Uberbringer receipt printer server
|
|
Documentation=https://git.anomalous.dev/57_Wolve/uberbringer
|
|
Wants=network-online.target
|
|
After=network.target network-online.target
|
|
# Start-rate limits are [Unit] settings (systemd v230+); systemd ignores
|
|
# StartLimitIntervalSec= in [Service].
|
|
StartLimitIntervalSec=60
|
|
StartLimitBurst=3
|
|
|
|
# Change settings with `systemctl edit uberbringer` rather than editing this
|
|
# file: drop-ins in /etc/systemd/system/uberbringer.service.d/ survive upgrades.
|
|
|
|
[Service]
|
|
Type=simple
|
|
User=uberbringer
|
|
Group=uberbringer
|
|
WorkingDirectory=/etc/uberbringer
|
|
ExecStart=/usr/local/bin/uberbringer --config /etc/uberbringer/config.toml
|
|
Restart=on-failure
|
|
RestartSec=5
|
|
LimitNOFILE=4096
|
|
|
|
# ── Privileges ────────────────────────────────────────────────────────────────
|
|
# The daemon binds an unprivileged port, dials the printer over TCP and fetches
|
|
# images and reports errors to Sentry over HTTPS. It needs no capabilities.
|
|
CapabilityBoundingSet=
|
|
AmbientCapabilities=
|
|
NoNewPrivileges=true
|
|
|
|
# ── Sandboxing ────────────────────────────────────────────────────────────────
|
|
# The daemon reads its config and the system CA bundle, writes only the state
|
|
# of its ntfy subscriptions and opens no devices. The file system is read-only
|
|
# to it, apart from /var/lib/uberbringer, which systemd creates for the
|
|
# service user (state.dir).
|
|
StateDirectory=uberbringer
|
|
StateDirectoryMode=0700
|
|
ProtectSystem=strict
|
|
ProtectHome=true
|
|
PrivateTmp=true
|
|
PrivateDevices=true
|
|
ProtectKernelTunables=true
|
|
ProtectKernelModules=true
|
|
ProtectKernelLogs=true
|
|
ProtectControlGroups=true
|
|
ProtectClock=true
|
|
ProtectHostname=true
|
|
LockPersonality=true
|
|
MemoryDenyWriteExecute=true
|
|
RestrictSUIDSGID=true
|
|
RestrictRealtime=true
|
|
RestrictNamespaces=true
|
|
SystemCallArchitectures=native
|
|
SystemCallFilter=@system-service
|
|
SystemCallErrorNumber=EPERM
|
|
# IPv4 and IPv6 for the listener, the printer, DNS, image fetches and Sentry;
|
|
# AF_UNIX for local sockets such as the journal.
|
|
RestrictAddressFamilies=AF_INET AF_INET6 AF_UNIX
|
|
|
|
[Install]
|
|
WantedBy=multi-user.target
|