Skip to content

Commit

Permalink
Merge pull request #214
Browse files Browse the repository at this point in the history
[radar-appserver] Add SMTP server configuration to send notifications via email
  • Loading branch information
pvannierop authored Jul 12, 2024
2 parents a3f35cb + 732c338 commit 055474e
Show file tree
Hide file tree
Showing 5 changed files with 58 additions and 2 deletions.
2 changes: 1 addition & 1 deletion charts/radar-appserver/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v2
appVersion: "2.4.1"
description: A Helm chart for the backend application of RADAR-base Appserver
name: radar-appserver
version: 0.2.2
version: 0.3.0
icon: "http://radar-base.org/wp-content/uploads/2022/09/Logo_RADAR-Base-RGB.png"
sources:
- https://github.com/RADAR-base/radar-helm-charts/tree/main/charts/radar-appserver
Expand Down
10 changes: 9 additions & 1 deletion charts/radar-appserver/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# radar-appserver
[![Artifact HUB](https://img.shields.io/endpoint?url=https://artifacthub.io/badge/repository/radar-appserver)](https://artifacthub.io/packages/helm/radar-base/radar-appserver)

![Version: 0.2.2](https://img.shields.io/badge/Version-0.2.2-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 2.4.1](https://img.shields.io/badge/AppVersion-2.4.1-informational?style=flat-square)
![Version: 0.3.0](https://img.shields.io/badge/Version-0.3.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 2.4.1](https://img.shields.io/badge/AppVersion-2.4.1-informational?style=flat-square)

A Helm chart for the backend application of RADAR-base Appserver

Expand Down Expand Up @@ -84,3 +84,11 @@ A Helm chart for the backend application of RADAR-base Appserver
| public_key_endpoints | string | `nil` | |
| google_application_credentials | string | `""` | Google credentials containing FCM server key, etc. |
| github_client_token | string | `""` | Github client token which is used for authenticating requests |
| smtp.enabled | bool | `false` | set to true, if sending of notifications via email should be enabled. |
| smtp.host | string | `"smtp"` | Hostname of the SMTP server |
| smtp.port | int | `25` | Port of the SMTP server |
| smtp.username | string | `"username"` | Username of the SMTP server |
| smtp.password | string | `"secret"` | Password of the SMTP server |
| smtp.from | string | `"[email protected]"` | Email address which should be used to send activation emails |
| smtp.starttls | bool | `false` | set to true,if TTLS should be enabled |
| smtp.auth | bool | `true` | set to true, if the account should be authenticated before sending emails |
26 changes: 26 additions & 0 deletions charts/radar-appserver/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,32 @@ spec:
secretKeyRef:
name: {{ template "radar-appserver.secretName" . }}
key: githubClientToken
{{- if .Values.smtp.enabled }}
- name: RADAR_NOTIFICATION_EMAIL_ENABLED
value: {{ .Values.smtp.enabled | quote }}
- name: RADAR_NOTIFICATION_EMAIL_FROM
value: {{ .Values.smtp.from }}
- name: SPRING_MAIL_HOST
value: "{{ .Values.smtp.host }}"
- name: SPRING_MAIL_PORT
value: {{ .Values.smtp.port | quote }}
- name: SPRING_MAIL_PROPERTIES_MAIL_SMTP_STARTTLS_ENABLE
value: {{ .Values.smtp.starttls | quote }}
- name: SPRING_MAIL_PROPERTIES_MAIL_SMTP_AUTH
value: {{ .Values.smtp.auth | quote }}
{{ if .Values.smtp.auth }}
- name: SPRING_MAIL_USERNAME
valueFrom:
secretKeyRef:
name: {{ template "radar-appserver.secretName" . }}
key: smtpUsername
- name: SPRING_MAIL_PASSWORD
valueFrom:
secretKeyRef:
name: {{ template "radar-appserver.secretName" . }}
key: smtpPassword
{{- end }}
{{- end }}
{{- with .Values.extraEnvVars }}
{{- toYaml . | nindent 10 }}
{{- end }}
Expand Down
4 changes: 4 additions & 0 deletions charts/radar-appserver/templates/secrets.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,8 @@ data:
databasePassword: {{ .Values.postgres.password | b64enc | quote }}
githubClientToken: {{ .Values.github_client_token | b64enc | quote }}
firebaseAdminSdkKey: {{ .Values.google_application_credentials | b64enc | quote }}
{{- if and .Values.smtp.enabled .Values.smtp.auth }}
smtpUsername: {{ .Values.smtp.username | b64enc | quote }}
smtpPassword: {{ .Values.smtp.password | b64enc | quote }}
{{ end }}
{{- end -}}
18 changes: 18 additions & 0 deletions charts/radar-appserver/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -213,3 +213,21 @@ google_application_credentials: ""

# -- Github client token which is used for authenticating requests
github_client_token: ""

smtp:
# -- set to true, if sending of notifications via email should be enabled.
enabled: false
# -- Hostname of the SMTP server
host: smtp
# -- Port of the SMTP server
port: 25
# -- Username of the SMTP server
username: username
# -- Password of the SMTP server
password: secret
# -- Email address which should be used to send activation emails
from: [email protected]
# -- set to true,if TTLS should be enabled
starttls: false
# -- set to true, if the account should be authenticated before sending emails
auth: true

0 comments on commit 055474e

Please sign in to comment.