fixup! feat(status): a status page, for the phone of whoever looks after the box
check / check (push) Canceled after 0s
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:
1 parent
f35da9b883
commit
7957d88ff9
3 files changed
+9
-3
No files matched your search
+1
-1
@@ -14,7 +14,7 @@ SPEECH = localhost:8024
|
||||
BRAIN = localhost:8025
|
||||
# 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
|
||||
APP = /var/lib/pdtv26-status/app
|
||||
APP = /usr/local/lib/pdtv26-status/app
|
||||
UNIT = /etc/systemd/system/pdtv26-status.service
|
||||
TARGETS = /etc/pdtv26-status/targets
|
||||
|
||||
|
||||
+7
-1
@@ -6,7 +6,7 @@ stdenvNoCC.mkDerivation {
|
||||
version = "0.1.0";
|
||||
src = lib.fileset.toSource {
|
||||
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 ];
|
||||
doCheck = true;
|
||||
@@ -14,6 +14,12 @@ stdenvNoCC.mkDerivation {
|
||||
runHook preCheck
|
||||
node --check status-server.js
|
||||
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
|
||||
'';
|
||||
installPhase = ''
|
||||
|
||||
@@ -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.
|
||||
# The private network is the boundary: no key.
|
||||
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
|
||||
StateDirectory=pdtv26-status
|
||||
IPAddressDeny=any
|
||||
|
||||
Reference in new issue
Block a user