From e1cdb099538ffcac5d86a97a34435fe69b67f2aa Mon Sep 17 00:00:00 2001 From: WrenIX Date: Tue, 19 Mar 2024 17:35:36 +0100 Subject: [PATCH] fix(mycloud-nextcloud): use official helm-chart --- mycloud-nextcloud/templates/release.yaml | 84 ++++++++++++------------ mycloud-nextcloud/templates/repo.yaml | 12 +--- mycloud-nextcloud/values.yaml | 5 -- 3 files changed, 44 insertions(+), 57 deletions(-) diff --git a/mycloud-nextcloud/templates/release.yaml b/mycloud-nextcloud/templates/release.yaml index d727af5..2a4735d 100644 --- a/mycloud-nextcloud/templates/release.yaml +++ b/mycloud-nextcloud/templates/release.yaml @@ -7,9 +7,9 @@ spec: chart: spec: sourceRef: - kind: GitRepository + kind: HelmRepository name: "nextcloud" - chart: "./charts/nextcloud" + chart: "nextcloud" # TODO delete later # https://codeberg.org/wrenix/flux-charts/issues/6 reconcileStrategy: "Revision" @@ -100,17 +100,14 @@ spec: # https://codeberg.org/wrenix/flux-charts/issues/7 before-starting: |- #!/bin/sh - echo "update all apps:"; - /var/www/html/occ app:update --all; - - echo "setup theming:"; - /var/www/html/occ theming:config disable-user-theming yes; - /var/www/html/occ theming:config name "{{ .Values.commons.theme.title }}"; - {{- with .Values.theme.color }} - /var/www/html/occ theming:config color {{ . | quote }}; - {{- end }} - - echo "setup oidc:"; + {{- $app := "user_oidc" }} + echo "=== manage: {{ $app }} ===" + echo "--- install: {{ $app }} ---" + /var/www/html/occ app:install {{ $app }}; + /var/www/html/occ app:enable {{ $app }}; + echo "--- configure: {{ $app }} ---" + /var/www/html/occ config:app:set -n {{ $app }} allow_multiple_user_backends --value="0" + /var/www/html/occ config:app:set -n {{ $app }} provider-1-groupProvisioning --value="1" /var/www/html/occ user_oidc:provider mycloud \ --clientid $NC_HOOK_OIDC_CLIENT_ID \ --clientsecret $NC_HOOK_OIDC_CLIENT_SECRET \ @@ -125,36 +122,37 @@ spec: --check-bearer=true \ --unique-uid=0; - appManagement: - enabled: true - apps: - user_oidc: - enabled: true - config: - allow_multiple_user_backends: "0" - provider-1-groupProvisioning: "1" - ## - # collabora - ## - {{- with .Values.apps.richdocuments }} - {{- if .enabled }} - richdocuments: - enabled: true - {{- with .config }} - config: - {{- with (get . "wopi_url") }} - wopi_url: {{ . }} - {{- else }} - wopi_url: "https://collabora.{{ $.Values.commons.ingress.domain }}" - {{- end }} - {{- with (omit . "wopi_url") }} - {{- toYaml . | nindent 14 }} - {{- end }} - {{- end }}{{/* with .config */}} - {{- end }}{{/* end-if .enabled */}} - {{- end }}{{/* end-with .richdocuments */}} - {{- with (omit .Values.apps "richdocuments") }} - {{- toYaml . | nindent 10 }} + + {{- range $app,$appConfig := .Values.apps }} + echo "=== manage app: {{ $app }} ==="; + {{- if $appConfig.enabled }} + echo "--- install: {{ $app }} ---" + /var/www/html/occ app:install {{ $app }} + /var/www/html/occ app:enable {{ $app }} + # config of app + echo "--- config: {{ $app }} ---" + {{- range $key, $value := $appConfig.config }} + /var/www/html/occ config:app:set -n {{ $app }} {{ $key }} --value={{ $value | quote }} + {{- end}} + {{- else }} + echo "--- disable: {{ $app }} ---" + /var/www/html/occ app:disable {{ $app }} + {{- end }} + {{- end }}{{/* end-range */}} + + {{- if .Values.apps.richdocuments.enabled }} + echo "=== manage: richdocuments -> configure for mycloud-collabora ===" + /var/www/html/occ config:app:set -n richdocuments wopi_url --value={{ get .Values.apps.richdocuments.config "wopi_url" | default (printf "https://collabora.%s" $.Values.commons.ingress.domain) | quote }} + {{- end }}{{/* end-else-if richdocuments.enable */}} + + echo "update all apps:"; + /var/www/html/occ app:update --all; + + echo "setup theming:"; + /var/www/html/occ theming:config disable-user-theming yes; + /var/www/html/occ theming:config name "{{ .Values.commons.theme.title }}"; + {{- with .Values.theme.color }} + /var/www/html/occ theming:config color {{ . | quote }}; {{- end }} phpClientHttpsFix: diff --git a/mycloud-nextcloud/templates/repo.yaml b/mycloud-nextcloud/templates/repo.yaml index 47edddf..2b85898 100644 --- a/mycloud-nextcloud/templates/repo.yaml +++ b/mycloud-nextcloud/templates/repo.yaml @@ -1,14 +1,8 @@ --- -apiVersion: source.toolkit.fluxcd.io/v1 -kind: GitRepository +apiVersion: source.toolkit.fluxcd.io/v1beta2 +kind: HelmRepository metadata: name: nextcloud spec: - url: https://github.com/wrenix/nextcloud-helm.git - ref: - {{- with .Values.helm.nextcloud.chart }} - commit: {{ . }} - {{- else }} - branch: main - {{- end }} + url: https://nextcloud.github.io/helm/ interval: 10m diff --git a/mycloud-nextcloud/values.yaml b/mycloud-nextcloud/values.yaml index bb8b7e2..a7832e6 100644 --- a/mycloud-nextcloud/values.yaml +++ b/mycloud-nextcloud/values.yaml @@ -54,11 +54,6 @@ commons: redis: replicas: 0 -helm: - nextcloud: - # -- version of the helm chart (current on git) - chart: "616d6ef694c862733932040293ba0cef8b1e7335" - # -- generated by .Values.commons.masterPassword adminPassword: