backup: move appConfig to backups table
this is useful for clone also to copy notes, operators, checklist of the time when the backup was made (as opposed to current) at this point, it's not clear why we need a archives table. it's an optimization to not have to store icon for every backup.
This commit is contained in:
+3
-3
@@ -2440,10 +2440,10 @@ async function clone(app, data, user, auditSource) {
|
||||
const icons = await getIcons(app.id);
|
||||
|
||||
// label, icon, checklist intentionally omitted
|
||||
const dolly = _.pick(app, 'memoryLimit', 'cpuQuota', 'crontab', 'reverseProxyConfig', 'env', 'servicesConfig', 'tags', 'devices',
|
||||
const dolly = _.pick(backupInfo.appConfig || app, 'memoryLimit', 'cpuQuota', 'crontab', 'reverseProxyConfig', 'env', 'servicesConfig', 'tags', 'devices',
|
||||
'enableMailbox', 'mailboxDisplayName', 'mailboxName', 'mailboxDomain', 'enableInbox', 'inboxName', 'inboxDomain', 'debugMode',
|
||||
'enableTurn', 'enableRedis', 'mounts', 'enableBackup', 'enableAutomaticUpdate', 'accessRestriction', 'operators', 'sso',
|
||||
'notes');
|
||||
'notes', 'checklist');
|
||||
|
||||
if (!manifest.addons?.recvmail) dolly.inboxDomain = null; // needed because we are cloning _current_ app settings with old manifest
|
||||
|
||||
@@ -2496,7 +2496,7 @@ async function unarchive(archive, data, auditSource) {
|
||||
domain = data.domain.toLowerCase(),
|
||||
overwriteDns = 'overwriteDns' in data ? data.overwriteDns : false;
|
||||
|
||||
const appConfig = archive.appConfig;
|
||||
const appConfig = backup.appConfig;
|
||||
const { appStoreId, manifest } = appConfig;
|
||||
|
||||
let error = validateSecondaryDomains(data.secondaryDomains || {}, manifest);
|
||||
|
||||
Reference in New Issue
Block a user