Uptime Kuma Sync Design
OpenFlare synchronizes active reverse-proxy sites to an external Uptime Kuma instance from a background control-plane job (internal/apps/openflare/uptimekuma/) over Socket.IO. Using a dedicated OpenFlare tag boundary, the sync routine performs incremental add, edit, and delete diffs without resetting historical SLA metrics or touching unrelated monitors managed manually in Kuma.
1. Architecture and Execution Flow
Synchronization runs strictly on the Server control plane without adding load or credential exposure on edge nodes:
OpenFlare Server (1-minute Cron ticker evaluating UptimeKumaSyncInterval)
└─ Mutex lock skips overlapping runs
└─ Socket.IO connect & authenticate with Uptime Kuma
├─ Ensure dedicated "OpenFlare" tag exists (default color #4f46e5)
├─ Wait for full monitorList payload before computing diffs
└─ Reconcile tagged monitors only (add / editMonitor / deleteMonitor)- Full-list barrier: Diff calculation runs only after Uptime Kuma delivers the complete
monitorListSocket.IO event, preventing premature deletions during partial loads.
2. Tag Isolation and Differential State Machine
- Tag isolation: After fetching
monitorList, only monitors tagged withOpenFlareenter reconciliation. Any manually created monitor without theOpenFlaretag stays invisible to both edits and cleanups. - Concrete URL selection: For each monitored proxy route, the sync routine selects a concrete bound hostname (
https://orhttp://according toenable_https). Routes bound solely to wildcard domains (e.g.,*.example.com) are skipped safely without deleting existing monitors. - Differential comparison: Matching monitors update via
editMonitoronly when at least one of five configured attributes differs from OpenFlare options:- Target
Url - Probe interval
Interval(default60s) MaxRetriesRetryInterval(default60s)Timeout(default48s)
- Target
- Cleanup: Sites removed or disabled from monitoring scope have their
OpenFlare-tagged monitor removed viadeleteMonitor.