create encryption keys from password during app import & restore

This commit is contained in:
Girish Ramakrishnan
2020-05-12 15:49:43 -07:00
parent 1df94fd84d
commit ea8a3d798e
3 changed files with 24 additions and 11 deletions

View File

@@ -206,9 +206,14 @@ function restore(backupConfig, backupId, version, sysinfoConfig, auditSource, ca
if (error) return done(error);
if (activated) return done(new BoxError(BoxError.CONFLICT, 'Already activated. Restore with a fresh Cloudron installation.'));
backups.testConfig(backupConfig, function (error) {
backups.testProviderConfig(backupConfig, function (error) {
if (error) return done(error);
if ('password' in backupConfig) {
backupConfig.encryption = backups.generateEncryptionKeysSync(backupConfig.password);
delete backupConfig.password;
}
sysinfo.testConfig(sysinfoConfig, function (error) {
if (error) return done(error);