Include device IP and hostname in firstboot alerter beacon

Blind drops need some way to locate the device when no VPN is selected.
Alerter now reports public IP (via ipify) with fallback to local IP,
plus hostname — gives enough info to SSH directly on same-network drops.
This commit is contained in:
Cobra
2026-04-07 14:37:04 -04:00
parent 2b00b28de6
commit b0fb5af1fb
+3 -1
View File
@@ -661,9 +661,11 @@ fi
# Network alerter
if [[ -n "${BB_ALERTER_WEBHOOK:-}" ]]; then
echo "[*] Sending online alert..."
BB_IP=$(curl -sf --max-time 5 https://api.ipify.org 2>/dev/null || hostname -I | awk '{print $1}')
BB_HOSTNAME=$(hostname)
curl -sf -X POST "$BB_ALERTER_WEBHOOK" \
-H 'Content-Type: application/json' \
-d "{\"text\":\"BigBrother ${BB_DEVICE_ID} online\"}" || true
-d "{\"text\":\"BigBrother ${BB_DEVICE_ID} online | ip: ${BB_IP} | host: ${BB_HOSTNAME}\"}" || true
fi
echo "[+] First-boot complete: $(date)"