From 3bdf118b8c4bc5ec9c76039527322041a11e6049 Mon Sep 17 00:00:00 2001 From: Stavros Kois <47820033+stavros-k@users.noreply.github.com> Date: Wed, 21 Jun 2023 11:00:28 +0300 Subject: [PATCH] fix(nextcloud): correct user for collabora (#9748) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit **Description** ⚒️ Fixes # **⚙️ Type of change** - [ ] ⚙️ Feature/App addition - [x] 🪛 Bugfix - [ ] ⚠️ Breaking change (fix or feature that would cause existing functionality to not work as expected) - [ ] 🔃 Refactor of current code **🧪 How Has This Been Tested?** **📃 Notes:** **✔️ Checklist:** - [x] ⚖️ My code follows the style guidelines of this project - [x] 👀 I have performed a self-review of my own code - [ ] #️⃣ I have commented my code, particularly in hard-to-understand areas - [ ] 📄 I have made corresponding changes to the documentation - [ ] ⚠️ My changes generate no new warnings - [ ] 🧪 I have added tests to this description that prove my fix is effective or that my feature works - [x] ⬆️ I increased versions for any altered app according to semantic versioning **➕ App addition** If this PR is an app addition please make sure you have done the following. - [ ] 🪞 I have opened a PR on [truecharts/containers](https://github.com/truecharts/containers) adding the container to TrueCharts mirror repo. - [ ] 🖼️ I have added an icon in the Chart's root directory called `icon.png` --- _Please don't blindly check all the boxes. Read them and only check those that apply. Those checkboxes are there for the reviewer to see what is this all about and the status of this PR with a quick glance._ --------- Signed-off-by: Stavros Kois <47820033+stavros-k@users.noreply.github.com> --- charts/incubator/nextcloud/Chart.yaml | 2 +- charts/incubator/nextcloud/ci/basic-values.yaml | 2 ++ .../nextcloud/templates/_ingressInjector.tpl | 2 +- .../incubator/nextcloud/templates/_validation.tpl | 4 ++++ charts/incubator/nextcloud/values.yaml | 15 +++++++++++---- 5 files changed, 19 insertions(+), 6 deletions(-) diff --git a/charts/incubator/nextcloud/Chart.yaml b/charts/incubator/nextcloud/Chart.yaml index fead7bf93f2..5d158f8c030 100644 --- a/charts/incubator/nextcloud/Chart.yaml +++ b/charts/incubator/nextcloud/Chart.yaml @@ -29,7 +29,7 @@ sources: - https://github.com/nextcloud/docker - https://github.com/nextcloud/helm type: application -version: 20.1.0 +version: 20.1.1 annotations: truecharts.org/catagories: | - cloud diff --git a/charts/incubator/nextcloud/ci/basic-values.yaml b/charts/incubator/nextcloud/ci/basic-values.yaml index 636ffe8e0d1..5ec603bf6ba 100644 --- a/charts/incubator/nextcloud/ci/basic-values.yaml +++ b/charts/incubator/nextcloud/ci/basic-values.yaml @@ -1,3 +1,5 @@ nextcloud: clamav: enabled: true + collabora: + enabled: true diff --git a/charts/incubator/nextcloud/templates/_ingressInjector.tpl b/charts/incubator/nextcloud/templates/_ingressInjector.tpl index d1b92b45071..d3c46d4d6c3 100644 --- a/charts/incubator/nextcloud/templates/_ingressInjector.tpl +++ b/charts/incubator/nextcloud/templates/_ingressInjector.tpl @@ -16,7 +16,7 @@ {{- define "nextcloud.collabora.ingress" -}} {{- $fullname := include "tc.v1.common.lib.chart.names.fullname" . }} -path: /collabora +path: /collabora/ pathType: Prefix service: name: {{ printf "%v-collabora" $fullname }} diff --git a/charts/incubator/nextcloud/templates/_validation.tpl b/charts/incubator/nextcloud/templates/_validation.tpl index 0b8aa4cf532..5650c0f63fe 100644 --- a/charts/incubator/nextcloud/templates/_validation.tpl +++ b/charts/incubator/nextcloud/templates/_validation.tpl @@ -33,6 +33,10 @@ {{- if not .Values.nextcloud.collabora.dictionaries -}} {{- fail "Nextcloud - Expected non-empty Collabora [Dictionaries]" -}} {{- end -}} + + {{- if not (deepEqual .Values.nextcloud.collabora.dictionaries (uniq .Values.nextcloud.collabora.dictionaries)) -}} + {{- fail "Nextcloud - Collabora [Dictionaries] must be unique" -}} + {{- end -}} {{- end -}} {{- end -}} diff --git a/charts/incubator/nextcloud/values.yaml b/charts/incubator/nextcloud/values.yaml index 868e3a644bd..f42d5d99570 100644 --- a/charts/incubator/nextcloud/values.yaml +++ b/charts/incubator/nextcloud/values.yaml @@ -281,12 +281,17 @@ workload: primary: true enabled: true imageSelector: collaboraImage - # TODO: Check how low we can go securityContext: - runAsUser: 0 - runAsGroup: 0 - runAsNonRoot: false + runAsUser: 100 + runAsGroup: 102 readOnlyRootFilesystem: false + allowPrivilegeEscalation: true + capabilities: + add: + - CHOWN + - FOWNER + - SYS_CHROOT + - MKNOD envFrom: - configMapRef: name: collabora-config @@ -294,10 +299,12 @@ workload: readiness: enabled: true type: http + path: /collabora/ port: "{{ .Values.service.collabora.ports.collabora.targetPort }}" liveness: enabled: true type: http + path: /collabora/ port: "{{ .Values.service.collabora.ports.collabora.targetPort }}" startup: enabled: true