From a64e5f86b12193a7455ffb7fad9bf6342d77351e Mon Sep 17 00:00:00 2001 From: "Simon L." Date: Tue, 2 Sep 2025 15:12:59 +0200 Subject: [PATCH] collabora: allow to use enterprise container image with support key Signed-off-by: Simon L. --- Containers/collabora-online/Dockerfile | 15 +++++++++++++++ Containers/collabora-online/healthcheck.sh | 7 +++++++ .../nextcloud-aio-collabora-deployment.yaml | 4 ++++ php/containers.json | 2 +- php/src/ContainerDefinitionFetcher.php | 3 +++ php/src/Data/ConfigurationManager.php | 7 +++++++ 6 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 Containers/collabora-online/Dockerfile create mode 100644 Containers/collabora-online/healthcheck.sh mode change 100755 => 100644 nextcloud-aio-helm-chart/templates/nextcloud-aio-collabora-deployment.yaml diff --git a/Containers/collabora-online/Dockerfile b/Containers/collabora-online/Dockerfile new file mode 100644 index 00000000..72f79928 --- /dev/null +++ b/Containers/collabora-online/Dockerfile @@ -0,0 +1,15 @@ +# syntax=docker/dockerfile:latest +# From https://gitlab.collabora.com/collabora-online/docker +# hadolint ignore=DL3007 +FROM registry.gitlab.collabora.com/collabora-online/docker:latest + +USER root +ARG DEBIAN_FRONTEND=noninteractive + +COPY --chmod=775 healthcheck.sh /healthcheck.sh + +USER 1001 + +HEALTHCHECK --start-period=60s --retries=9 CMD /healthcheck.sh +LABEL com.centurylinklabs.watchtower.enable="false" \ + org.label-schema.vendor="Nextcloud" diff --git a/Containers/collabora-online/healthcheck.sh b/Containers/collabora-online/healthcheck.sh new file mode 100644 index 00000000..45e9278b --- /dev/null +++ b/Containers/collabora-online/healthcheck.sh @@ -0,0 +1,7 @@ +#!/bin/bash + +# Unfortunately, no curl and no nc is installed in the container +# and packages can also not be added as the package list is broken. +# So always exiting 0 for now. +# nc http://127.0.0.1:9980 || exit 1 +exit 0 diff --git a/nextcloud-aio-helm-chart/templates/nextcloud-aio-collabora-deployment.yaml b/nextcloud-aio-helm-chart/templates/nextcloud-aio-collabora-deployment.yaml old mode 100755 new mode 100644 index 449a24fc..1b68e028 --- a/nextcloud-aio-helm-chart/templates/nextcloud-aio-collabora-deployment.yaml +++ b/nextcloud-aio-helm-chart/templates/nextcloud-aio-collabora-deployment.yaml @@ -35,7 +35,11 @@ spec: value: --o:ssl.enable=false --o:ssl.termination=true --o:mount_jail_tree=false --o:logging.level=warning --o:logging.level_startup=warning --o:home_mode.enable=true --o:remote_font_config.url=https://{{ .Values.NC_DOMAIN }}/apps/richdocuments/settings/fonts.json --o:net.post_allow.host[0]=.+ - name: server_name value: "{{ .Values.NC_DOMAIN }}" + {{- if contains "--o:support_key=" (join " " (.Values.ADDITIONAL_COLLABORA_OPTIONS | default list)) }} + image: ghcr.io/nextcloud-releases/aio-collabora-online: + {{- else }} image: ghcr.io/nextcloud-releases/aio-collabora:20251031_122139 + {{- end }} readinessProbe: exec: command: diff --git a/php/containers.json b/php/containers.json index 1a775c98..df0e2d28 100644 --- a/php/containers.json +++ b/php/containers.json @@ -380,7 +380,7 @@ "internal_port": "9980", "environment": [ "aliasgroup1=https://%NC_DOMAIN%:443,http://nextcloud-aio-apache:23973", - "extra_params=--o:ssl.enable=false --o:ssl.termination=true --o:logging.level=warning --o:logging.level_startup=warning --o:home_mode.enable=true %COLLABORA_SECCOMP_POLICY% --o:remote_font_config.url=https://%NC_DOMAIN%/apps/richdocuments/settings/fonts.json --o:net.post_allow.host[0]=.+", + "extra_params=--o:ssl.enable=false --o:ssl.termination=true --o:logging.level=warning --o:logging.level_startup=warning --o:welcome.enable=false %COLLABORA_SECCOMP_POLICY% --o:remote_font_config.url=https://%NC_DOMAIN%/apps/richdocuments/settings/fonts.json --o:net.post_allow.host[0]=.+", "dictionaries=%COLLABORA_DICTIONARIES%", "TZ=%TIMEZONE%", "server_name=%NC_DOMAIN%", diff --git a/php/src/ContainerDefinitionFetcher.php b/php/src/ContainerDefinitionFetcher.php index 2ea04d82..7b092e45 100644 --- a/php/src/ContainerDefinitionFetcher.php +++ b/php/src/ContainerDefinitionFetcher.php @@ -67,6 +67,9 @@ readonly class ContainerDefinitionFetcher { if (!$this->configurationManager->isCollaboraEnabled()) { continue; } + if ($this->configurationManager->isCollaboraSubscriptionEnabled()) { + $entry['image'] = 'ghcr.io/nextcloud-releases/aio-collabora-online'; + } } elseif ($entry['container_name'] === 'nextcloud-aio-talk') { if (!$this->configurationManager->isTalkEnabled()) { continue; diff --git a/php/src/Data/ConfigurationManager.php b/php/src/Data/ConfigurationManager.php index 50937222..58962248 100644 --- a/php/src/Data/ConfigurationManager.php +++ b/php/src/Data/ConfigurationManager.php @@ -978,6 +978,13 @@ class ConfigurationManager return $config['collabora_additional_options']; } + public function isCollaboraSubscriptionEnabled() : bool { + if (str_contains($this->GetAdditionalCollaboraOptions(), '--o:support_key=')) { + return true; + } + return false; + } + public function DeleteAdditionalCollaboraOptions() : void { $config = $this->GetConfig(); $config['collabora_additional_options'] = '';