archive: appConfig is null for pre-8.2 backups
use backups.manifest when possible instead
This commit is contained in:
@@ -2491,8 +2491,7 @@ async function unarchive(archive, data, auditSource) {
|
||||
domain = data.domain.toLowerCase(),
|
||||
overwriteDns = 'overwriteDns' in data ? data.overwriteDns : false;
|
||||
|
||||
const appConfig = backup.appConfig;
|
||||
const { appStoreId, manifest } = appConfig;
|
||||
const manifest = backup.manifest, appStoreId = backup.manifest.id;
|
||||
|
||||
let error = validateSecondaryDomains(data.secondaryDomains || {}, manifest);
|
||||
if (error) throw error;
|
||||
@@ -2514,7 +2513,8 @@ async function unarchive(archive, data, auditSource) {
|
||||
|
||||
const appId = uuid.v4();
|
||||
|
||||
const dolly = _.pick(appConfig, 'memoryLimit', 'cpuQuota', 'crontab', 'reverseProxyConfig', 'env', 'servicesConfig',
|
||||
// appConfig is null for pre-8.2 backups
|
||||
const dolly = _.pick(backup.appConfig || {}, 'memoryLimit', 'cpuQuota', 'crontab', 'reverseProxyConfig', 'env', 'servicesConfig',
|
||||
'tags', 'label', 'enableMailbox', 'mailboxDisplayName', 'mailboxName', 'mailboxDomain', 'enableInbox', 'inboxName', 'inboxDomain', 'devices',
|
||||
'enableTurn', 'enableRedis', 'mounts', 'enableBackup', 'enableAutomaticUpdate', 'accessRestriction', 'operators', 'sso',
|
||||
'notes', 'checklist');
|
||||
@@ -2526,7 +2526,8 @@ async function unarchive(archive, data, auditSource) {
|
||||
aliasDomains: [],
|
||||
mailboxDomain: data.domain, // archive's mailboxDomain may not exist
|
||||
runState: exports.RSTATE_RUNNING,
|
||||
installationState: exports.ISTATE_PENDING_INSTALL
|
||||
installationState: exports.ISTATE_PENDING_INSTALL,
|
||||
sso: backup.appConfig ? backup.appConfig.sso : true // when no appConfig take a blind guess
|
||||
});
|
||||
obj.icon = (await archives.getIcons(archive.id))?.icon;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user