diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 92bd0c3..d0ad844 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -31,8 +31,8 @@ pages: - sleep 10 - mkdir -p public - "echo \"User-Agent: *\nDisallow: /\" > ./public/robots.txt" - - curl --user gitlab-ci-token:$CI_JOB_TOKEN "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/helm/${CHANNEL}/index.yaml" -o public/index.yaml - - sed -e "s|- charts/|- ${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/helm/${CHANNEL}/charts/|" -i public/index.yaml + - curl --user gitlab-ci-token:$CI_JOB_TOKEN "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/helm/${CHANNEL}/index.yaml" -o repo-index.yaml + - sed -e "s|- charts/|- ${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/helm/${CHANNEL}/charts/|" repo-index.yaml > ./public/index.yaml artifacts: paths: - public diff --git a/charts/matrix-synapse/templates/NOTES.txt b/charts/matrix-synapse/templates/NOTES.txt index 1a7dfb8..5d8ce00 100644 --- a/charts/matrix-synapse/templates/NOTES.txt +++ b/charts/matrix-synapse/templates/NOTES.txt @@ -1,4 +1,7 @@ ** Note, this chart may take a while to finish setup, please be patient ** +{{- if .Values.signingkey.job.enabled }} +** Also, remember to disable the signingkey job (signingkey.job.enabled=false) ** +{{- end }} {{- if not .Values.ingress.enabled }} Synapse has been installed without an ingress, you will need to manage diff --git a/charts/matrix-synapse/templates/_helpers.tpl b/charts/matrix-synapse/templates/_helpers.tpl index 57290e5..cdf335b 100644 --- a/charts/matrix-synapse/templates/_helpers.tpl +++ b/charts/matrix-synapse/templates/_helpers.tpl @@ -150,10 +150,7 @@ Set postgresql username */}} {{- define "matrix-synapse.postgresql.username" -}} {{- if .Values.postgresql.enabled -}} -{{- if .Values.postgresql.postgresqlUsername -}} -{{- fail "You need to switch to the new postgresql.auth values." -}} -{{- end -}} -{{- .Values.postgresql.auth.username | default "postgres" }} +{{ required "A valid postgresql.auth.username is required" .Values.postgresql.auth.username }} {{- else -}} {{ required "A valid externalPostgresql.username is required" .Values.externalPostgresql.username }} {{- end -}} @@ -164,10 +161,7 @@ Set postgresql password */}} {{- define "matrix-synapse.postgresql.password" -}} {{- if .Values.postgresql.enabled -}} -{{- if .Values.postgresql.postgresqlPassword -}} -{{- fail "You need to switch to the new postgresql.auth values." -}} -{{- end -}} -{{- .Values.postgresql.auth.password | default "synapse" }} +{{ required "A valid postgresql.auth.password is required" .Values.postgresql.auth.password }} {{- else if not (and .Values.externalPostgresql.existingSecret .Values.externalPostgresql.existingSecretPasswordKey) -}} {{ required "A valid externalPostgresql.password is required" .Values.externalPostgresql.password }} {{- end -}} @@ -262,9 +256,9 @@ Set redis port Set redis password */}} {{- define "matrix-synapse.redis.password" -}} -{{- if .Values.redis.password -}} +{{- if (and .Values.redis.enabled .Values.redis.password) -}} {{ .Values.redis.password }} -{{- else if .Values.redis.auth.password -}} +{{- else if (and .Values.redis.enabled .Values.redis.auth.password) -}} {{ .Values.redis.auth.password }} {{- else if .Values.externalRedis.password -}} {{ .Values.externalRedis.password }} diff --git a/charts/matrix-synapse/templates/configuration-scripts.yaml b/charts/matrix-synapse/templates/configuration-scripts.yaml index a4e79fa..8f090a4 100644 --- a/charts/matrix-synapse/templates/configuration-scripts.yaml +++ b/charts/matrix-synapse/templates/configuration-scripts.yaml @@ -5,5 +5,7 @@ metadata: name: {{ include "matrix-synapse.fullname" . }}-scripts labels: {{- include "matrix-synapse.labels" . | nindent 4 }} + annotations: + helm.sh/hook: pre-install data: {{ (.Files.Glob "scripts/*.sh").AsConfig | indent 2 }} diff --git a/charts/matrix-synapse/templates/configuration.yaml b/charts/matrix-synapse/templates/configuration.yaml index aa945a2..7f04dee 100644 --- a/charts/matrix-synapse/templates/configuration.yaml +++ b/charts/matrix-synapse/templates/configuration.yaml @@ -51,7 +51,12 @@ data: x_forwarded: true resources: - - names: [client,federation] + - names: + - client + - federation +{{- with .Values.config.extraMainListenerTypes -}} + {{ . | toYaml | nindent 14 }} +{{- end }} compress: false - port: 9090 diff --git a/charts/matrix-synapse/templates/secrets.yaml b/charts/matrix-synapse/templates/secrets.yaml index c8c3ec3..acf22bb 100644 --- a/charts/matrix-synapse/templates/secrets.yaml +++ b/charts/matrix-synapse/templates/secrets.yaml @@ -95,6 +95,7 @@ apiVersion: v1 kind: Secret metadata: annotations: + helm.sh/hook: pre-install helm.sh/resource-policy: keep name: {{ $name }} labels: diff --git a/charts/matrix-synapse/templates/signing-key-job.yaml b/charts/matrix-synapse/templates/signing-key-job.yaml index 85417c0..ebd5191 100644 --- a/charts/matrix-synapse/templates/signing-key-job.yaml +++ b/charts/matrix-synapse/templates/signing-key-job.yaml @@ -12,6 +12,9 @@ metadata: labels: {{- include "matrix-synapse.labels" . | nindent 4 }} app.kubernetes.io/component: signingkey-job + annotations: + helm.sh/hook: pre-install + helm.sh/hook-delete-policy: hook-succeeded --- apiVersion: rbac.authorization.k8s.io/v1 kind: Role @@ -20,6 +23,9 @@ metadata: labels: {{- include "matrix-synapse.labels" . | nindent 4 }} app.kubernetes.io/component: signingkey-job + annotations: + helm.sh/hook: pre-install + helm.sh/hook-delete-policy: hook-succeeded rules: - apiGroups: - "" @@ -39,6 +45,9 @@ metadata: labels: {{- include "matrix-synapse.labels" . | nindent 4 }} app.kubernetes.io/component: signingkey-job + annotations: + helm.sh/hook: pre-install + helm.sh/hook-delete-policy: hook-succeeded roleRef: apiGroup: rbac.authorization.k8s.io kind: Role @@ -55,8 +64,10 @@ metadata: labels: {{- include "matrix-synapse.labels" . | nindent 4 }} app.kubernetes.io/component: signingkey-job - {{- with .Values.signingkey.job.annotations }} annotations: + helm.sh/hook: pre-install + helm.sh/hook-delete-policy: hook-succeeded + {{- with .Values.signingkey.job.annotations }} {{- toYaml . | nindent 4 }} {{- end }} spec: diff --git a/charts/matrix-synapse/values.yaml b/charts/matrix-synapse/values.yaml index 70dddfb..dbcda8b 100644 --- a/charts/matrix-synapse/values.yaml +++ b/charts/matrix-synapse/values.yaml @@ -135,6 +135,11 @@ config: # bind_addresses: ['::'] # type: manhole + ## Extra listener types to add onto the main listener. + ## + extraMainListenerTypes: [] + # - consent + ## Specify arbitrary Synapse configuration here; ## Ref: https://github.com/matrix-org/synapse/blob/develop/docs/sample_config.yaml ##