backups: fix restore code path after backup id changes
This commit is contained in:
+4
-4
@@ -153,16 +153,16 @@ async function activate(username, password, email, displayName, ip, auditSource)
|
||||
};
|
||||
}
|
||||
|
||||
async function restoreTask(backupConfig, backupId, sysinfoConfig, options, auditSource) {
|
||||
async function restoreTask(backupConfig, remotePath, sysinfoConfig, options, auditSource) {
|
||||
assert.strictEqual(typeof backupConfig, 'object');
|
||||
assert.strictEqual(typeof backupId, 'string');
|
||||
assert.strictEqual(typeof remotePath, 'string');
|
||||
assert.strictEqual(typeof sysinfoConfig, 'object');
|
||||
assert.strictEqual(typeof options, 'object');
|
||||
assert.strictEqual(typeof auditSource, 'object');
|
||||
|
||||
try {
|
||||
setProgress('restore', 'Downloading box backup');
|
||||
await backuptask.restore(backupConfig, backupId, (progress) => setProgress('restore', progress.message));
|
||||
await backuptask.restore(backupConfig, remotePath, (progress) => setProgress('restore', progress.message));
|
||||
|
||||
setProgress('restore', 'Downloading mail backup');
|
||||
const mailBackups = await backups.getByIdentifierAndStatePaged(backups.BACKUP_IDENTIFIER_MAIL, backups.BACKUP_STATE_NORMAL, 1, 1);
|
||||
@@ -178,7 +178,7 @@ async function restoreTask(backupConfig, backupId, sysinfoConfig, options, audit
|
||||
if (!options.skipDnsSetup) await cloudron.setupDnsAndCert(constants.DASHBOARD_LOCATION, dashboardDomain, auditSource, (progress) => setProgress('restore', progress.message));
|
||||
await cloudron.setDashboardDomain(dashboardDomain, auditSource);
|
||||
await settings.setBackupCredentials(backupConfig); // update just the credentials and not the policy and flags
|
||||
await eventlog.add(eventlog.ACTION_RESTORE, auditSource, { backupId });
|
||||
await eventlog.add(eventlog.ACTION_RESTORE, auditSource, { remotePath });
|
||||
|
||||
setImmediate(() => safe(cloudron.onActivated(options), { debug }));
|
||||
} catch (error) {
|
||||
|
||||
Reference in New Issue
Block a user