diff --git a/charts/nextcloud/README.md b/charts/nextcloud/README.md index f42d2b64..aa1ebdad 100644 --- a/charts/nextcloud/README.md +++ b/charts/nextcloud/README.md @@ -153,6 +153,7 @@ The following table lists the configurable parameters of the nextcloud chart and | `nextcloud.mail.smtp.password` | SMTP password | `''` | | `nextcloud.configs` | Config files created in `/var/www/html/config` | `{}` | | `nextcloud.persistence.subPath` | Set the subPath for nextcloud to use in volume | `nil` | +| `nextcloud.persistence.useImageCode` | Skip `/var/www` and `/var/www/html` mounts when using a custom image with code baked in | `false` | | `nextcloud.phpConfigs` | PHP Config files created in `/usr/local/etc/php/conf.d` | `{}` | | `nextcloud.defaultConfigs.\.htaccess` | Default .htaccess to protect `/var/www/html/config` | `true` | | `nextcloud.defaultConfigs.apache-pretty-urls\.config\.php` | Default Apache configuration for rewrite urls | `true` | diff --git a/charts/nextcloud/templates/_helpers.tpl b/charts/nextcloud/templates/_helpers.tpl index f165974b..a080ef18 100644 --- a/charts/nextcloud/templates/_helpers.tpl +++ b/charts/nextcloud/templates/_helpers.tpl @@ -368,12 +368,14 @@ Swift as primary object store env vars Create volume mounts for the nextcloud container as well as the cron sidecar container. */}} {{- define "nextcloud.volumeMounts" -}} +{{- if not .Values.nextcloud.persistence.useImageCode }} - name: nextcloud-main mountPath: /var/www/ subPath: {{ ternary "root" (printf "%s/root" .Values.nextcloud.persistence.subPath) (empty .Values.nextcloud.persistence.subPath) }} - name: nextcloud-main mountPath: /var/www/html subPath: {{ ternary "html" (printf "%s/html" .Values.nextcloud.persistence.subPath) (empty .Values.nextcloud.persistence.subPath) }} +{{- end }} {{- if and .Values.persistence.nextcloudData.enabled .Values.persistence.enabled }} - name: nextcloud-data mountPath: {{ .Values.nextcloud.datadir }} diff --git a/charts/nextcloud/templates/deployment.yaml b/charts/nextcloud/templates/deployment.yaml index aaebfe6c..db6d927f 100644 --- a/charts/nextcloud/templates/deployment.yaml +++ b/charts/nextcloud/templates/deployment.yaml @@ -207,12 +207,14 @@ spec: {{- toYaml . | nindent 12 }} {{- end }} volumeMounts: + {{- if not .Values.nextcloud.persistence.useImageCode }} - name: nextcloud-main mountPath: /var/www/ subPath: {{ ternary "root" (printf "%s/root" .Values.nextcloud.persistence.subPath) (empty .Values.nextcloud.persistence.subPath) }} - name: nextcloud-main mountPath: /var/www/html subPath: {{ ternary "html" (printf "%s/html" .Values.nextcloud.persistence.subPath) (empty .Values.nextcloud.persistence.subPath) }} + {{- end }} {{- if and .Values.persistence.nextcloudData.enabled .Values.persistence.enabled }} - name: nextcloud-data mountPath: {{ .Values.nextcloud.datadir }} diff --git a/charts/nextcloud/values.yaml b/charts/nextcloud/values.yaml index ea331e8a..d7200df8 100644 --- a/charts/nextcloud/values.yaml +++ b/charts/nextcloud/values.yaml @@ -141,6 +141,10 @@ nextcloud: datadir: /var/www/html/data persistence: subPath: + # Set to true when using an image with code baked in (no VOLUME /var/www/html). + # Skips the /var/www/ and /var/www/html mounts so the image code is not masked + # by the PVC. Only granular mounts (config, custom_apps, themes, tmp) are kept. + useImageCode: false # if set, we'll template this list to the NEXTCLOUD_TRUSTED_DOMAINS env var trustedDomains: [] ## SMTP configuration