bootstrap: post first-boot result to ntfy arrsstack-alerts (best-effort)

The box announces itself — publish path verified from 10.0.1.20 with a
200 on 2026-08-01. Never blocks or fails the bootstrap.
This commit is contained in:
2026-08-01 15:02:28 +01:00
parent 2438e715fc
commit 973c4bc44b
+19 -3
View File
@@ -62,19 +62,35 @@ else
warn "NOT marking first-boot done — fix and re-run $0" warn "NOT marking first-boot done — fix and re-run $0"
fi fi
# ---- announce the result on ntfy (best-effort, never blocks) ---------------------
# The box tells Mike's phone directly — publish path verified from 10.0.1.20
# (HTTP 200) on 2026-08-01. A notification failure must never fail the bootstrap.
NTFY_URL="https://ntfy.thewichersfamily.com/arrsstack-alerts"
MOUNTS_OK="$("$REPO_DIR/scripts/20-cifs.sh" --verify >/dev/null 2>&1 && echo yes || echo no)"
if [ ${#FAILED[@]} -eq 0 ]; then
NTFY_TITLE="mediabox: first boot COMPLETE"
NTFY_MSG="All bootstrap stages OK on $(hostname) ($(hostname -I | awk '{print $1}')). NAS mounts: ${MOUNTS_OK}. Next: message Claude 'box is up' to start the D: copy."
else
NTFY_TITLE="mediabox: first boot NEEDS ATTENTION"
NTFY_MSG="Stages failed: ${FAILED[*]}. NAS mounts: ${MOUNTS_OK}. SSH in (thethreemagi@10.0.1.20) or tell Claude which stage failed. Log: /var/log/mediabox-bootstrap.log"
fi
curl -s -m 10 -H "Title: ${NTFY_TITLE}" -d "${NTFY_MSG}" "$NTFY_URL" >/dev/null 2>&1 \
|| warn "ntfy notification failed (non-fatal)"
cat <<'NEXT' cat <<'NEXT'
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
REMAINING STEPS — deliberately NOT automated (2026-07-31 flow) REMAINING STEPS — deliberately NOT automated (2026-07-31 flow)
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
1. Write the NAS password into the credentials file (over the MCP, never 1. NAS credentials: the CIDATA stick copy of user-data now writes
onto the USB), then verify the seven mounts — the six library shares /etc/cifs/korval.cred on first boot, so the mounts normally come up on
must REFUSE writes, media_pc must accept them: their own. If they did not, write the cred file by hand and verify:
printf 'username=<nas-user>\npassword=<nas-pass>\ndomain=WORKGROUP\n' \ printf 'username=<nas-user>\npassword=<nas-pass>\ndomain=WORKGROUP\n' \
> /etc/cifs/korval.cred > /etc/cifs/korval.cred
chmod 600 /etc/cifs/korval.cred chmod 600 /etc/cifs/korval.cred
systemctl daemon-reload systemctl daemon-reload
/srv/mediabox-bootstrap/scripts/20-cifs.sh --verify /srv/mediabox-bootstrap/scripts/20-cifs.sh --verify
The six library shares must REFUSE writes, media_pc must accept them.
2. Verify Quick Sync before anything Plex-related: 2. Verify Quick Sync before anything Plex-related:
vainfo --display drm --device /dev/dri/renderD128 vainfo --display drm --device /dev/dri/renderD128