Skip to content

Commit b75f01b

Browse files
committed
chore: refactor SMTP configuration to use communications structure and enhance schema documentation
Signed-off-by: Steffen Exler <[email protected]>
1 parent 7396d29 commit b75f01b

File tree

4 files changed

+90
-39
lines changed

4 files changed

+90
-39
lines changed

charts/exivity/templates/smtp/smtp-configmap.yaml

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,24 +5,24 @@ metadata:
55
labels:
66
{{- include "exivity.labels" $ | indent 4 }}
77
data:
8-
{{- if .Values.smtp.mail.driver }}
9-
EXIVITY_MAIL_DRIVER: {{ .Values.smtp.mail.driver | quote }}
8+
{{- if .Values.communications.smtp.driver }}
9+
EXIVITY_MAIL_DRIVER: {{ .Values.communications.smtp.driver | quote }}
1010
{{- end }}
11-
{{- if .Values.smtp.mail.host }}
12-
EXIVITY_MAIL_HOST: {{ .Values.smtp.mail.host | quote }}
11+
{{- if .Values.communications.smtp.host }}
12+
EXIVITY_MAIL_HOST: {{ .Values.communications.smtp.host | quote }}
1313
{{- end }}
14-
{{- if .Values.smtp.mail.port }}
15-
EXIVITY_MAIL_PORT: {{ .Values.smtp.mail.port | quote }}
14+
{{- if .Values.communications.smtp.port }}
15+
EXIVITY_MAIL_PORT: {{ .Values.communications.smtp.port | quote }}
1616
{{- end }}
17-
{{- if .Values.smtp.mail.fromAddress }}
18-
EXIVITY_MAIL_FROM_ADDRESS: {{ .Values.smtp.mail.fromAddress | quote }}
17+
{{- if .Values.communications.smtp.fromAddress }}
18+
EXIVITY_MAIL_FROM_ADDRESS: {{ .Values.communications.smtp.fromAddress | quote }}
1919
{{- end }}
20-
{{- if .Values.smtp.mail.fromName }}
21-
EXIVITY_MAIL_FROM_NAME: {{ .Values.smtp.mail.fromName | quote }}
20+
{{- if .Values.communications.smtp.fromName }}
21+
EXIVITY_MAIL_FROM_NAME: {{ .Values.communications.smtp.fromName | quote }}
2222
{{- end }}
23-
{{- if .Values.smtp.mail.encryption }}
24-
EXIVITY_MAIL_ENCRYPTION: {{ .Values.smtp.mail.encryption | quote }}
23+
{{- if .Values.communications.smtp.encryption }}
24+
EXIVITY_MAIL_ENCRYPTION: {{ .Values.communications.smtp.encryption | quote }}
2525
{{- end }}
26-
{{- if .Values.smtp.mail.smtpVerifyPeer }}
27-
EXIVITY_MAIL_SMTP_VERIFY_PEER: {{ .Values.smtp.mail.smtpVerifyPeer | quote }}
26+
{{- if .Values.communications.smtp.smtpVerifyPeer }}
27+
EXIVITY_MAIL_SMTP_VERIFY_PEER: {{ .Values.communications.smtp.smtpVerifyPeer | quote }}
2828
{{- end }}

charts/exivity/templates/smtp/smtp-secret.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ metadata:
55
labels:
66
{{- include "exivity.labels" $ | indent 4 }}
77
data:
8-
{{- with .Values.smtp.mail.username }}
8+
{{- with .Values.communications.smtp.auth.username }}
99
EXIVITY_MAIL_USERNAME: {{ . | b64enc }}
1010
{{- end }}
11-
{{- with .Values.smtp.mail.password }}
11+
{{- with .Values.communications.smtp.auth.password }}
1212
EXIVITY_MAIL_PASSWORD: {{ . | b64enc }}
1313
{{- end }}

charts/exivity/values.schema.json

Lines changed: 60 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -183,22 +183,70 @@
183183
}
184184
]
185185
},
186-
"smtp": {
186+
"communications": {
187187
"type": "object",
188188
"properties": {
189-
"mail": {
189+
"smtp": {
190190
"type": "object",
191191
"properties": {
192-
"driver": { "type": "string" },
193-
"host": { "type": "string" },
194-
"port": { "type": "integer" },
195-
"encryption": { "type": "string" },
196-
"smtpVerifyPeer": { "type": "boolean" },
197-
"fromAddress": { "type": "string" },
198-
"fromName": { "type": "string" },
199-
"username": { "type": "string" },
200-
"password": { "type": "string" }
201-
}
192+
"driver": {
193+
"type": "string",
194+
"description": "Mail driver to use, e.g. smtp"
195+
},
196+
"host": {
197+
"type": "string",
198+
"format": "hostname",
199+
"description": "SMTP server hostname"
200+
},
201+
"port": {
202+
"type": "integer",
203+
"minimum": 1,
204+
"maximum": 65535,
205+
"description": "SMTP server port"
206+
},
207+
"encryption": {
208+
"type": "string",
209+
"enum": ["none", "ssl", "tls"],
210+
"description": "One of: none | ssl | tls"
211+
},
212+
"verifyPeer": {
213+
"type": "boolean",
214+
"description": "Verify certificate trust chain and hostname"
215+
},
216+
"fromAddress": {
217+
"type": "string",
218+
"format": "email",
219+
"description": "Sender email address"
220+
},
221+
"fromName": {
222+
"type": "string",
223+
"description": "Sender name"
224+
},
225+
"auth": {
226+
"type": "object",
227+
"properties": {
228+
"username": {
229+
"type": "string",
230+
"description": "SMTP username"
231+
},
232+
"password": {
233+
"type": "string",
234+
"description": "SMTP password"
235+
}
236+
},
237+
"required": ["username"],
238+
"additionalProperties": false
239+
}
240+
},
241+
"required": [
242+
"host",
243+
"port",
244+
"encryption",
245+
"fromAddress",
246+
"fromName",
247+
"auth"
248+
],
249+
"additionalProperties": false
202250
}
203251
}
204252
},

charts/exivity/values.yaml

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -78,17 +78,20 @@ storage:
7878
import: 1Gi
7979
report: 1Gi
8080

81-
smtp:
82-
mail:
83-
driver: "smtp" # Mail driver to use (e.g. smtp)
84-
# host: "" # SMTP server hostname
85-
# port: "1025" # SMTP server port
86-
# encryption: "" # Encryption type (tls/ssl/none)
87-
# smtpVerifyPeer: true # Verify SMTP peer (true/false), only connect if the server's certificate is valid and trusted.
88-
# fromAddress: "" # Sender email address eg: [email protected]
89-
# fromName: "" # Sender name eg: Exivity
90-
# username: "info@your-domain" # SMTP username
91-
# password: "SuperSecure" # SMTP password
81+
communications:
82+
{}
83+
# SMTP settings
84+
# smtp:
85+
# driver: smtp # mail "driver" (e.g. smtp)
86+
# host: smtp.example.com # SMTP server hostname
87+
# port: 465 # SMTP server port
88+
# encryption: tls # one of: none | ssl | tls
89+
# verifyPeer: true # verify certificate trust chain and hostname
90+
# fromAddress: [email protected]
91+
# fromName: Exivity
92+
# auth:
93+
# username: info@your-domain
94+
# password: SuperSecure
9295

9396
logfiles:
9497
deleteDays: 365 # Delete logfiles after N days

0 commit comments

Comments
 (0)