From 3e9ce2be055286432e8983af7c11bcb2df0856af Mon Sep 17 00:00:00 2001 From: "Simon L." Date: Thu, 3 Jul 2025 10:00:59 +0200 Subject: [PATCH] instance-restore: make sure that the configured borg restore location is not a children of or equal to NEXTCLOUD_DATADIR Signed-off-by: Simon L. --- php/src/Data/ConfigurationManager.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/php/src/Data/ConfigurationManager.php b/php/src/Data/ConfigurationManager.php index d4af26b1..5f950fc7 100644 --- a/php/src/Data/ConfigurationManager.php +++ b/php/src/Data/ConfigurationManager.php @@ -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); }