Config UI: Add backup & restore (BC) (#22071)

Co-authored-by: Michael Geers <michael@geers.tv>
This commit is contained in:
Maschga 2025-07-14 08:19:07 +02:00 • committed by GitHub
parent 7ce12d1e08
commit ea64f76202
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
19 changed files with 1068 additions and 45 deletions

View file

@ -345,9 +345,12 @@ func (s *HTTPd) RegisterSystemHandler(site *core.Site, valueChan chan<- util.Par
// system api
routes := map[string]route{
"log": {"GET", "/log", logHandler},
"logareas": {"GET", "/log/areas", logAreasHandler},
"reset": {"POST", "/reset", resetHandler},
"log": {"GET", "/log", logHandler},
"logareas": {"GET", "/log/areas", logAreasHandler},
"clearcache": {"DELETE", "/cache", clearCacheHandler},
"backup": {"POST", "/backup", getBackup(auth)},
"restore": {"POST", "/restore", restoreDatabase(auth, shutdown)},
"reset": {"POST", "/reset", resetDatabase(auth, shutdown)},
"shutdown": {"POST", "/shutdown", func(w http.ResponseWriter, r *http.Request) {
shutdown()
w.WriteHeader(http.StatusNoContent)