diff --git a/.github/workflows/lint-test.yaml b/.github/workflows/lint-test.yaml index 45739610..ded95bf8 100644 --- a/.github/workflows/lint-test.yaml +++ b/.github/workflows/lint-test.yaml @@ -2,17 +2,29 @@ name: Lint and Test Charts on: pull_request: - paths-ignore: - - '.github/**' - - 'charts/**/README.md' - - 'CODE_OF_CONDUCT.md' - - 'CONTRIBUTING.md' - - 'LICENSE' - - 'README.md' - + paths: jobs: - lint-test: + changes: + runs-on: ubuntu-latest-low + + outputs: + src: ${{ steps.changes.outputs.src}} + + steps: + - uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2 + id: changes + continue-on-error: true + with: + filters: | + src: + - 'charts/nextcloud/Chart.yaml' + - 'charts/nextcloud/values.yaml' + - 'charts/nextcloud/templates/**' + + lint: runs-on: ubuntu-22.04 + needs: changes + if: needs.changes.outputs.src != 'false' steps: - name: Checkout uses: actions/checkout@v4 @@ -20,9 +32,9 @@ jobs: fetch-depth: 0 - name: Install Helm - uses: azure/setup-helm@v3.5 + uses: azure/setup-helm@v4 with: - version: v3.11.1 + version: v3.14.4 - name: Add dependency chart repos run: | @@ -44,11 +56,82 @@ jobs: if: steps.list-changed.outputs.changed == 'true' run: ct lint --target-branch ${{ github.event.repository.default_branch }} + test-internal-database: + runs-on: ubuntu-22.04 + needs: [changes, lint] + if: needs.changes.outputs.src != 'false' + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Install Helm + uses: azure/setup-helm@v4 + with: + version: v3.14.4 + + - name: Add dependency chart repos + run: | + helm repo add bitnami https://charts.bitnami.com/bitnami + + - name: Set up chart-testing + uses: helm/chart-testing-action@v2.6.1 + + - name: Run chart-testing (list-changed) + id: list-changed + run: | + changed=$(ct list-changed --target-branch ${{ github.event.repository.default_branch }}) + if [[ -n "$changed" ]]; then + echo "changed=true" >> "$GITHUB_OUTPUT" + fi + - name: Create kind cluster - uses: helm/kind-action@v1.8.0 + uses: helm/kind-action@v1.10.0 if: steps.list-changed.outputs.changed == 'true' - name: Run chart-testing (install) id: install if: steps.list-changed.outputs.changed == 'true' run: ct install --target-branch ${{ github.event.repository.default_branch }} + + test-postgresql-database: + runs-on: ubuntu-22.04 + needs: [changes, lint] + if: needs.changes.outputs.src != 'false' + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Install Helm + uses: azure/setup-helm@v4 + with: + version: v3.14.4 + + - name: Add dependency chart repos + run: | + helm repo add bitnami https://charts.bitnami.com/bitnami + + - name: Set up chart-testing + uses: helm/chart-testing-action@v2.6.1 + + - name: Run chart-testing (list-changed) + id: list-changed + run: | + changed=$(ct list-changed --target-branch ${{ github.event.repository.default_branch }}) + if [[ -n "$changed" ]]; then + echo "changed=true" >> "$GITHUB_OUTPUT" + fi + + - name: Create kind cluster + uses: helm/kind-action@v1.10.0 + if: steps.list-changed.outputs.changed == 'true' + + - name: Run chart-testing (install) + id: install + if: steps.list-changed.outputs.changed == 'true' + run: | + ct install --target-branch ${{ github.event.repository.default_branch }} \ + --helm-extra-set-args "--set=postgresql.enabled=true --set=postgresql.global.postgresql.auth.password=testing123456 --set=internalDatabase.enabled=false --set=externalDatabase.enabled=True --set=externalDatabase.type=postgresql --set=externalDatabase.password=testing123456" diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 8115309d..d81aaca1 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -28,9 +28,9 @@ jobs: # See https://github.com/helm/chart-releaser-action/issues/6 - name: Set up Helm - uses: azure/setup-helm@v3.5 + uses: azure/setup-helm@v4 with: - version: v3.11.1 + version: v3.14.4 - name: Add dependency chart repos run: | diff --git a/charts/nextcloud/Chart.lock b/charts/nextcloud/Chart.lock index 8a002f80..f6ac2d62 100644 --- a/charts/nextcloud/Chart.lock +++ b/charts/nextcloud/Chart.lock @@ -1,12 +1,12 @@ dependencies: - name: postgresql repository: oci://registry-1.docker.io/bitnamicharts - version: 12.12.10 + version: 15.5.0 - name: mariadb repository: oci://registry-1.docker.io/bitnamicharts - version: 12.2.9 + version: 18.2.0 - name: redis repository: oci://registry-1.docker.io/bitnamicharts - version: 17.13.2 -digest: sha256:92fe0891c35c2586cfe3b76154412c188bb75cc0a687e1d771fc4c1cf0f8973d -generated: "2023-11-11T19:19:38.983179104+01:00" + version: 19.5.0 +digest: sha256:4efc098feeb7f4486b7166f1c71b9c54bfee0797663a3339f379d397297303c7 +generated: "2024-06-03T09:51:56.321676+02:00" diff --git a/charts/nextcloud/Chart.yaml b/charts/nextcloud/Chart.yaml index 82cf42c7..67a971f4 100644 --- a/charts/nextcloud/Chart.yaml +++ b/charts/nextcloud/Chart.yaml @@ -1,7 +1,7 @@ apiVersion: v2 name: nextcloud -version: 4.6.3 -appVersion: 28.0.2 +version: 5.1.0 +appVersion: 29.0.1 description: A file sharing server that puts the control and security of your own data back into your hands. keywords: - nextcloud @@ -23,14 +23,14 @@ maintainers: email: jeff@billimek.com dependencies: - name: postgresql - version: 12.12.* + version: 15.5.0 repository: oci://registry-1.docker.io/bitnamicharts condition: postgresql.enabled - name: mariadb - version: 12.2.* + version: 18.2.0 repository: oci://registry-1.docker.io/bitnamicharts condition: mariadb.enabled - name: redis - version: 17.13.* + version: 19.5.0 repository: oci://registry-1.docker.io/bitnamicharts condition: redis.enabled diff --git a/charts/nextcloud/README.md b/charts/nextcloud/README.md index 9d87425a..4df1a770 100644 --- a/charts/nextcloud/README.md +++ b/charts/nextcloud/README.md @@ -147,6 +147,7 @@ The following table lists the configurable parameters of the nextcloud chart and | `nginx.config.custom` | Specify a custom config for nginx | `{}` | | `nginx.resources` | nginx resources | `{}` | | `nginx.securityContext` | Optional security context for the nginx container | `nil` | +| `nginx.extraEnv` | Optional environment variables for the nginx container | `nil` | | `lifecycle.postStartCommand` | Specify deployment lifecycle hook postStartCommand | `nil` | | `lifecycle.preStopCommand` | Specify deployment lifecycle hook preStopCommand | `nil` | | `redis.enabled` | Whether to install/use redis for locking | `false` | @@ -257,6 +258,7 @@ Is there a missing parameter for one of the Bitnami helm charts listed above? Pl The [Nextcloud](https://hub.docker.com/_/nextcloud/) image stores the nextcloud data and configurations at the `/var/www/html` paths of the container. Persistent Volume Claims are used to keep the data across deployments. This is known to work with GKE, EKS, K3s, and minikube. +Nextcloud will *not* delete the PVCs when uninstalling the helm chart. | Parameter | Description | Default | diff --git a/charts/nextcloud/templates/_helpers.tpl b/charts/nextcloud/templates/_helpers.tpl index 8214e1ab..d9570f76 100644 --- a/charts/nextcloud/templates/_helpers.tpl +++ b/charts/nextcloud/templates/_helpers.tpl @@ -178,7 +178,7 @@ Create environment variables used to configure the nextcloud container as well a name: {{ .Values.nextcloud.existingSecret.secretName | default (include "nextcloud.fullname" .) }} key: {{ .Values.nextcloud.existingSecret.passwordKey }} - name: NEXTCLOUD_TRUSTED_DOMAINS - value: {{ .Values.nextcloud.host }} + value: {{ .Values.nextcloud.host }}{{ if .Values.metrics.enabled }} {{ template "nextcloud.fullname" . }}.{{ .Release.Namespace }}.svc.cluster.local{{ end }} {{- if ne (int .Values.nextcloud.update) 0 }} - name: NEXTCLOUD_UPDATE value: {{ .Values.nextcloud.update | quote }} diff --git a/charts/nextcloud/templates/deployment.yaml b/charts/nextcloud/templates/deployment.yaml index be3aeea9..83546f42 100644 --- a/charts/nextcloud/templates/deployment.yaml +++ b/charts/nextcloud/templates/deployment.yaml @@ -149,6 +149,10 @@ spec: - name: {{ .Chart.Name }}-nginx image: "{{ .Values.nginx.image.repository }}:{{ .Values.nginx.image.tag }}" imagePullPolicy: {{ .Values.nginx.image.pullPolicy }} + {{- with .Values.nginx.extraEnv }} + env: + {{- toYaml . | nindent 12 }} + {{- end }} ports: - name: http protocol: TCP diff --git a/charts/nextcloud/templates/nextcloud-data-pvc.yaml b/charts/nextcloud/templates/nextcloud-data-pvc.yaml index d10900a8..3a66404a 100644 --- a/charts/nextcloud/templates/nextcloud-data-pvc.yaml +++ b/charts/nextcloud/templates/nextcloud-data-pvc.yaml @@ -10,8 +10,9 @@ metadata: app.kubernetes.io/instance: {{ .Release.Name }} app.kubernetes.io/managed-by: {{ .Release.Service }} app.kubernetes.io/component: app - {{- with .Values.persistence.nextcloudData.annotations }} annotations: + helm.sh/resource-policy: keep + {{- with .Values.persistence.nextcloudData.annotations }} {{- toYaml . | nindent 4 }} {{- end }} spec: diff --git a/charts/nextcloud/templates/nextcloud-pvc.yaml b/charts/nextcloud/templates/nextcloud-pvc.yaml index 6bdd620b..893c952f 100644 --- a/charts/nextcloud/templates/nextcloud-pvc.yaml +++ b/charts/nextcloud/templates/nextcloud-pvc.yaml @@ -9,8 +9,9 @@ metadata: app.kubernetes.io/instance: {{ .Release.Name }} app.kubernetes.io/managed-by: {{ .Release.Service }} app.kubernetes.io/component: app - {{- with .Values.persistence.annotations }} annotations: + helm.sh/resource-policy: keep + {{- with .Values.persistence.annotations }} {{- toYaml . | nindent 4 }} {{- end }} spec: diff --git a/charts/nextcloud/templates/nginx-config.yaml b/charts/nextcloud/templates/nginx-config.yaml index aa5326a8..7c0df78d 100644 --- a/charts/nextcloud/templates/nginx-config.yaml +++ b/charts/nextcloud/templates/nginx-config.yaml @@ -104,7 +104,7 @@ # to the URI, resulting in a HTTP 500 error response. location ~ \.php(?:$|/) { # Required for legacy support - rewrite ^/(?!index|remote|public|cron|core\/ajax\/update|status|ocs\/v[12]|updater\/.+|oc[ms]-provider\/.+|.+\/richdocumentscode\/proxy) /index.php$request_uri; + rewrite ^/(?!index|remote|public|cron|core\/ajax\/update|status|ocs\/v[12]|updater\/.+|oc[ms]-provider\/.+|.+\/richdocumentscode(_arm64)?\/proxy) /index.php$request_uri; fastcgi_split_path_info ^(.+?\.php)(/.*)$; set $path_info $fastcgi_path_info; diff --git a/charts/nextcloud/templates/secrets.yaml b/charts/nextcloud/templates/secrets.yaml index 9b3ed4f9..0858255e 100644 --- a/charts/nextcloud/templates/secrets.yaml +++ b/charts/nextcloud/templates/secrets.yaml @@ -17,9 +17,9 @@ data: {{- else }} nextcloud-password: {{ randAlphaNum 10 | b64enc | quote }} {{- end }} - {{- with .Values.metrics.token }} - nextcloud-token: {{ . | b64enc | quote }} - {{- else }} + {{- if and .Values.metrics.enabled .Values.metrics.token }} + nextcloud-token: {{ .Values.metrics.token | b64enc | quote }} + {{- else if and .Values.metrics.enabled (not .Values.metrics.token) }} nextcloud-token: {{ randAlphaNum 10 | b64enc | quote }} {{- end }} {{- if .Values.nextcloud.mail.enabled }} diff --git a/charts/nextcloud/values.yaml b/charts/nextcloud/values.yaml index 2793a726..ecaa0df8 100644 --- a/charts/nextcloud/values.yaml +++ b/charts/nextcloud/values.yaml @@ -245,6 +245,11 @@ nginx: # runAsNonRoot: true # readOnlyRootFilesystem: true + ## Extra environment variables + extraEnv: [] + # - name: SOME_ENV + # value: ENV_VALUE + internalDatabase: enabled: true name: nextcloud