diff --git a/php/src/Data/ConfigurationManager.php b/php/src/Data/ConfigurationManager.php index 68b34bb4..ab1948e0 100644 --- a/php/src/Data/ConfigurationManager.php +++ b/php/src/Data/ConfigurationManager.php @@ -172,14 +172,18 @@ class ConfigurationManager $isValidPath = false; foreach($allowedPrefixes as $allowedPrefix) { - if(str_starts_with($location, $allowedPrefix)) { + if(str_starts_with($location, $allowedPrefix) && !str_ends_with($location, '/')) { + $isValidPath = true; + break; + } + if ($location === '/var/backups') { $isValidPath = true; break; } } if(!$isValidPath) { - throw new InvalidSettingConfigurationException("Path must start with /mnt/ or /media/."); + throw new InvalidSettingConfigurationException("The path must start with '/mnt/' or '/media/' or be equal to '/var/backups'."); } diff --git a/php/templates/containers.twig b/php/templates/containers.twig index 61f7547e..28adb7b8 100644 --- a/php/templates/containers.twig +++ b/php/templates/containers.twig @@ -167,7 +167,7 @@ - The folder path that you enter must start with /mnt/ or /media/ so e.g. /mnt/backup + The folder path that you enter must start with /mnt/ or /media/ or be equal to /var/backups. So e.g. /mnt/backup or /var/backups {% endif %} {% if borg_backup_host_location != "" %}