mirror of
https://github.com/nextcloud/all-in-one.git
synced 2026-02-04 04:56:52 +00:00
Make nextcloud_datadir_mount an attribute
Signed-off-by: Pablo Zmdl <pablo@nextcloud.com>
This commit is contained in:
parent
aa94ad05e8
commit
531c7c6fb6
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_fulltextsearch_enabled' => $configurationManager->isFulltextsearchEnabled,
|
||||
'additional_backup_directories' => $configurationManager->GetAdditionalBackupDirectoriesString(),
|
||||
'nextcloud_datadir' => $configurationManager->GetNextcloudDatadirMount(),
|
||||
'nextcloud_datadir' => $configurationManager->nextcloud_datadir_mount,
|
||||
'nextcloud_mount' => $configurationManager->nextcloud_mount,
|
||||
'nextcloud_upload_limit' => $configurationManager->nextcloud_upload_limit,
|
||||
'nextcloud_max_time' => $configurationManager->GetNextcloudMaxTime(),
|
||||
|
|
|
|||
|
|
@ -124,7 +124,7 @@ readonly class ContainerDefinitionFetcher {
|
|||
continue;
|
||||
}
|
||||
} elseif ($value['source'] === '%NEXTCLOUD_DATADIR%') {
|
||||
$value['source'] = $this->configurationManager->GetNextcloudDatadirMount();
|
||||
$value['source'] = $this->configurationManager->nextcloud_datadir_mount;
|
||||
if ($value['source'] === '') {
|
||||
continue;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -473,8 +473,8 @@ class ConfigurationManager
|
|||
|
||||
// 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
|
||||
if (str_starts_with($location . '/', rtrim($this->GetNextcloudDatadirMount(), '/') . '/')) {
|
||||
throw new InvalidSettingConfigurationException("The path must not be a children of or equal to NEXTCLOUD_DATADIR, which is currently set to " . $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->nextcloud_datadir_mount);
|
||||
}
|
||||
|
||||
} else {
|
||||
|
|
@ -625,11 +625,10 @@ class ConfigurationManager
|
|||
set { $this->set('nextcloud_mount', $value); }
|
||||
}
|
||||
|
||||
public function GetNextcloudDatadirMount() : string {
|
||||
$envVariableName = 'NEXTCLOUD_DATADIR';
|
||||
$configName = 'nextcloud_datadir';
|
||||
$defaultValue = 'nextcloud_aio_nextcloud_data';
|
||||
return $this->GetEnvironmentalVariableOrConfig($envVariableName, $configName, $defaultValue);
|
||||
|
||||
public string $nextcloud_datadir_mount {
|
||||
get => $this->GetEnvironmentalVariableOrConfig('NEXTCLOUD_DATADIR', 'nextcloud_datadir', 'nextcloud_aio_nextcloud_data');
|
||||
set { $this->set('nextcloud_datadir_mount', $value); }
|
||||
}
|
||||
|
||||
public string $nextcloud_upload_limit {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue