Add encryptionVersion to backups
this will identify the old style backups and warn user that a restore doesn't work anymore
This commit is contained in:
@@ -1480,7 +1480,8 @@ function restore(app, backupId, auditSource, callback) {
|
||||
func(function (error, backupInfo) {
|
||||
if (error) return callback(error);
|
||||
|
||||
if (!backupInfo.manifest) callback(new BoxError(BoxError.EXTERNAL_ERROR, 'Could not get restore manifest'));
|
||||
if (!backupInfo.manifest) return callback(new BoxError(BoxError.EXTERNAL_ERROR, 'Could not get restore manifest'));
|
||||
if (backupInfo.encryptionVersion === 1) return callback(new BoxError(BoxError.BAD_FIELD, 'This encrypted backup was created with an older Cloudron version and has to be restored using the CLI tool'));
|
||||
|
||||
// re-validate because this new box version may not accept old configs
|
||||
error = checkManifestConstraints(backupInfo.manifest);
|
||||
@@ -1603,7 +1604,8 @@ function clone(app, data, user, auditSource, callback) {
|
||||
backups.get(backupId, function (error, backupInfo) {
|
||||
if (error) return callback(error);
|
||||
|
||||
if (!backupInfo.manifest) callback(new BoxError(BoxError.EXTERNAL_ERROR, 'Could not get restore config'));
|
||||
if (!backupInfo.manifest) return callback(new BoxError(BoxError.EXTERNAL_ERROR, 'Could not get restore config'));
|
||||
if (backupInfo.encryptionVersion === 1) return callback(new BoxError(BoxError.BAD_FIELD, 'This encrypted backup was created with an older Cloudron version and cannot be cloned'));
|
||||
|
||||
const manifest = backupInfo.manifest, appStoreId = app.appStoreId;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user