fixup! feat(status): a status page, for the phone of whoever looks after the box
check / check (push) Canceled after 0s

install the app in /usr/local/lib/pdtv26-status, not in the state
directory: with DynamicUser, systemd makes /var/lib/pdtv26-status its
own symlink to /var/lib/private, and the service failed at
STATE_DIRECTORY ("File exists"). The package's check now catches a unit
that runs a program from its own StateDirectory.

Generated-by: Claude Opus 5.5
This commit is contained in:
dckc committed 2026-12-02 18:38:37 -06:00
1 parent f35da9b883
commit 7957d88ff9
3 files changed
+9 -3

No files matched your search

+1 -1
View File
@@ -14,7 +14,7 @@ SPEECH = localhost:8024
BRAIN = localhost:8025 BRAIN = localhost:8025
# The private network's addresses: the only ones it answers or checks. A tailnet's, by default. # The private network's addresses: the only ones it answers or checks. A tailnet's, by default.
RANGES = 100.64.0.0/10 fd7a:115c:a1e0::/48 RANGES = 100.64.0.0/10 fd7a:115c:a1e0::/48
APP = /var/lib/pdtv26-status/app APP = /usr/local/lib/pdtv26-status/app
UNIT = /etc/systemd/system/pdtv26-status.service UNIT = /etc/systemd/system/pdtv26-status.service
TARGETS = /etc/pdtv26-status/targets TARGETS = /etc/pdtv26-status/targets
+7 -1
View File
@@ -6,7 +6,7 @@ stdenvNoCC.mkDerivation {
version = "0.1.0"; version = "0.1.0";
src = lib.fileset.toSource { src = lib.fileset.toSource {
root = ./.; root = ./.;
fileset = lib.fileset.unions [ ./status.js ./status.test.js ./status-server.js ]; fileset = lib.fileset.unions [ ./status.js ./status.test.js ./status-server.js ./pdtv26-status.service ];
}; };
nativeCheckInputs = [ nodejs-slim ]; nativeCheckInputs = [ nodejs-slim ];
doCheck = true; doCheck = true;
@@ -14,6 +14,12 @@ stdenvNoCC.mkDerivation {
runHook preCheck runHook preCheck
node --check status-server.js node --check status-server.js
node --test node --test
# With DynamicUser, systemd makes /var/lib/<StateDirectory> its own symlink, so nothing else
# can live there: the app (make install's GC root) goes elsewhere.
state=$(sed -n 's/^StateDirectory=//p' pdtv26-status.service)
if grep -q "^ExecStart=/var/lib/$state/" pdtv26-status.service; then
echo "pdtv26-status.service runs a program from its own StateDirectory, /var/lib/$state" >&2; exit 1
fi
runHook postCheck runHook postCheck
''; '';
installPhase = '' installPhase = ''
+1 -1
View File
@@ -8,7 +8,7 @@ Wants=network-online.target
# speech server, and the brain's channel; make install writes them, host:port, to the targets file. # speech server, and the brain's channel; make install writes them, host:port, to the targets file.
# The private network is the boundary: no key. # The private network is the boundary: no key.
EnvironmentFile=/etc/pdtv26-status/targets EnvironmentFile=/etc/pdtv26-status/targets
ExecStart=/var/lib/pdtv26-status/app/bin/status-server :: ${PORT} /var/lib/pdtv26-status ${NAME} ${BOX} ${SPEECH} ${BRAIN} ExecStart=/usr/local/lib/pdtv26-status/app/bin/status-server :: ${PORT} /var/lib/pdtv26-status ${NAME} ${BOX} ${SPEECH} ${BRAIN}
DynamicUser=yes DynamicUser=yes
StateDirectory=pdtv26-status StateDirectory=pdtv26-status
IPAddressDeny=any IPAddressDeny=any