feat: Настройки › Автообновление - clients compare their version with the server's every N and update themselves; the server looks at GitLab every N and, when a newer release is out, offers it to an administrator at login (after the PIN) with «Обновить» and «Отказаться»; the words of a made picture's result are the model's only

This commit is contained in:
redtea committed 2026-10-18 12:33:24 +03:00
1 parent 916a49958b
commit 3d2f886f04
22 files changed
+1074 -7

No files matched your search

+8
View File
@@ -65,6 +65,9 @@ type Server struct {
wsAgents wsAgents // agents on their WebSocket now
pinMisses pinMisses // wrong PINs per session
assets map[string]string // static file -> hash of its content
upd updState // the server's own updating
updRun func(script []byte) error // runs the install script; the real one unless a test sets it
}
// New builds the server, parsing embedded templates.
@@ -269,6 +272,11 @@ func (s *Server) Handler() http.Handler {
mux.Handle("POST /api/panel/ai/image", s.requireAdmin(s.handleAIImage))
mux.Handle("GET /api/panel/ai/image/{job}", s.requireAdmin(s.handleAIImageJob))
mux.Handle("POST /settings/ai", s.adminsOnly(s.handleSetAI))
mux.Handle("POST /settings/autoupdate", s.adminsOnly(s.handleSetAutoUpdate))
mux.Handle("POST /api/panel/update/check", s.adminsOnly(s.handleUpdateCheck))
mux.Handle("GET /api/panel/update/offer", s.adminsOnly(s.handleUpdateOffer))
mux.Handle("POST /api/panel/update/decline", s.adminsOnly(s.handleUpdateDecline))
mux.Handle("POST /api/panel/update/run", s.adminsOnly(s.handleUpdateRun))
mux.Handle("POST /settings/db", s.adminsOnly(s.handleSetDB))
mux.Handle("POST /settings/db/restart", s.adminsOnly(s.handleRestart))
mux.Handle("POST /api/panel/account/keys/begin", s.requireAdmin(s.handleKeyRegisterBegin))