Make nextcloud_mount an attribute

Signed-off-by: Pablo Zmdl <pablo@nextcloud.com>
This commit is contained in:
Pablo Zmdl 2026-01-20 12:53:22 +01:00
parent bb865b7dee
commit 44d5b7cd5e
4 changed files with 9 additions and 11 deletions

View file

@ -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(),

View file

@ -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;
}

View file

@ -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 {

View file

@ -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' : '',