Skip to content

Commit

Permalink
helm: allow customisation of SMTP SSL/STARTTLS
Browse files Browse the repository at this point in the history
  • Loading branch information
mdonadoni committed May 30, 2023
1 parent 37b9f2d commit a6c7814
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 11 deletions.
21 changes: 13 additions & 8 deletions helm/reana/templates/cronjobs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,6 @@ spec:
{{- if .Values.debug.enabled }}
- name: FLASK_ENV
value: "development"
- name: REANA_EMAIL_SMTP_SERVER
value: {{ printf "%s-mail" (include "reana.prefix" .) }}
- name: REANA_EMAIL_SMTP_PORT
value: "30025"
{{- else }}
- name: REANA_DB_USERNAME
valueFrom:
Expand All @@ -57,10 +53,21 @@ spec:
secretKeyRef:
name: {{ include "reana.prefix" . }}-db-secrets
key: password
{{- end }}
- name: REANA_EMAIL_SENDER
value: {{ .Values.notifications.email_config.sender }}
- name: REANA_EMAIL_SMTP_SERVER
value: {{ .Values.notifications.email_config.smtp_server }}
value: {{ .Values.notifications.email_config.smtp_server | default (printf "%s-mail" (include "reana.prefix" .)) }}
- name: REANA_EMAIL_SMTP_PORT
value: "{{ .Values.notifications.email_config.smtp_port }}"
value: "{{ .Values.notifications.email_config.smtp_port | default "30025" }}"
- name: REANA_EMAIL_SMTP_SSL
value: {{ .Values.notifications.email_config.smtp_ssl | default "false" | quote }}
{{- if .Values.debug.enabled }}
- name: REANA_EMAIL_SMTP_STARTTLS
value: "false"
{{- else }}
- name: REANA_EMAIL_SMTP_STARTTLS
value: {{ .Values.notifications.email_config.smtp_starttls | default "true" | quote }}
- name: REANA_EMAIL_LOGIN
valueFrom:
secretKeyRef:
Expand All @@ -74,8 +81,6 @@ spec:
{{- end }}
- name: REANA_COMPONENT_PREFIX
value: {{ include "reana.prefix" . }}
- name: REANA_EMAIL_SENDER
value: {{ .Values.notifications.email_config.sender }}
- name: REANA_ADMIN_ACCESS_TOKEN
valueFrom:
secretKeyRef:
Expand Down
9 changes: 8 additions & 1 deletion helm/reana/templates/reana-server.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,14 @@ spec:
value: {{ .Values.notifications.email_config.smtp_server | default (printf "%s-mail" (include "reana.prefix" .)) }}
- name: REANA_EMAIL_SMTP_PORT
value: "{{ .Values.notifications.email_config.smtp_port | default "30025" }}"
{{- if not .Values.debug.enabled }}
- name: REANA_EMAIL_SMTP_SSL
value: {{ .Values.notifications.email_config.smtp_ssl | default "false" | quote }}
{{- if .Values.debug.enabled }}
- name: REANA_EMAIL_SMTP_STARTTLS
value: "false"
{{- else }}
- name: REANA_EMAIL_SMTP_STARTTLS
value: {{ .Values.notifications.email_config.smtp_starttls | default "true" | quote }}
- name: REANA_EMAIL_LOGIN
valueFrom:
secretKeyRef:
Expand Down
4 changes: 2 additions & 2 deletions helm/reana/templates/secrets.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ metadata:
"helm.sh/resource-policy": keep
type: Opaque
data:
REANA_EMAIL_LOGIN: {{ .Values.notifications.email_config.login | default "team@reana.io" | b64enc }}
REANA_EMAIL_PASSWORD: {{ .Values.notifications.email_config.password | default "CHANGEME" | b64enc }}
REANA_EMAIL_LOGIN: {{ .Values.notifications.email_config.login | default "" | b64enc | quote }}
REANA_EMAIL_PASSWORD: {{ .Values.notifications.email_config.password | default "" | b64enc | quote }}
{{- end }}
---
{{- if and .Values.ingress.enabled .Values.ingress.tls.self_signed_cert }}
Expand Down

0 comments on commit a6c7814

Please sign in to comment.