mirror of
https://github.com/documize/community.git
synced 2025-07-19 21:29:42 +02:00
Conditionally backup/restore dmz_config
This commit is contained in:
parent
0a64afd6b5
commit
c0e1bd5045
2 changed files with 10 additions and 6 deletions
|
@ -268,7 +268,10 @@ func (b backerHandler) dmzConfig(files *[]backupItem) (err error) {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if b.Spec.SystemBackup() {
|
||||||
*files = append(*files, backupItem{Filename: "dmz_config.json", Content: content})
|
*files = append(*files, backupItem{Filename: "dmz_config.json", Content: content})
|
||||||
|
}
|
||||||
|
|
||||||
w := ""
|
w := ""
|
||||||
if !b.Spec.SystemBackup() {
|
if !b.Spec.SystemBackup() {
|
||||||
|
|
|
@ -136,10 +136,12 @@ func (r *restoreHandler) PerformRestore(b []byte, l int64) (err error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Config.
|
// Config.
|
||||||
|
if r.Context.GlobalAdmin {
|
||||||
err = r.dmzConfig()
|
err = r.dmzConfig()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Audit Log.
|
// Audit Log.
|
||||||
err = r.dmzAudit()
|
err = r.dmzAudit()
|
||||||
|
@ -1649,8 +1651,7 @@ func (r *restoreHandler) dmzUser() (err error) {
|
||||||
err = errors.Wrap(err, fmt.Sprintf("unable to check email %s", u[i].Email))
|
err = errors.Wrap(err, fmt.Sprintf("unable to check email %s", u[i].Email))
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
// Existing userID from database overrides all incoming userID values
|
// Existing userID from database overrides all incoming userID values by using remapUser().
|
||||||
// by using remapUser().
|
|
||||||
if len(userID) > 0 {
|
if len(userID) > 0 {
|
||||||
r.MapUserID[u[i].RefID] = userID
|
r.MapUserID[u[i].RefID] = userID
|
||||||
insert = false
|
insert = false
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue