aio-interface: also reset the borg backup cache when resetting the backup path

Signed-off-by: Simon L. <szaimen@e.mail.de>
This commit is contained in:
copilot-swe-agent[bot]
2026-04-25 12:50:27 +00:00
committed by Simon L.
parent 39f30a6609
commit 172c72f735
5 changed files with 29 additions and 9 deletions

View File

@@ -145,6 +145,27 @@ readonly class DockerActionManager {
}
}
public function deleteBorgBackupConfig(): void {
// Delete the borgbackup container
$id = 'nextcloud-aio-borgbackup';
$borgbackupContainer = $this->containerDefinitionFetcher->GetContainerById($id);
$this->DeleteContainer($borgbackupContainer);
// Delete the borg cache volume
$url = $this->BuildApiUrl('volumes/nextcloud_aio_backup_cache');
try {
$this->guzzleClient->delete($url);
error_log('nextcloud_aio_backup_cache volume deleted successfully.');
} catch (RequestException $e) {
if ($e->getCode() !== 404) {
error_log('Could not delete nextcloud_aio_backup_cache volume: ' . $e->getMessage());
}
}
// Clear the configuration variables and files
$this->configurationManager->deleteBorgBackupLocationItems();
}
public function GetLogs(string $id, string $since = ''): string {
$url = $this->BuildApiUrl(
sprintf(