mirror of
https://github.com/0xJacky/nginx-ui.git
synced 2025-05-11 10:25:52 +02:00
feat(install): restore from backup
This commit is contained in:
parent
8860f71bc7
commit
000e28942a
18 changed files with 1113 additions and 667 deletions
|
@ -17,9 +17,22 @@ func InitPrivateRouter(r *gin.RouterGroup) {
|
|||
r.GET("self_check", SelfCheck)
|
||||
r.POST("self_check/:name/fix", SelfCheckFix)
|
||||
|
||||
// Backup and restore endpoints
|
||||
// Backup endpoint only
|
||||
r.GET("system/backup", CreateBackup)
|
||||
r.POST("system/backup/restore", middleware.EncryptedForm(), RestoreBackup)
|
||||
}
|
||||
|
||||
func InitBackupRestoreRouter(r *gin.RouterGroup) {
|
||||
r.POST("system/backup/restore",
|
||||
func(ctx *gin.Context) {
|
||||
// If system is installed, verify user authentication
|
||||
if installLockStatus() {
|
||||
middleware.AuthRequired()(ctx)
|
||||
} else {
|
||||
ctx.Next()
|
||||
}
|
||||
},
|
||||
middleware.EncryptedForm(),
|
||||
RestoreBackup)
|
||||
}
|
||||
|
||||
func InitWebSocketRouter(r *gin.RouterGroup) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue