Files
dashboard/docker-entrypoint.sh
T
fegger 012eee6c45 Add server-side health checks for service online status
- update-health.js: pings every service URL from script.js (single
  source of truth) in parallel every minute via cron and writes
  health.json; any HTTP response below 500 counts as online, 5xx as
  error, timeouts/DNS failures as offline; TLS validity ignored
- Card badges now show real state instead of a static Online label:
  grey Checking, green Online (with latency tooltip), amber Error
  (HTTP code), red Offline (reason); refreshed every 30 s
- Entrypoint runs a first sweep at boot; nginx serves /health.json
  with no-cache; README documents the behavior
2026-09-04 14:15:08 +02:00

20 lines
740 B
Bash

#!/bin/sh
# Dashboard container entrypoint.
# Starts everything in the background and nginx in the foreground, so a slow
# or unreachable upstream (git hosts, netbird, calendar) never blocks the
# web server from coming up.
# Start the small API proxy (for Open WebUI chat) in the background.
node /opt/dashboard/server.js &
# Start cron daemon in the background to refresh data every 15 minutes.
/usr/sbin/crond -f -l 8 &
# Run the initial data fetch in the background; cron keeps it fresh after that.
( cd /opt/dashboard && node update-data.js ) &
# First health-check sweep in the background; cron re-runs it every minute.
( cd /opt/dashboard && node update-health.js ) &
# Start nginx in the foreground.
exec nginx -g "daemon off;"