diff --git a/charts/stable/nextcloud/Chart.yaml b/charts/stable/nextcloud/Chart.yaml index 355f8f2d3cc..21c84650a45 100644 --- a/charts/stable/nextcloud/Chart.yaml +++ b/charts/stable/nextcloud/Chart.yaml @@ -33,7 +33,7 @@ sources: - https://github.com/nextcloud/docker - https://github.com/nextcloud/helm type: application -version: 15.0.1 +version: 15.1.0 annotations: truecharts.org/catagories: | - cloud diff --git a/charts/stable/nextcloud/templates/_cronjob.tpl b/charts/stable/nextcloud/templates/_cronjob.tpl index 472f9d39810..302f3b83aae 100644 --- a/charts/stable/nextcloud/templates/_cronjob.tpl +++ b/charts/stable/nextcloud/templates/_cronjob.tpl @@ -42,6 +42,11 @@ spec: echo "running nextcloud cronjob..." php -f /var/www/html/cron.php echo "cronjob finished" + {{- if .Values.cronjob.generatePreviews }} + echo "Pre-generating Previews..." + php /var/www/html/occ preview:pre-generate + echo "Previews generated." + {{- end }} EOF # Will mount configuration files as www-data (id: 33) by default for nextcloud {{- with (include "tc.common.controller.volumeMounts" . | trim) }} diff --git a/charts/stable/nextcloud/templates/_hpb.tpl b/charts/stable/nextcloud/templates/_hpb.tpl index 1854dcf0403..225aee33111 100644 --- a/charts/stable/nextcloud/templates/_hpb.tpl +++ b/charts/stable/nextcloud/templates/_hpb.tpl @@ -71,6 +71,12 @@ command: echo "Nextcloud instance with Notify_push found... Launching High Performance Backend..." /var/www/html/custom_apps/notify_push/bin/x86_64/notify_push /var/www/html/config/config.php & + {{- if .Values.imaginary.enabled }} + echo "Imaginary High Performance Previews enabled, enabling it on Nextcloud..." + php /var/www/html/occ config:system:set enabledPreviewProviders 6 --value='OC\Preview\Imaginary' + php /var/www/html/occ config:system:set preview_imaginary_url --value='http://127.0.0.1:9090' + {{- end }} + until $(curl --output /dev/null --silent --head --fail -H "Host: test.fakedomain.dns" http://127.0.0.1:7867/push/test/cookie); do echo "High Performance Backend not running ... waiting..." sleep 10 diff --git a/charts/stable/nextcloud/templates/_imaginary.tpl b/charts/stable/nextcloud/templates/_imaginary.tpl new file mode 100644 index 00000000000..57a72c43024 --- /dev/null +++ b/charts/stable/nextcloud/templates/_imaginary.tpl @@ -0,0 +1,40 @@ +{{/* Define the imaginary container */}} +{{- define "nextcloud.imaginary" -}} +image: {{ .Values.imaginaryImage.repository }}:{{ .Values.imaginaryImage.tag }} +imagePullPolicy: '{{ .Values.image.pullPolicy }}' +securityContext: + runAsUser: 33 + runAsGroup: 33 + readOnlyRootFilesystem: true + runAsNonRoot: true +ports: + - containerPort: 9090 +args: ["-enable-url-source"] +env: + - name: 'PORT' + value: '9090' +readinessProbe: + httpGet: + path: / + port: 9090 + initialDelaySeconds: {{ .Values.probes.readiness.spec.initialDelaySeconds }} + periodSeconds: {{ .Values.probes.readiness.spec.periodSeconds }} + timeoutSeconds: {{ .Values.probes.readiness.spec.timeoutSeconds }} + failureThreshold: {{ .Values.probes.readiness.spec.failureThreshold }} +livenessProbe: + httpGet: + path: / + port: 9090 + initialDelaySeconds: {{ .Values.probes.liveness.spec.initialDelaySeconds }} + periodSeconds: {{ .Values.probes.liveness.spec.periodSeconds }} + timeoutSeconds: {{ .Values.probes.liveness.spec.timeoutSeconds }} + failureThreshold: {{ .Values.probes.liveness.spec.failureThreshold }} +startupProbe: + httpGet: + path: / + port: 9090 + initialDelaySeconds: {{ .Values.probes.startup.spec.initialDelaySeconds }} + periodSeconds: {{ .Values.probes.startup.spec.periodSeconds }} + timeoutSeconds: {{ .Values.probes.startup.spec.timeoutSeconds }} + failureThreshold: {{ .Values.probes.startup.spec.failureThreshold }} +{{- end -}} diff --git a/charts/stable/nextcloud/templates/_nginx.tpl b/charts/stable/nextcloud/templates/_nginx.tpl index f428db0e503..df427f44bd8 100644 --- a/charts/stable/nextcloud/templates/_nginx.tpl +++ b/charts/stable/nextcloud/templates/_nginx.tpl @@ -1,6 +1,6 @@ {{/* Define the nginx container */}} {{- define "nextcloud.nginx" -}} -image: tccr.io/truecharts/nginx-unprivileged:v1.23.0@sha256:e0e989581b7935192d6023ac4a2c19045df39b69b43b894fedbd09726b34c133 +image: {{ .Values.nginxImage.repository }}:{{ .Values.nginxImage.tag }} imagePullPolicy: '{{ .Values.image.pullPolicy }}' securityContext: runAsUser: 33 diff --git a/charts/stable/nextcloud/templates/common.yaml b/charts/stable/nextcloud/templates/common.yaml index 49b8cf85838..9314524b1a2 100644 --- a/charts/stable/nextcloud/templates/common.yaml +++ b/charts/stable/nextcloud/templates/common.yaml @@ -7,10 +7,13 @@ {{- $newMiddlewares := append .Values.ingress.main.fixedMiddlewares "tc-nextcloud-chain" }} {{- $_ := set .Values.ingress.main "fixedMiddlewares" $newMiddlewares -}} +{{- $_ := set .Values.additionalContainers "nginx" (include "nextcloud.nginx" . | fromYaml) -}} +{{- if .Values.imaginary.enabled -}} +{{- $_ := set .Values.additionalContainers "imaginary" (include "nextcloud.imaginary" . | fromYaml) -}} +{{- end -}} {{- if .Values.hpb.enabled -}} {{- $_ := set .Values.additionalContainers "hpb" (include "nextcloud.hpb" . | fromYaml) -}} {{- end -}} -{{- $_ := set .Values.additionalContainers "nginx" (include "nextcloud.nginx" . | fromYaml) -}} {{/* Render the templates */}} {{ include "tc.common.loader.apply" . }} diff --git a/charts/stable/nextcloud/values.yaml b/charts/stable/nextcloud/values.yaml index cbabba2cbc8..7c619fa891e 100644 --- a/charts/stable/nextcloud/values.yaml +++ b/charts/stable/nextcloud/values.yaml @@ -1,7 +1,17 @@ image: repository: tccr.io/truecharts/nextcloud-fpm pullPolicy: IfNotPresent - tag: v24.0.2@sha256:2e8ce7bc258d243b81a3ff65bbae356e8e94d7844758f4342ca711709bdbe078 + tag: v24.0.2@sha256:9cd0fb3875d673932d50fa677326b42955a3e8637dc2602b7a827f2afb42eee9 + +nginxImage: + repository: tccr.io/truecharts/nginx-unprivileged + pullPolicy: IfNotPresent + tag: v1.23.0@sha256:e0e989581b7935192d6023ac4a2c19045df39b69b43b894fedbd09726b34c133 + +imaginaryImage: + repository: h2non/imaginary + pullPolicy: IfNotPresent + tag: 1.2.4@sha256:7facb4221047a5e79b9e902f380247f4e5bf4376400d0badbeb738d3e1c2f654 securityContext: readOnlyRootFilesystem: false @@ -33,6 +43,10 @@ service: enabled: true port: 9000 targetPort: 9000 + imaginary: + enabled: true + port: 9090 + targetPort: 9090 secretEnv: NEXTCLOUD_ADMIN_USER: "admin" @@ -360,6 +374,7 @@ configmap: cronjob: enabled: true + generatePreviews: true schedule: "*/5 * * * *" annotations: {} failedJobsHistoryLimit: 5 @@ -368,6 +383,10 @@ cronjob: hpb: enabled: true +imaginary: + enabled: true + + postgresql: enabled: true existingSecret: "dbcreds"