Remove old config copies from updates
Settings -> Upkeep -> Backup & restore lists the config.json.bak-* files that update leaves behind and removes one or all of them; they hold the same secrets as a backup. Removing needs a signed-in user and is logged. After a successful update only the newest 3 copies are kept, and a copy that would overwrite an older one (version unknown, or the same version twice) gets the time appended. The backup card now also names preshared keys and authenticator app secrets. The update notice uses the existing compareVersions instead of its own.
This commit is contained in:
@@ -183,6 +183,9 @@ func (a *App) routes() http.Handler {
|
||||
g("GET /api/v1/logs/download", a.downloadLog)
|
||||
adm("GET /api/v1/backup", a.backup)
|
||||
adm("POST /api/v1/restore", a.restore)
|
||||
adm("GET /api/v1/update-backups", a.listUpdateBackups)
|
||||
adm("DELETE /api/v1/update-backups", a.removeUpdateBackups)
|
||||
adm("DELETE /api/v1/update-backups/{name}", a.removeUpdateBackup)
|
||||
|
||||
mux.HandleFunc("/api/", func(w http.ResponseWriter, r *http.Request) {
|
||||
writeJSON(w, http.StatusNotFound, map[string]string{"error": "no such endpoint"})
|
||||
|
||||
Reference in New Issue
Block a user