mirror of
https://github.com/nextcloud/all-in-one.git
synced 2026-02-04 13:06:53 +00:00
Make isFulltextsearchEnabled an attribute
Signed-off-by: Pablo Zmdl <pablo@nextcloud.com>
This commit is contained in:
parent
a58c41e750
commit
6767fcfc8a
5 changed files with 11 additions and 29 deletions
|
|
@ -125,7 +125,7 @@ $app->get('/containers', function (Request $request, Response $response, array $
|
|||
'automatic_updates' => $configurationManager->areAutomaticUpdatesEnabled(),
|
||||
'is_backup_section_enabled' => $configurationManager->isBackupSectionEnabled(),
|
||||
'is_imaginary_enabled' => $configurationManager->isImaginaryEnabled,
|
||||
'is_fulltextsearch_enabled' => $configurationManager->isFulltextsearchEnabled(),
|
||||
'is_fulltextsearch_enabled' => $configurationManager->isFulltextsearchEnabled,
|
||||
'additional_backup_directories' => $configurationManager->GetAdditionalBackupDirectoriesString(),
|
||||
'nextcloud_datadir' => $configurationManager->GetNextcloudDatadirMount(),
|
||||
'nextcloud_mount' => $configurationManager->GetNextcloudMount(),
|
||||
|
|
|
|||
|
|
@ -83,7 +83,7 @@ readonly class ContainerDefinitionFetcher {
|
|||
continue;
|
||||
}
|
||||
} elseif ($entry['container_name'] === 'nextcloud-aio-fulltextsearch') {
|
||||
if (!$this->configurationManager->isFulltextsearchEnabled()) {
|
||||
if (!$this->configurationManager->isFulltextsearchEnabled) {
|
||||
continue;
|
||||
}
|
||||
} elseif ($entry['container_name'] === 'nextcloud-aio-docker-socket-proxy') {
|
||||
|
|
@ -192,7 +192,7 @@ readonly class ContainerDefinitionFetcher {
|
|||
continue;
|
||||
}
|
||||
} elseif ($value === 'nextcloud-aio-fulltextsearch') {
|
||||
if (!$this->configurationManager->isFulltextsearchEnabled()) {
|
||||
if (!$this->configurationManager->isFulltextsearchEnabled) {
|
||||
continue;
|
||||
}
|
||||
} elseif ($value === 'nextcloud-aio-docker-socket-proxy') {
|
||||
|
|
|
|||
|
|
@ -85,11 +85,7 @@ readonly class ConfigurationController {
|
|||
$this->configurationManager->isTalkEnabled = isset($request->getParsedBody()['talk']);
|
||||
$this->configurationManager->isTalkRecordingEnabled = isset($request->getParsedBody()['talk-recording']);
|
||||
$this->configurationManager->isImaginaryEnabled = isset($request->getParsedBody()['imaginary']);
|
||||
if (isset($request->getParsedBody()['fulltextsearch'])) {
|
||||
$this->configurationManager->SetFulltextsearchEnabledState(1);
|
||||
} else {
|
||||
$this->configurationManager->SetFulltextsearchEnabledState(0);
|
||||
}
|
||||
$this->configurationManager->isFulltextsearchEnabled = isset($request->getParsedBody()['fulltextsearch']);
|
||||
$this->configurationManager->isDockerSocketProxyEnabled = isset($request->getParsedBody()['docker-socket-proxy']);
|
||||
$this->configurationManager->isWhiteboardEnabled = isset($request->getParsedBody()['whiteboard']);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -98,6 +98,12 @@ class ConfigurationManager
|
|||
set { $this->set('isImaginaryEnabled', $value); }
|
||||
}
|
||||
|
||||
public bool $isFulltextsearchEnabled {
|
||||
get => $this->get('isFulltextsearchEnabled', false);
|
||||
// Elasticsearch does not work on kernels without seccomp anymore. See https://github.com/nextcloud/all-in-one/discussions/5768
|
||||
set { $this->set('isFulltextsearchEnabled', ($this->isSeccompDisabled() && $value)); }
|
||||
}
|
||||
|
||||
public function GetConfig() : array
|
||||
{
|
||||
if ($this->config === [] && file_exists(DataConst::GetConfigFile()))
|
||||
|
|
@ -233,26 +239,6 @@ class ConfigurationManager
|
|||
}
|
||||
}
|
||||
|
||||
public function isFulltextsearchEnabled() : bool {
|
||||
$config = $this->GetConfig();
|
||||
if (isset($config['isFulltextsearchEnabled']) && $config['isFulltextsearchEnabled'] === 1) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public function SetFulltextsearchEnabledState(int $value) : void {
|
||||
// Elasticsearch does not work on kernels without seccomp anymore. See https://github.com/nextcloud/all-in-one/discussions/5768
|
||||
if ($this->isSeccompDisabled()) {
|
||||
$value = 0;
|
||||
}
|
||||
|
||||
$config = $this->GetConfig();
|
||||
$config['isFulltextsearchEnabled'] = $value;
|
||||
$this->WriteConfig($config);
|
||||
}
|
||||
|
||||
/**
|
||||
* @throws InvalidSettingConfigurationException
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -580,7 +580,7 @@ readonly class DockerActionManager {
|
|||
'TIMEZONE' => $this->configurationManager->GetTimezone() === '' ? 'Etc/UTC' : $this->configurationManager->GetTimezone(),
|
||||
'COLLABORA_DICTIONARIES' => $this->configurationManager->GetCollaboraDictionaries() === '' ? 'de_DE en_GB en_US es_ES fr_FR it nl pt_BR pt_PT ru' : $this->configurationManager->GetCollaboraDictionaries(),
|
||||
'IMAGINARY_ENABLED' => $this->configurationManager->isImaginaryEnabled ? 'yes' : '',
|
||||
'FULLTEXTSEARCH_ENABLED' => $this->configurationManager->isFulltextsearchEnabled() ? 'yes' : '',
|
||||
'FULLTEXTSEARCH_ENABLED' => $this->configurationManager->isFulltextsearchEnabled ? 'yes' : '',
|
||||
'DOCKER_SOCKET_PROXY_ENABLED' => $this->configurationManager->isDockerSocketProxyEnabled ? 'yes' : '',
|
||||
'NEXTCLOUD_UPLOAD_LIMIT' => $this->configurationManager->GetNextcloudUploadLimit(),
|
||||
'NEXTCLOUD_MEMORY_LIMIT' => $this->configurationManager->GetNextcloudMemoryLimit(),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue