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:
Girish Ramakrishnan
2023-01-24 14:53:51 +01:00
parent 8ab7a4ff58
commit b2d072f2e6

View File

@@ -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;