mirror of
https://github.com/nextcloud/all-in-one.git
synced 2025-12-20 14:36:52 +00:00
Add remote borg backup support (#4804)
Signed-off-by: Tim Diels <tim@diels.me> Signed-off-by: Simon L. <szaimen@e.mail.de> Co-authored-by: Simon L. <szaimen@e.mail.de>
This commit is contained in:
parent
34a264d945
commit
3eeda1ea91
12 changed files with 402 additions and 159 deletions
|
|
@ -28,15 +28,17 @@ readonly class ConfigurationController {
|
|||
$this->configurationManager->ChangeMasterPassword($currentMasterPassword, $newMasterPassword);
|
||||
}
|
||||
|
||||
if (isset($request->getParsedBody()['borg_backup_host_location'])) {
|
||||
if (isset($request->getParsedBody()['borg_backup_host_location']) || isset($request->getParsedBody()['borg_remote_repo'])) {
|
||||
$location = $request->getParsedBody()['borg_backup_host_location'] ?? '';
|
||||
$this->configurationManager->SetBorgBackupHostLocation($location);
|
||||
$borgRemoteRepo = $request->getParsedBody()['borg_remote_repo'] ?? '';
|
||||
$this->configurationManager->SetBorgLocationVars($location, $borgRemoteRepo);
|
||||
}
|
||||
|
||||
if (isset($request->getParsedBody()['borg_restore_host_location']) || isset($request->getParsedBody()['borg_restore_password'])) {
|
||||
if (isset($request->getParsedBody()['borg_restore_host_location']) || isset($request->getParsedBody()['borg_restore_remote_repo']) || isset($request->getParsedBody()['borg_restore_password'])) {
|
||||
$restoreLocation = $request->getParsedBody()['borg_restore_host_location'] ?? '';
|
||||
$borgRemoteRepo = $request->getParsedBody()['borg_restore_remote_repo'] ?? '';
|
||||
$borgPassword = $request->getParsedBody()['borg_restore_password'] ?? '';
|
||||
$this->configurationManager->SetBorgRestoreHostLocationAndPassword($restoreLocation, $borgPassword);
|
||||
$this->configurationManager->SetBorgRestoreLocationVarsAndPassword($restoreLocation, $borgRemoteRepo, $borgPassword);
|
||||
}
|
||||
|
||||
if (isset($request->getParsedBody()['daily_backup_time'])) {
|
||||
|
|
@ -132,8 +134,8 @@ readonly class ConfigurationController {
|
|||
$this->configurationManager->SetCollaboraDictionaries($collaboraDictionaries);
|
||||
}
|
||||
|
||||
if (isset($request->getParsedBody()['delete_borg_backup_host_location'])) {
|
||||
$this->configurationManager->DeleteBorgBackupHostLocation();
|
||||
if (isset($request->getParsedBody()['delete_borg_backup_location_vars'])) {
|
||||
$this->configurationManager->DeleteBorgBackupLocationVars();
|
||||
}
|
||||
|
||||
return $response->withStatus(201)->withHeader('Location', '/');
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue