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:
@@ -906,6 +906,25 @@ func (s *Server) settingsData() map[string]interface{} {
|
||||
data["MonitoringEnabled"] = s.cfg.Monitoring.Enabled
|
||||
data["HealthchecksBase"] = s.cfg.Monitoring.HealthchecksBase
|
||||
data["HubEnabled"] = s.cfg.Hub.Enabled
|
||||
|
||||
// Self-update status
|
||||
data["SelfUpdateEnabled"] = s.cfg.SelfUpdate.Enabled
|
||||
if s.updater != nil {
|
||||
status := s.updater.GetStatus()
|
||||
data["UpdateRunning"] = status.Running
|
||||
if status.LastCheck != nil {
|
||||
data["UpdateAvailable"] = status.LastCheck.UpdateAvailable
|
||||
data["LatestVersion"] = status.LastCheck.LatestVersion
|
||||
data["LastCheckTime"] = status.LastCheck.CheckedAt
|
||||
data["LastCheckError"] = status.LastCheck.Error
|
||||
}
|
||||
if status.LastState != nil {
|
||||
data["LastUpdateState"] = status.LastState
|
||||
}
|
||||
data["AutoUpdateEnabled"] = s.cfg.SelfUpdate.AutoUpdate
|
||||
data["AutoUpdateTime"] = s.cfg.SelfUpdate.AutoUpdateTime
|
||||
}
|
||||
|
||||
data["NotificationPrefs"] = s.settings.GetNotificationPrefs()
|
||||
|
||||
// Storage paths with display data
|
||||
|
||||
Reference in New Issue
Block a user