restore: add sysinfoConfig

This commit is contained in:
Girish Ramakrishnan
2019-11-11 09:49:18 -08:00
parent f8c110f75c
commit 815392ba38
2 changed files with 6 additions and 2 deletions
+3 -1
View File
@@ -204,10 +204,11 @@ function activate(username, password, email, displayName, ip, auditSource, callb
});
}
function restore(backupConfig, backupId, version, auditSource, callback) {
function restore(backupConfig, backupId, version, sysinfoConfig, auditSource, callback) {
assert.strictEqual(typeof backupConfig, 'object');
assert.strictEqual(typeof backupId, 'string');
assert.strictEqual(typeof version, 'string');
assert.strictEqual(typeof sysinfoConfig, 'object');
assert.strictEqual(typeof auditSource, 'object');
assert.strictEqual(typeof callback, 'function');
@@ -238,6 +239,7 @@ function restore(backupConfig, backupId, version, auditSource, callback) {
async.series([
setProgress.bind(null, 'restore', 'Downloading backup'),
backups.restore.bind(null, backupConfig, backupId, (progress) => setProgress('restore', progress.message, NOOP_CALLBACK)),
(next) => { if (!sysinfoConfig) return next(); settings.setSysinfoConfig(sysinfoConfig, next); },
cloudron.setupDashboard.bind(null, auditSource, (progress) => setProgress('restore', progress.message, NOOP_CALLBACK)),
settings.setBackupConfig.bind(null, backupConfig), // update with the latest backupConfig
eventlog.add.bind(null, eventlog.ACTION_RESTORE, auditSource, { backupId }),