Controller v0.7.2: notification preferences sync to hub

- SyncPreferences() method on Notifier: POST to hub /api/v1/preferences
- IsEnabled() getter for hub connectivity check
- settingsNotificationsHandler: sync to hub after local save (3 flash message variants)
- Startup sync: non-blocking goroutine pushes prefs to hub on boot (DB rebuild recovery)
- Updated CONTEXT.md, README.md with v0.7.2 changes

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-16 20:18:22 +01:00
parent 8f5962c47d
commit 2649297096
5 changed files with 127 additions and 12 deletions
+11 -3
View File
@@ -24,7 +24,7 @@ controller generates secrets, saves app.yaml, runs `docker compose up -d`, and t
with Traefik routing and health checks. The dashboard correctly shows real-time container states
including health substatus (starting → healthy → running).
Current version: **v0.6.1**
Current version: **v0.7.2**
### What works
- Dashboard with live container state (green/orange/yellow/red)
@@ -59,6 +59,8 @@ Current version: **v0.6.1**
- Heartbeat ping (5-minute "I'm alive" signal to Healthchecks)
- Weekly backup integrity check (restic check, Sunday 04:00)
- Central hub reporting (periodic JSON push to felhom-hub service)
- Notification preferences sync to hub (controller → hub on save + startup)
- Notification system with email delivery via Resend API (hub relay)
### Known issues / next priorities
- Cloudflare Tunnel + Traefik TLS: paperless.demo-felhom.eu works locally but shows "Not secure" (certificate chain not fully validated through tunnel)
@@ -133,6 +135,8 @@ controller/
│ │ ├── collector.go # Background collector (60s interval, system + docker stats)
│ │ ├── types.go # SystemSample, ContainerSample, StaticSystemInfo structs
│ │ └── sysinfo.go # Host-level static info (/proc, /etc)
│ ├── notify/
│ │ └── notifier.go # Notification relay (hub → email), preferences sync, cooldowns
│ ├── report/
│ │ ├── types.go # Hub report JSON payload definitions
│ │ ├── builder.go # Builds report from system/stacks/backup/metrics state
@@ -173,6 +177,7 @@ controller/
| **Scheduler** | `internal/scheduler/` | ✅ Done | Central job scheduler (periodic + daily, skip-if-running) |
| **Monitor** | `internal/monitor/` | ✅ Done | Healthchecks.io pings, system health checks |
| **Metrics** | `internal/metrics/` | ✅ Done | SQLite time-series store, system + container collection |
| **Notify** | `internal/notify/` | ✅ Done | Notification relay to hub, preferences sync, cooldown tracking |
| **Report** | `internal/report/` | ✅ Done | Central hub push (JSON report builder + HTTP pusher) |
| **Backup** | `internal/backup/` | ✅ Done | DB auto-discovery + dump, restic snapshots, prune, manual trigger |
@@ -463,7 +468,8 @@ docker compose up -d
- [x] Heartbeat ping (5-minute "I'm alive" signal)
- [x] SQLite metrics store (system + container metrics, 60s collection, 30-day prune)
- [x] Backup integrity check (weekly restic check with Healthchecks ping)
- [ ] Customer notifications (email/Telegram)
- [x] Customer notifications (email via hub relay + Resend API)
- [x] Notification preferences sync (controller → hub on save + startup)
### Phase 3 — Backups ✅ COMPLETE
- [x] DB auto-discovery (PostgreSQL/MariaDB containers via docker inspect)
@@ -496,7 +502,9 @@ docker compose up -d
- [x] Hub service (felhom-hub: REST API + SQLite + dark-theme dashboard)
- [x] K8s manifests for hub deployment on k3s
- [ ] Fleet-wide update management
- [ ] Customer notifications (email/Telegram)
- [x] Customer notifications (email via hub relay)
- [x] Notification preferences sync (controller → hub)
- [x] Hub customer detail page: notification preferences + log display
## Related Repositories