- hamlab install / uninstall (internal/setup): systemd or OpenRC, elevates through sudo or doas, runs as the invoking user, sets or generates the password, names only journal groups that exist, waits for /healthz, reports an active firewalld/ufw. --purge and the data chown never touch a directory that isn't Ham Lab's alone. - install.sh: curl-able bootstrap (arch detection, SHA256SUMS, offline beside the binaries, noexec /tmp fallback). make release builds dist/ for amd64, arm64, arm (ARMv6), 386, riscv64. Every build is CGO_ENABLED=0; the native one used to link glibc. - internal/priv replaces every literal `sudo -n`: uid 0, sudo or doas. - Updates acts on dnf, zypper, pacman and apk as well as apt; dnf shows installed versions. - Services falls back to the plain systemctl table before systemd 246 and says so on hosts without systemd. Disks falls back to /sys/block without lsblk. - Listener binds with IP_FREEBIND, so a LAN address that isn't up at boot is no failure. - Self-update: the new build must pass `check` against the live config, is put in place by atomic rename, and the daemon re-execs itself (same under any supervisor). - State and config writes are fsynced; a corrupt state.json is set aside, not fatal. - Terminal shutdown no longer empties the saved list, so names come back after a restart by design rather than by winning a race. - Config default is ~/.config/hamlab; an existing ~/apps/hamlab is still found. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
29 lines
535 B
Plaintext
29 lines
535 B
Plaintext
#!/sbin/openrc-run
|
|
# Ham Lab web console (written by hamlab install)
|
|
|
|
name="hamlab"
|
|
description="Ham Lab web console"
|
|
|
|
export HAMLAB_CONFIG="@CONFIG@"
|
|
export HOME="@HOME@"
|
|
export USER="@USER@"
|
|
|
|
supervisor="supervise-daemon"
|
|
command="@BIN@"
|
|
command_args="serve"
|
|
command_user="@USER@:@GROUP@"
|
|
directory="@HOME@"
|
|
respawn_delay=3
|
|
respawn_max=0
|
|
output_log="/var/log/hamlab.log"
|
|
error_log="/var/log/hamlab.log"
|
|
|
|
depend() {
|
|
need localmount
|
|
after net firewall
|
|
}
|
|
|
|
start_pre() {
|
|
checkpath -f -o "@USER@:@GROUP@" -m 0640 /var/log/hamlab.log
|
|
}
|