mirror of
https://github.com/nextcloud/all-in-one.git
synced 2025-12-20 06:26:57 +00:00
allow to include volumes in backup and restore
Signed-off-by: Simon L <szaimen@e.mail.de>
This commit is contained in:
parent
1513d69a8d
commit
9f19026885
7 changed files with 68 additions and 23 deletions
|
|
@ -429,6 +429,11 @@ class DockerActionManager
|
|||
if ($container->GetIdentifier() === 'nextcloud-aio-borgbackup') {
|
||||
// Additional backup directories
|
||||
$mounts = [];
|
||||
foreach ($this->getAllBackupVolumes() as $additionalBackupVolumes) {
|
||||
if ($additionalBackupVolumes !== '') {
|
||||
$mounts[] = ["Type" => "volume", "Source" => $additionalBackupVolumes, "Target" => "/nextcloud_aio_volumes/" . $additionalBackupVolumes, "ReadOnly" => false];
|
||||
}
|
||||
}
|
||||
foreach ($this->configurationManager->GetAdditionalBackupDirectoriesArray() as $additionalBackupDirectories) {
|
||||
if ($additionalBackupDirectories !== '') {
|
||||
if (!str_starts_with($additionalBackupDirectories, '/')) {
|
||||
|
|
@ -503,6 +508,24 @@ class DockerActionManager
|
|||
}
|
||||
}
|
||||
|
||||
private function getBackupVolumes(string $id) : array
|
||||
{
|
||||
$container = $this->containerDefinitionFetcher->GetContainerById($id);
|
||||
|
||||
$backupVolumes = $container->GetBackupVolumes();
|
||||
|
||||
foreach ($container->GetDependsOn() as $dependency) {
|
||||
$backupVolumes[] = $this->getBackupVolumes($dependency);
|
||||
}
|
||||
return $backupVolumes;
|
||||
}
|
||||
|
||||
private function getAllBackupVolumes() : array {
|
||||
$id = 'nextcloud-aio-apache';
|
||||
|
||||
return array_unique($this->getBackupVolumes($id));
|
||||
}
|
||||
|
||||
private function GetRepoDigestsOfContainer(string $containerName) : ?array {
|
||||
try {
|
||||
$containerUrl = $this->BuildApiUrl(sprintf('containers/%s/json', $containerName));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue