feat: add backup/restore of app configurations
All checks were successful
Check / check (pull_request) Successful in 3m25s
All checks were successful
Check / check (pull_request) Successful in 3m25s
Add export and import functionality for app configurations:
- Export single app or all apps as versioned JSON backup bundle
- Import from backup file with name-conflict detection (skip duplicates)
- Fresh SSH keys and webhook secrets generated on import
- Preserves env vars, labels, volumes, and port mappings
- Web UI: export button on app detail, backup/restore page on dashboard
- REST API: GET /api/v1/apps/{id}/export, GET /api/v1/backup/export,
POST /api/v1/backup/import
- Comprehensive test coverage for service and handler layers
This commit is contained in:
@@ -98,6 +98,12 @@ func (s *Server) SetupRoutes() {
|
||||
// Ports
|
||||
r.Post("/apps/{id}/ports", s.handlers.HandlePortAdd())
|
||||
r.Post("/apps/{id}/ports/{portID}/delete", s.handlers.HandlePortDelete())
|
||||
|
||||
// Backup/Restore
|
||||
r.Get("/apps/{id}/export", s.handlers.HandleExportApp())
|
||||
r.Get("/backup/export", s.handlers.HandleExportAllApps())
|
||||
r.Get("/backup/import", s.handlers.HandleImportPage())
|
||||
r.Post("/backup/import", s.handlers.HandleImportApps())
|
||||
})
|
||||
})
|
||||
|
||||
@@ -115,6 +121,11 @@ func (s *Server) SetupRoutes() {
|
||||
r.Get("/apps", s.handlers.HandleAPIListApps())
|
||||
r.Get("/apps/{id}", s.handlers.HandleAPIGetApp())
|
||||
r.Get("/apps/{id}/deployments", s.handlers.HandleAPIListDeployments())
|
||||
|
||||
// Backup/Restore API
|
||||
r.Get("/apps/{id}/export", s.handlers.HandleAPIExportApp())
|
||||
r.Get("/backup/export", s.handlers.HandleAPIExportAllApps())
|
||||
r.Post("/backup/import", s.handlers.HandleAPIImportApps())
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user