mirror of
https://github.com/nextcloud/all-in-one.git
synced 2026-02-14 17:50:21 +00:00
Make nextcloud_datadir_mount an attribute
Signed-off-by: Pablo Zmdl <pablo@nextcloud.com>
This commit is contained in:
parent
95fed23ce3
commit
ab07bc7ca3
3 changed files with 8 additions and 9 deletions
|
|
@ -127,7 +127,7 @@ $app->get('/containers', function (Request $request, Response $response, array $
|
||||||
'is_imaginary_enabled' => $configurationManager->isImaginaryEnabled,
|
'is_imaginary_enabled' => $configurationManager->isImaginaryEnabled,
|
||||||
'is_fulltextsearch_enabled' => $configurationManager->isFulltextsearchEnabled,
|
'is_fulltextsearch_enabled' => $configurationManager->isFulltextsearchEnabled,
|
||||||
'additional_backup_directories' => $configurationManager->GetAdditionalBackupDirectoriesString(),
|
'additional_backup_directories' => $configurationManager->GetAdditionalBackupDirectoriesString(),
|
||||||
'nextcloud_datadir' => $configurationManager->GetNextcloudDatadirMount(),
|
'nextcloud_datadir' => $configurationManager->nextcloud_datadir_mount,
|
||||||
'nextcloud_mount' => $configurationManager->nextcloud_mount,
|
'nextcloud_mount' => $configurationManager->nextcloud_mount,
|
||||||
'nextcloud_upload_limit' => $configurationManager->nextcloud_upload_limit,
|
'nextcloud_upload_limit' => $configurationManager->nextcloud_upload_limit,
|
||||||
'nextcloud_max_time' => $configurationManager->GetNextcloudMaxTime(),
|
'nextcloud_max_time' => $configurationManager->GetNextcloudMaxTime(),
|
||||||
|
|
|
||||||
|
|
@ -124,7 +124,7 @@ readonly class ContainerDefinitionFetcher {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
} elseif ($value['source'] === '%NEXTCLOUD_DATADIR%') {
|
} elseif ($value['source'] === '%NEXTCLOUD_DATADIR%') {
|
||||||
$value['source'] = $this->configurationManager->GetNextcloudDatadirMount();
|
$value['source'] = $this->configurationManager->nextcloud_datadir_mount;
|
||||||
if ($value['source'] === '') {
|
if ($value['source'] === '') {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -473,8 +473,8 @@ class ConfigurationManager
|
||||||
|
|
||||||
// Prevent backup to be contained in Nextcloud Datadir as this will delete the backup archive upon restore
|
// Prevent backup to be contained in Nextcloud Datadir as this will delete the backup archive upon restore
|
||||||
// See https://github.com/nextcloud/all-in-one/issues/6607
|
// See https://github.com/nextcloud/all-in-one/issues/6607
|
||||||
if (str_starts_with($location . '/', rtrim($this->GetNextcloudDatadirMount(), '/') . '/')) {
|
if (str_starts_with($location . '/', rtrim($this->nextcloud_datadir_mount, '/') . '/')) {
|
||||||
throw new InvalidSettingConfigurationException("The path must not be a children of or equal to NEXTCLOUD_DATADIR, which is currently set to " . $this->GetNextcloudDatadirMount());
|
throw new InvalidSettingConfigurationException("The path must not be a children of or equal to NEXTCLOUD_DATADIR, which is currently set to " . $this->nextcloud_datadir_mount);
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -625,11 +625,10 @@ class ConfigurationManager
|
||||||
set { $this->set('nextcloud_mount', $value); }
|
set { $this->set('nextcloud_mount', $value); }
|
||||||
}
|
}
|
||||||
|
|
||||||
public function GetNextcloudDatadirMount() : string {
|
|
||||||
$envVariableName = 'NEXTCLOUD_DATADIR';
|
public string $nextcloud_datadir_mount {
|
||||||
$configName = 'nextcloud_datadir';
|
get => $this->GetEnvironmentalVariableOrConfig('NEXTCLOUD_DATADIR', 'nextcloud_datadir', 'nextcloud_aio_nextcloud_data');
|
||||||
$defaultValue = 'nextcloud_aio_nextcloud_data';
|
set { $this->set('nextcloud_datadir_mount', $value); }
|
||||||
return $this->GetEnvironmentalVariableOrConfig($envVariableName, $configName, $defaultValue);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public string $nextcloud_upload_limit {
|
public string $nextcloud_upload_limit {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue