diff --git a/php/src/Controller/ConfigurationController.php b/php/src/Controller/ConfigurationController.php index 9ed155ff..1dbb20f5 100644 --- a/php/src/Controller/ConfigurationController.php +++ b/php/src/Controller/ConfigurationController.php @@ -121,6 +121,10 @@ class ConfigurationController $this->configurationManager->SetCollaboraDictionaries($collaboraDictionaries); } + if (isset($request->getParsedBody()['delete_borg_backup_host_location'])) { + $this->configurationManager->DeleteBorgBackupHostLocation(); + } + return $response->withStatus(201)->withHeader('Location', '/'); } catch (InvalidSettingConfigurationException $ex) { $response->getBody()->write($ex->getMessage()); diff --git a/php/src/Data/ConfigurationManager.php b/php/src/Data/ConfigurationManager.php index 0a40366e..9bb6fbc9 100644 --- a/php/src/Data/ConfigurationManager.php +++ b/php/src/Data/ConfigurationManager.php @@ -413,6 +413,12 @@ class ConfigurationManager $this->WriteConfig($config); } + public function DeleteBorgBackupHostLocation() : void { + $config = $this->GetConfig(); + $config['borg_backup_host_location'] = ''; + $this->WriteConfig($config); + } + /** * @throws InvalidSettingConfigurationException */ diff --git a/php/templates/containers.twig b/php/templates/containers.twig index a40ef69e..23b8f58b 100644 --- a/php/templates/containers.twig +++ b/php/templates/containers.twig @@ -420,6 +420,17 @@ + {% if has_backup_run_once == false %} +

Reset backup host location

+ If the configured backup host location {{ borg_backup_host_location }} is wrong, you can reset it by clicking on the button below.

+
+ + + + +
+ {% endif %} + {% if has_backup_run_once == true %}

Backup check

Click on the button below to perform a backup integrity check. This is an option that verifies that your backup is intact but it should't be needed in most situtations.