backups: always test the mount
It's possible that the current credentials do not work. For example, CIFS is disabled in hetzner's control panel. In such cases, we skip the mount check and then fail later in some filesystem error. This misleads the user. https://forum.cloudron.io/topic/8391/cloudronbackup-folder-disappears-when-trying-to-restore
This commit is contained in:
@@ -416,12 +416,6 @@ async function getBackupConfig() {
|
||||
return backupConfig;
|
||||
}
|
||||
|
||||
function mountOptionsChanged(currentConfig, backupConfig) {
|
||||
return currentConfig.provider !== backupConfig.provider
|
||||
|| currentConfig.mountPoint !== backupConfig.mountPoint
|
||||
|| !_.isEqual(currentConfig.mountOptions, backupConfig.mountOptions);
|
||||
}
|
||||
|
||||
async function setBackupConfig(backupConfig) {
|
||||
assert.strictEqual(typeof backupConfig, 'object');
|
||||
|
||||
@@ -429,7 +423,7 @@ async function setBackupConfig(backupConfig) {
|
||||
|
||||
backups.injectPrivateFields(backupConfig, oldConfig);
|
||||
|
||||
if (mounts.isManagedProvider(backupConfig.provider) && (!mounts.isManagedProvider(oldConfig.provider) || mountOptionsChanged(oldConfig, backupConfig))) {
|
||||
if (mounts.isManagedProvider(backupConfig.provider)) {
|
||||
let error = mounts.validateMountOptions(backupConfig.provider, backupConfig.mountOptions);
|
||||
if (error) throw error;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user