mirror of
https://github.com/nextcloud/all-in-one.git
synced 2025-11-12 07:00:37 +08:00
Merge pull request #136 from nextcloud/enh/128/allow-var-backups
improve setting the backup host location and allow `/var/backups`
This commit is contained in:
commit
06283bdf21
2 changed files with 7 additions and 3 deletions
|
|
@ -172,14 +172,18 @@ class ConfigurationManager
|
||||||
|
|
||||||
$isValidPath = false;
|
$isValidPath = false;
|
||||||
foreach($allowedPrefixes as $allowedPrefix) {
|
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;
|
$isValidPath = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!$isValidPath) {
|
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'.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -167,7 +167,7 @@
|
||||||
<input type="hidden" name="{{csrf.keys.value}}" value="{{csrf.value}}">
|
<input type="hidden" name="{{csrf.keys.value}}" value="{{csrf.value}}">
|
||||||
<input class="button" type="submit" value="Submit" />
|
<input class="button" type="submit" value="Submit" />
|
||||||
</form>
|
</form>
|
||||||
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 <b>/mnt/</b> or <b>/media/</b> or be equal to <b>/var/backups</b>. So e.g. <b>/mnt/backup</b> or <b>/var/backups</b>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% if borg_backup_host_location != "" %}
|
{% if borg_backup_host_location != "" %}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue