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 Jun 1, 2023
1 parent 37b9f2d commit 5b7d259
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 11 deletions.
2 changes: 2 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ Version 0.9.1 (UNRELEASED)
- Adds support for Kubernetes clusters 1.26, 1.27.
- Adds new configuration option ``ingress.extra`` to define extra Ingress resources, in order to support redirecting HTTP requests to HTTPS with traefik v2 version.
- Adds new configuration option ``ingress.tls.hosts`` to define hosts that are present in the TLS certificate, in order to support cert-manager's automatic creation of certificates.
- Adds new configuration option ``notifications.email_config.smtp_ssl`` to use SSL when connecting to the SMTP email server.
- Adds new configuration option ``notifications.email_config.smtp_starttls`` to use the STARTTLS command to enable encryption after connecting to the SMTP email server.
- Changes uWSGI configuration to add vacuuming of generated files and sockets.
- Fixes uWSGI memory consumption on systems with very high allowed number of open files.
- Adds new configuration options ``login`` and ``secrets.login`` for configuring Keycloak SSO login with third-party authentication services.
Expand Down
2 changes: 2 additions & 0 deletions helm/reana/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,8 @@ This Helm automatically prefixes all names using the release name to avoid colli
| `notifications.email_config.receiver` | Email address which will be receiving the notifications | None |
| `notifications.email_config.sender` | Email address which will be sending the notifications | None |
| `notifications.email_config.smtp_server` | SMTP email server host | None |
| `notifications.email_config.smtp_ssl` | Use SSL to connect to SMTP server | false |
| `notifications.email_config.smtp_starttls` | Use STARTTLS command of SMTP to upgrade to an encrypted connection | true |
| `notifications.email_config.smtp_port` | SMTP email server port | None |
| `notifications.enabled` | Enable REANA system events notifications | false |
| `notifications.system_status` | Cronjob pattern representing how often the system status notification should be sent. Leave it empty to deactivate it | "0 0 * * *" |
Expand Down
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 5b7d259

Please sign in to comment.