Merge pull request #6609 from nextcloud/enh/6607/check-if-children

instance-restore: make sure that the configured borg restore location is not a children of or equal to NEXTCLOUD_DATADIR
This commit is contained in:
Simon L. 2025-07-03 10:16:19 +02:00 committed by GitHub
commit 2aec1be167
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -484,8 +484,13 @@ class ConfigurationManager
}
if (!$isValidPath) {
throw new InvalidSettingConfigurationException("The path must start with '/', and must not end with '/'!");
throw new InvalidSettingConfigurationException("The path must start with '/', and must not end with '/'! Another option is to use the docker volume name 'nextcloud_aio_backupdir'.");
}
if (str_starts_with($location, rtrim($this->GetNextcloudDatadirMount(), '/'))) {
throw new InvalidSettingConfigurationException("The path must not be a children of or equal to NEXTCLOUD_DATADIR, which is currently set to " . $this->GetNextcloudDatadirMount());
}
} else {
$this->ValidateBorgRemoteRepo($repo);
}