diff --git a/justfile b/justfile index 4545165..e2dc5af 100644 --- a/justfile +++ b/justfile @@ -1,7 +1,7 @@ # rpi-zigbee-stack — Docker Compose stack management for RPi 3B+ set export -RPI := "root@192.168.9.147" +RPI := "root@192.168.81.147" COMPOSE := "/root/compose.yaml" # Default: show stack status @@ -66,21 +66,35 @@ zb-devices: # Open Node-RED editor nr-editor: - xdg-open http://192.168.9.147:1880 2>/dev/null || open http://192.168.9.147:1880 2>/dev/null + xdg-open http://192.168.81.147:1880 2>/dev/null || open http://192.168.81.147:1880 2>/dev/null # Open Node-RED dashboard nr-dashboard: - xdg-open http://192.168.9.147:1880/ui 2>/dev/null || open http://192.168.9.147:1880/ui 2>/dev/null + xdg-open http://192.168.81.147:1880/ui 2>/dev/null || open http://192.168.81.147:1880/ui 2>/dev/null # ---- Maintenance ---- -# Sync compose.yaml and configs to RPi +# Sync compose.yaml and configs to RPi (backs up live files first) sync: + ssh {{RPI}} "cp /root/compose.yaml /root/compose.yaml.bak.$$(date +%s) 2>/dev/null || true" + ssh {{RPI}} "cp /root/mosquitto/config/mosquitto.conf /root/mosquitto/config/mosquitto.conf.bak.$$(date +%s) 2>/dev/null || true" + ssh {{RPI}} "cp /root/zigbee2mqtt/configuration.yaml /root/zigbee2mqtt/configuration.yaml.bak.$$(date +%s) 2>/dev/null || true" scp compose.yaml {{RPI}}:/root/compose.yaml scp mosquitto.conf {{RPI}}:/root/mosquitto/config/mosquitto.conf scp zigbee2mqtt.yaml {{RPI}}:/root/zigbee2mqtt/configuration.yaml @echo "Configs synced to RPi. Run 'just restart' to apply." +# Apply boot-resilience hardening (fsck auto-repair, watchdog, stack autostart) +harden: + ssh {{RPI}} "cp /root/harden-boot.sh /root/harden-boot.sh.bak.$$(date +%s) 2>/dev/null || true" + scp scripts/harden-boot.sh {{RPI}}:/root/harden-boot.sh + scp scripts/kuma-online.sh {{RPI}}:/root/kuma-online.sh + ssh {{RPI}} "bash /root/harden-boot.sh" + +# Push an immediate "online" heartbeat to Kuma from the RPi +online: + ssh {{RPI}} "bash /usr/local/sbin/kuma-online.sh" + # Full redeploy: sync configs + restart redeploy: sync restart