mirror of
https://github.com/nextcloud/all-in-one.git
synced 2025-12-21 15:06:50 +00:00
adjust DeleteBorgBackupLocationVars to also delete the borg.config file
Signed-off-by: Simon L. <szaimen@e.mail.de>
This commit is contained in:
parent
a842cbb82a
commit
83de526051
2 changed files with 10 additions and 2 deletions
|
|
@ -159,7 +159,7 @@ readonly class ConfigurationController {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isset($request->getParsedBody()['delete_borg_backup_location_vars'])) {
|
if (isset($request->getParsedBody()['delete_borg_backup_location_vars'])) {
|
||||||
$this->configurationManager->DeleteBorgBackupLocationVars();
|
$this->configurationManager->DeleteBorgBackupLocationItems();
|
||||||
}
|
}
|
||||||
|
|
||||||
return $response->withStatus(201)->withHeader('Location', '.');
|
return $response->withStatus(201)->withHeader('Location', '.');
|
||||||
|
|
|
||||||
|
|
@ -506,11 +506,19 @@ class ConfigurationManager
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function DeleteBorgBackupLocationVars() : void {
|
public function DeleteBorgBackupLocationItems() : void {
|
||||||
|
// Delete the variables
|
||||||
$config = $this->GetConfig();
|
$config = $this->GetConfig();
|
||||||
$config['borg_backup_host_location'] = '';
|
$config['borg_backup_host_location'] = '';
|
||||||
$config['borg_remote_repo'] = '';
|
$config['borg_remote_repo'] = '';
|
||||||
$this->WriteConfig($config);
|
$this->WriteConfig($config);
|
||||||
|
|
||||||
|
// Also delete the borg config file to be able to start over
|
||||||
|
if (file_exists(DataConst::GetBackupKeyFile())) {
|
||||||
|
if (unlink(DataConst::GetBackupKeyFile())) {
|
||||||
|
error_log('borg.config file deleted to be able to start over.');
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue