diff --git a/php/src/ContainerDefinitionFetcher.php b/php/src/ContainerDefinitionFetcher.php index a447108b..8a5341bf 100644 --- a/php/src/ContainerDefinitionFetcher.php +++ b/php/src/ContainerDefinitionFetcher.php @@ -94,6 +94,39 @@ class ContainerDefinitionFetcher $volumes = new ContainerVolumes(); foreach ($entry['volumes'] as $value) { + if($value['name'] === '%BORGBACKUP_HOST_LOCATION%') { + $value['name'] = $this->configurationManager->GetBorgBackupHostLocation(); + if($value['name'] === '') { + continue; + } + } + if($value['name'] === '%NEXTCLOUD_MOUNT%') { + $value['name'] = $this->configurationManager->GetNextcloudMount(); + if($value['name'] === '') { + continue; + } + } elseif ($value['name'] === '%NEXTCLOUD_DATADIR%') { + $value['name'] = $this->configurationManager->GetNextcloudDatadirMount(); + if ($value['name'] === '') { + continue; + } + } elseif ($value['name'] === '%DOCKER_SOCKET_PATH%') { + $value['name'] = $this->configurationManager->GetDockerSocketPath(); + if($value['name'] === '') { + continue; + } + } elseif ($value['name'] === '%NEXTCLOUD_TRUSTED_CACERTS_DIR%') { + $value['name'] = $this->configurationManager->GetTrustedCacertsDir(); + if($value['name'] === '') { + continue; + } + } + if ($value['location'] === '%NEXTCLOUD_MOUNT%') { + $value['location'] = $this->configurationManager->GetNextcloudMount(); + if($value['location'] === '') { + continue; + } + } $volumes->AddVolume( new ContainerVolume( $value['name'], diff --git a/php/src/Docker/DockerActionManager.php b/php/src/Docker/DockerActionManager.php index bb1c9e88..eed07c35 100644 --- a/php/src/Docker/DockerActionManager.php +++ b/php/src/Docker/DockerActionManager.php @@ -205,40 +205,6 @@ class DockerActionManager public function CreateContainer(Container $container) : void { $volumes = []; foreach($container->GetVolumes()->GetVolumes() as $volume) { - if($volume->name === '%BORGBACKUP_HOST_LOCATION%') { - $volume->name = $this->configurationManager->GetBorgBackupHostLocation(); - if($volume->name === '') { - continue; - } - } - if($volume->name === '%NEXTCLOUD_MOUNT%') { - $volume->name = $this->configurationManager->GetNextcloudMount(); - if($volume->name === '') { - continue; - } - } elseif ($volume->name === '%NEXTCLOUD_DATADIR%') { - $volume->name = $this->configurationManager->GetNextcloudDatadirMount(); - if ($volume->name === '') { - continue; - } - } elseif ($volume->name === '%DOCKER_SOCKET_PATH%') { - $volume->name = $this->configurationManager->GetDockerSocketPath(); - if($volume->name === '') { - continue; - } - } elseif ($volume->name === '%NEXTCLOUD_TRUSTED_CACERTS_DIR%') { - $volume->name = $this->configurationManager->GetTrustedCacertsDir(); - if($volume->name === '') { - continue; - } - } - if ($volume->mountPoint === '%NEXTCLOUD_MOUNT%') { - $volume->mountPoint = $this->configurationManager->GetNextcloudMount(); - if($volume->mountPoint === '') { - continue; - } - } - $volumeEntry = $volume->name . ':' . $volume->mountPoint; if($volume->isWritable) { $volumeEntry = $volumeEntry . ':' . 'rw';