Skip to content

Commit

Permalink
Merge pull request #4387 from nextcloud/enh/4362/mirror-support
Browse files Browse the repository at this point in the history
Helm chart - Add private mirror support for OCI
  • Loading branch information
szaimen authored Mar 20, 2024
2 parents 172330b + 33eb9c9 commit faf94f0
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions nextcloud-aio-helm-chart/update-helm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,11 @@ find ./ -name '*networkpolicy.yaml' -exec sed -i "s|manual-install-nextcloud-aio
cat << EOL > /tmp/initcontainers
initContainers:
- name: init-volumes
{{- if or .Values.IMAGE_MIRROR_PREFIX .Values.ALPINE_IMAGE_ORG }}
image: "{{ .Values.IMAGE_MIRROR_PREFIX }}{{ .Values.ALPINE_IMAGE_ORG}}/alpine"
{{- else }}
image: alpine
{{- end }}
command:
- chmod
- "777"
Expand All @@ -68,14 +72,22 @@ EOL
cat << EOL > /tmp/initcontainers.database
initContainers:
- name: init-subpath
{{- if or .Values.IMAGE_MIRROR_PREFIX .Values.ALPINE_IMAGE_ORG }}
image: "{{ .Values.IMAGE_MIRROR_PREFIX }}{{ .Values.ALPINE_IMAGE_ORG}}/alpine"
{{- else }}
image: alpine
{{- end }}
command:
- mkdir
- "-p"
- /nextcloud-aio-database/data
volumeMountsInitContainer:
- name: init-volumes
{{- if or .Values.IMAGE_MIRROR_PREFIX .Values.ALPINE_IMAGE_ORG }}
image: "{{ .Values.IMAGE_MIRROR_PREFIX }}{{ .Values.ALPINE_IMAGE_ORG}}/alpine"
{{- else }}
image: alpine
{{- end }}
command:
- chown
- 999:999
Expand All @@ -85,14 +97,22 @@ EOL
cat << EOL > /tmp/initcontainers.clamav
initContainers:
- name: init-subpath
{{- if or .Values.IMAGE_MIRROR_PREFIX .Values.ALPINE_IMAGE_ORG }}
image: "{{ .Values.IMAGE_MIRROR_PREFIX }}{{ .Values.ALPINE_IMAGE_ORG}}/alpine"
{{- else }}
image: alpine
{{- end }}
command:
- mkdir
- "-p"
- /nextcloud-aio-clamav/data
volumeMountsInitContainer:
- name: init-volumes
{{- if or .Values.IMAGE_MIRROR_PREFIX .Values.ALPINE_IMAGE_ORG }}
image: "{{ .Values.IMAGE_MIRROR_PREFIX }}{{ .Values.ALPINE_IMAGE_ORG}}/alpine"
{{- else }}
image: alpine
{{- end }}
command:
- chown
- 100:100
Expand All @@ -102,14 +122,22 @@ EOL
cat << EOL > /tmp/initcontainers.nextcloud
initContainers:
- name: "delete-lost-found"
{{- if or .Values.IMAGE_MIRROR_PREFIX .Values.ALPINE_IMAGE_ORG }}
image: "{{ .Values.IMAGE_MIRROR_PREFIX }}{{ .Values.ALPINE_IMAGE_ORG}}/alpine"
{{- else }}
image: alpine
{{- end }}
command:
- rm
- "-rf"
- "/nextcloud-aio-nextcloud/lost+found"
volumeMountsInitRmLostFound:
- name: init-volumes
{{- if or .Values.IMAGE_MIRROR_PREFIX .Values.ALPINE_IMAGE_ORG }}
image: "{{ .Values.IMAGE_MIRROR_PREFIX }}{{ .Values.ALPINE_IMAGE_ORG}}/alpine"
{{- else }}
image: alpine
{{- end }}
command:
- chmod
- "777"
Expand Down Expand Up @@ -272,6 +300,8 @@ EOL
# shellcheck disable=SC1083
find ./ -name '*apache-deployment.yaml' -exec sed -i "/^.*\- env:/r /tmp/additional-apache.config" \{} \;

# shellcheck disable=SC1083
find ./ -name '*deployment.yaml' -exec sed -i 's|image: nextcloud/|image: "{{ .Values.IMAGE_MIRROR_PREFIX }}{{ .Values.NEXTCLOUD_IMAGE_ORG }}"/|' \{} \;

cd ../
mkdir -p ../helm-chart/
Expand Down Expand Up @@ -326,6 +356,10 @@ SMTP_NAME: # (empty by default): The username for the authentication.
SMTP_PASSWORD: # (empty by default): The password for the authentication.
MAIL_FROM_ADDRESS: # (not set by default): Set the local-part for the 'from' field in the emails sent by Nextcloud.
MAIL_DOMAIN: # (not set by default): Set a different domain for the emails than the domain where Nextcloud is installed.
IMAGE_MIRROR_PREFIX: # Setting this allows you to pull Nextcloud images through a mirror registry.
NEXTCLOUD_IMAGE_ORG: nextcloud # Setting this allows you to change the image's org name in case a different image needs to be used e.g. for compliance reasons.
ALPINE_IMAGE_ORG: # Setting this allows you to change the image's org name in case a different image needs to be used e.g. for compliance reasons.
ADDITIONAL_CONFIG

mv /tmp/sample.conf ../helm-chart/values.yaml
Expand Down

0 comments on commit faf94f0

Please sign in to comment.