diff --git a/php/public/index.php b/php/public/index.php index b14bb449..a87449fc 100644 --- a/php/public/index.php +++ b/php/public/index.php @@ -128,7 +128,7 @@ $app->get('/containers', function (Request $request, Response $response, array $ 'is_fulltextsearch_enabled' => $configurationManager->isFulltextsearchEnabled, 'additional_backup_directories' => $configurationManager->GetAdditionalBackupDirectoriesString(), 'nextcloud_datadir' => $configurationManager->GetNextcloudDatadirMount(), - 'nextcloud_mount' => $configurationManager->GetNextcloudMount(), + 'nextcloud_mount' => $configurationManager->nextcloud_mount, 'nextcloud_upload_limit' => $configurationManager->nextcloud_upload_limit, 'nextcloud_max_time' => $configurationManager->GetNextcloudMaxTime(), 'nextcloud_memory_limit' => $configurationManager->GetNextcloudMemoryLimit(), diff --git a/php/src/ContainerDefinitionFetcher.php b/php/src/ContainerDefinitionFetcher.php index 6f96d480..c81989f2 100644 --- a/php/src/ContainerDefinitionFetcher.php +++ b/php/src/ContainerDefinitionFetcher.php @@ -119,7 +119,7 @@ readonly class ContainerDefinitionFetcher { } } if($value['source'] === '%NEXTCLOUD_MOUNT%') { - $value['source'] = $this->configurationManager->GetNextcloudMount(); + $value['source'] = $this->configurationManager->nextcloud_mount; if($value['source'] === '') { continue; } @@ -140,7 +140,7 @@ readonly class ContainerDefinitionFetcher { } } if ($value['destination'] === '%NEXTCLOUD_MOUNT%') { - $value['destination'] = $this->configurationManager->GetNextcloudMount(); + $value['destination'] = $this->configurationManager->nextcloud_mount; if($value['destination'] === '') { continue; } diff --git a/php/src/Data/ConfigurationManager.php b/php/src/Data/ConfigurationManager.php index f9525c09..da823439 100644 --- a/php/src/Data/ConfigurationManager.php +++ b/php/src/Data/ConfigurationManager.php @@ -620,11 +620,9 @@ class ConfigurationManager return trim((string)file_get_contents(DataConst::GetBackupPublicKey())); } - public function GetNextcloudMount() : string { - $envVariableName = 'NEXTCLOUD_MOUNT'; - $configName = 'nextcloud_mount'; - $defaultValue = ''; - return $this->GetEnvironmentalVariableOrConfig($envVariableName, $configName, $defaultValue); + public string $nextcloud_mount { + get => $this->GetEnvironmentalVariableOrConfig('NEXTCLOUD_MOUNT', 'nextcloud_mount', ''); + set { $this->set('nextcloud_mount', $value); } } public function GetNextcloudDatadirMount() : string { diff --git a/php/src/Docker/DockerActionManager.php b/php/src/Docker/DockerActionManager.php index d42678a7..7ab3bc23 100644 --- a/php/src/Docker/DockerActionManager.php +++ b/php/src/Docker/DockerActionManager.php @@ -205,7 +205,7 @@ readonly class DockerActionManager { foreach ($container->volumes->GetVolumes() as $volume) { // // NEXTCLOUD_MOUNT gets added via bind-mount later on // if ($container->identifier === 'nextcloud-aio-nextcloud') { - // if ($volume->name === $this->configurationManager->GetNextcloudMount()) { + // if ($volume->name === $this->configurationManager->nextcloud_mount) { // continue; // } // } @@ -408,7 +408,7 @@ readonly class DockerActionManager { // // Special things for the nextcloud container which should not be exposed in the containers.json // } elseif ($container->identifier === 'nextcloud-aio-nextcloud') { // foreach ($container->volumes->GetVolumes() as $volume) { - // if ($volume->name !== $this->configurationManager->GetNextcloudMount()) { + // if ($volume->name !== $this->configurationManager->nextcloud_mount) { // continue; // } // $mounts[] = ["Type" => "bind", "Source" => $volume->name, "Target" => $volume->mountPoint, "ReadOnly" => !$volume->isWritable, "BindOptions" => [ "Propagation" => "rshared"]]; @@ -569,7 +569,7 @@ readonly class DockerActionManager { 'APACHE_IP_BINDING' => $this->configurationManager->apache_ip_binding, 'TALK_PORT' => $this->configurationManager->talk_port, 'TURN_DOMAIN' => $this->configurationManager->turn_domain, - 'NEXTCLOUD_MOUNT' => $this->configurationManager->GetNextcloudMount(), + 'NEXTCLOUD_MOUNT' => $this->configurationManager->nextcloud_mount, 'BACKUP_RESTORE_PASSWORD' => $this->configurationManager->borg_restore_password, 'CLAMAV_ENABLED' => $this->configurationManager->isClamavEnabled ? 'yes' : '', 'TALK_RECORDING_ENABLED' => $this->configurationManager->isTalkRecordingEnabled ? 'yes' : '',