Skip to content

Commit

Permalink
Merge pull request #1663 from nextcloud/enh/1643/set-remote-font-conf…
Browse files Browse the repository at this point in the history
…ig-for-collabora

set remote_font_config for collabora
  • Loading branch information
szaimen authored Jan 4, 2023
2 parents 17031c7 + 34376d5 commit e047c24
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion php/containers.json
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,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%"
],
Expand Down
10 changes: 9 additions & 1 deletion php/src/Docker/DockerActionManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit e047c24

Please sign in to comment.