feat: add controller self-update mechanism (v0.16.0)

New selfupdate package: version parsing, audit state file, updater with
Gitea registry V2 check, docker pull + compose rewrite + compose up flow.

- API: /api/selfupdate/{status,check,update} with session+bearer auth
- UI: Settings "Verzió és frissítés" card with check/install buttons + JS polling
- Scheduler: periodic check (6h default) + optional daily auto-update
- Notifications: success/failure on post-update startup verification
- Alert: info banner when update available
- docker-compose.yml: add directory bind mount for compose file access

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-19 17:33:40 +01:00
parent 1a58797dc8
commit c9a88afcef
14 changed files with 1074 additions and 22 deletions
+12 -1
View File
@@ -40,7 +40,7 @@ func NewAlertManager(logger *log.Logger) *AlertManager {
// Refresh regenerates alerts from the latest health check report and config state.
// Called after each health check cycle (every 5 minutes).
func (am *AlertManager) Refresh(report *monitor.HealthReport, cfg *config.Config, backupMgr *backup.Manager) {
func (am *AlertManager) Refresh(report *monitor.HealthReport, cfg *config.Config, backupMgr *backup.Manager, updateAvailable bool, latestVersion string) {
var alerts []Alert
// From health check issues (critical)
@@ -97,6 +97,17 @@ func (am *AlertManager) Refresh(report *monitor.HealthReport, cfg *config.Config
})
}
// Update available
if updateAvailable && latestVersion != "" {
alerts = append(alerts, Alert{
ID: "update-available",
Level: "info",
Message: fmt.Sprintf("Új controller verzió elérhető: %s", latestVersion),
Link: "/settings",
LinkText: "Frissítés",
})
}
// Sort: errors first, then warnings, then info
sortAlerts(alerts)