import: acceptSelfSignedCerts is validated at provider

This commit is contained in:
Girish Ramakrishnan
2024-04-09 13:24:33 +02:00
parent 3f2f4c7c6b
commit 62faf616c5
2 changed files with 5 additions and 6 deletions

View File

@@ -2235,11 +2235,6 @@ async function importApp(app, data, auditSource) {
error = backups.validateFormat(backupFormat);
if (error) throw error;
await backups.setupStorage(backupConfig, `/mnt/appimport-${app.id}`);
backupConfig.rootPath = backups.getRootPath(backupConfig, `/mnt/appimport-${app.id}`);
error = await backups.testStorage(backupConfig);
if (error) throw error;
if ('password' in backupConfig) {
backupConfig.encryption = backups.generateEncryptionKeysSync(backupConfig.password);
delete backupConfig.password;
@@ -2247,6 +2242,11 @@ async function importApp(app, data, auditSource) {
backupConfig.encryption = null;
}
await backups.setupStorage(backupConfig, `/mnt/appimport-${app.id}`); // this validates mountOptions
backupConfig.rootPath = backups.getRootPath(backupConfig, `/mnt/appimport-${app.id}`);
error = await backups.testStorage(backupConfig); // this validates provider and it's api options. requires rootPath
if (error) throw error;
restoreConfig = { remotePath, backupFormat, backupConfig };
} else {
restoreConfig = { remotePath: null };