summaryrefslogtreecommitdiff
path: root/frontends/scripts
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2026-07-09 09:37:10 +0300
committerPaul Buetow <paul@buetow.org>2026-07-09 09:37:10 +0300
commit1ea362740236e8e12ea9459a5065f8571a81a99e (patch)
treebdb5f1316e83e8b8253d8b094f4bcb734a6553d6 /frontends/scripts
parent1aa5eb37c626f48bd725578637e5db4ae870ebfe (diff)
packages: add NetBSD dtail pipeline (pi0/pi1, aarch64)
- Makefile target dtail-netbsd: cross-compile netbsd/arm64 (CGO_ENABLED=0, nozstd), package natively on pi0 with pkg_create, upload package plus pkg_summary.gz to the PV at netbsd/10.1/packages/aarch64/ via f0 - scripts/pkg-dtail-netbsd.sh: NetBSD pkg_create packaging (prefix /, root-owned files via @owner/@group plist directives) - frontends: NetBSD dserver rc.d script, dtail.json (absolute cache paths), and key-cache helper templates - pkgrepo nginx: serve /netbsd/ with autoindex - Fix stale ROCKY_ARM_BUILD_HOST: pi0 was re-imaged to NetBSD, aarch64 RPMs are built on pi2 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Diffstat (limited to 'frontends/scripts')
-rw-r--r--frontends/scripts/dserver-update-key-cache-netbsd.sh.tpl34
1 files changed, 34 insertions, 0 deletions
diff --git a/frontends/scripts/dserver-update-key-cache-netbsd.sh.tpl b/frontends/scripts/dserver-update-key-cache-netbsd.sh.tpl
new file mode 100644
index 0000000..c50cb72
--- /dev/null
+++ b/frontends/scripts/dserver-update-key-cache-netbsd.sh.tpl
@@ -0,0 +1,34 @@
+#!/bin/sh
+# Refresh the dserver SSH key cache from user authorized_keys files.
+# NetBSD variant: called from the dserver rc.d start_precmd (because
+# /var/run is volatile across reboots) and from a daily root cron job.
+
+CACHEDIR=/var/run/dserver/cache
+DSERVER_USER=dserver
+DSERVER_GROUP=dserver
+
+echo 'Updating SSH key cache'
+
+ls /home/ | while read remoteuser; do
+ keysfile="/home/$remoteuser/.ssh/authorized_keys"
+
+ if [ -f "$keysfile" ]; then
+ cachefile="$CACHEDIR/$remoteuser.authorized_keys"
+ echo "Caching $keysfile -> $cachefile"
+
+ cp "$keysfile" "$cachefile"
+ chown "$DSERVER_USER:$DSERVER_GROUP" "$cachefile"
+ chmod 600 "$cachefile"
+ fi
+done
+
+# Remove stale cache entries for users whose authorized_keys no longer exist
+find "$CACHEDIR" -name '*.authorized_keys' -type f | while read cachefile; do
+ remoteuser=$(basename "$cachefile" .authorized_keys)
+ if [ ! -f "/home/$remoteuser/.ssh/authorized_keys" ]; then
+ echo "Deleting obsolete cache file $cachefile"
+ rm "$cachefile"
+ fi
+done
+
+echo 'All set...'