From 34376d535f907fd93488804fae12f42ce2317e10 Mon Sep 17 00:00:00 2001 From: Simon L Date: Tue, 3 Jan 2023 21:01:01 +0100 Subject: [PATCH] set remote_font_config for collabora Signed-off-by: Simon L --- php/containers.json | 2 +- php/src/Docker/DockerActionManager.php | 10 +++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/php/containers.json b/php/containers.json index 9cb179dc083..4872f8e0193 100644 --- a/php/containers.json +++ b/php/containers.json @@ -186,7 +186,7 @@ "internal_port": "9980", "environment": [ "aliasgroup1=https://%NC_DOMAIN%:443", - "extra_params=--o:ssl.enable=false --o:ssl.termination=true --o:logging.level=warning --o:home_mode.enable=true %COLLABORA_SECCOMP_POLICY%", + "extra_params=--o:ssl.enable=false --o:ssl.termination=true --o:logging.level=warning --o:home_mode.enable=true %COLLABORA_SECCOMP_POLICY% --o:remote_font_config.url=https://%NC_DOMAIN%/apps/richdocuments/settings/fonts.json", "dictionaries=%COLLABORA_DICTIONARIES%", "TZ=%TIMEZONE%" ], diff --git a/php/src/Docker/DockerActionManager.php b/php/src/Docker/DockerActionManager.php index 61d8aa6e3bc..1e09f44bb33 100644 --- a/php/src/Docker/DockerActionManager.php +++ b/php/src/Docker/DockerActionManager.php @@ -236,8 +236,16 @@ public function CreateContainer(Container $container) : void { $envs = $container->GetEnvironmentVariables()->GetVariables(); foreach($envs as $key => $env) { - $patterns = ['/%(.*)%/']; + // TODO: This whole block below is a hack and needs to get reworked in order to support multiple substitutions per line by default for all envs + if (str_starts_with($env, 'extra_params=')) { + $env = str_replace('%COLLABORA_SECCOMP_POLICY%', $this->configurationManager->GetCollaboraSeccompPolicy(), $env); + $env = str_replace('%NC_DOMAIN%', $this->configurationManager->GetDomain(), $env); + $envs[$key] = $env; + continue; + } + // Original implementation + $patterns = ['/%(.*)%/']; if(preg_match($patterns[0], $env, $out) === 1) { $replacements = array();