diff --git a/charts/exivity/templates/pigeon/deployment.yaml b/charts/exivity/templates/pigeon/deployment.yaml index a967013f..559d980d 100644 --- a/charts/exivity/templates/pigeon/deployment.yaml +++ b/charts/exivity/templates/pigeon/deployment.yaml @@ -18,6 +18,8 @@ spec: {{- include "exivity.labels" $ | indent 8 }} annotations: checksum/{{- include "exivity.fullname" $ -}}-config-pigeon: {{ include (print $.Template.BasePath "/pigeon/configmap.yaml") . | sha256sum }} + checksum/{{- include "exivity.fullname" $ -}}-config-smtp: {{ include (print $.Template.BasePath "/smtp/smtp-configmap.yaml") . | sha256sum }} + checksum/{{- include "exivity.fullname" $ -}}-smtp-secret: {{ include (print $.Template.BasePath "/smtp/smtp-secret.yaml") . | sha256sum }} spec: securityContext: {{- include "exivity.securityContext" (dict "root" . "component" "pigeon") | indent 8 }} @@ -59,6 +61,12 @@ spec: envFrom: - secretRef: name: {{ include "exivity.fullname" $ -}}-app-key + {{- if and .Values.communications .Values.communications.smtp }} + - secretRef: + name: {{ include "exivity.fullname" $ -}}-smtp-secret + - configMapRef: + name: {{ include "exivity.fullname" $ -}}-config-smtp + {{- end }} env: - name: REDIS_HOST value: exivity-redis-master diff --git a/charts/exivity/templates/proximity/api.deployment.yaml b/charts/exivity/templates/proximity/api.deployment.yaml index 99961f4e..9c7a132d 100644 --- a/charts/exivity/templates/proximity/api.deployment.yaml +++ b/charts/exivity/templates/proximity/api.deployment.yaml @@ -23,6 +23,8 @@ spec: checksum/{{- include "exivity.fullname" $ -}}-lock: {{ include (print $.Template.BasePath "/proximity/api.configmap.yaml") . | sha256sum }} checksum/{{- include "exivity.fullname" $ -}}-proximity-api-env: {{ include (print $.Template.BasePath "/proximity/api.env.yaml") . | sha256sum }} checksum/{{- include "exivity.fullname" $ -}}-secret: {{ include (print $.Template.BasePath "/secret.yaml") . | sha256sum }} + checksum/{{- include "exivity.fullname" $ -}}-config-smtp: {{ include (print $.Template.BasePath "/smtp/smtp-configmap.yaml") . | sha256sum }} + checksum/{{- include "exivity.fullname" $ -}}-smtp-secret: {{ include (print $.Template.BasePath "/smtp/smtp-secret.yaml") . | sha256sum }} spec: securityContext: {{- include "exivity.securityContext" (dict "root" . "component" "proximityApi") | indent 8 }} @@ -132,6 +134,12 @@ spec: name: {{ include "exivity.fullname" $ -}}-jwt-secret - configMapRef: name: {{ include "exivity.fullname" $ -}}-proximity-api-env + {{- if and .Values.communications .Values.communications.smtp }} + - secretRef: + name: {{ include "exivity.fullname" $ -}}-smtp-secret + - configMapRef: + name: {{ include "exivity.fullname" . }}-config-smtp + {{- end }} {{- include "exivity.probes" $ | indent 10}} {{- with .Values.service.pullSecrets }} imagePullSecrets: @@ -147,4 +155,4 @@ spec: {{ range $key, $val := . }} {{ $key }}: {{ $val }} {{- end }} - {{- end }} \ No newline at end of file + {{- end }} diff --git a/charts/exivity/templates/smtp/smtp-configmap.yaml b/charts/exivity/templates/smtp/smtp-configmap.yaml new file mode 100644 index 00000000..b7fffa22 --- /dev/null +++ b/charts/exivity/templates/smtp/smtp-configmap.yaml @@ -0,0 +1,30 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ include "exivity.fullname" $ }}-config-smtp + labels: + {{- include "exivity.labels" $ | indent 4 }} +data: + {{- if and .Values.communications .Values.communications.smtp }} + {{- if .Values.communications.smtp.driver }} + EXIVITY_MAIL_DRIVER: {{ .Values.communications.smtp.driver | quote }} + {{- end }} + {{- if .Values.communications.smtp.host }} + EXIVITY_MAIL_HOST: {{ .Values.communications.smtp.host | quote }} + {{- end }} + {{- if .Values.communications.smtp.port }} + EXIVITY_MAIL_PORT: {{ .Values.communications.smtp.port | quote }} + {{- end }} + {{- if .Values.communications.smtp.fromAddress }} + EXIVITY_MAIL_FROM_ADDRESS: {{ .Values.communications.smtp.fromAddress | quote }} + {{- end }} + {{- if .Values.communications.smtp.fromName }} + EXIVITY_MAIL_FROM_NAME: {{ .Values.communications.smtp.fromName | quote }} + {{- end }} + {{- if .Values.communications.smtp.encryption }} + EXIVITY_MAIL_ENCRYPTION: {{ .Values.communications.smtp.encryption | quote }} + {{- end }} + {{- if .Values.communications.smtp.smtpVerifyPeer }} + EXIVITY_MAIL_SMTP_VERIFY_PEER: {{ .Values.communications.smtp.smtpVerifyPeer | quote }} + {{- end }} + {{- end }} \ No newline at end of file diff --git a/charts/exivity/templates/smtp/smtp-secret.yaml b/charts/exivity/templates/smtp/smtp-secret.yaml new file mode 100644 index 00000000..7f9b33c2 --- /dev/null +++ b/charts/exivity/templates/smtp/smtp-secret.yaml @@ -0,0 +1,12 @@ +{{- if and .Values.communications.smtp .Values.communications.smtp.auth .Values.communications.smtp.auth.username .Values.communications.smtp.auth.password }} +apiVersion: v1 +kind: Secret +metadata: + name: {{ include "exivity.fullname" $ }}-smtp-secret + labels: + {{- include "exivity.labels" $ | indent 4 }} +type: Opaque +data: + EXIVITY_MAIL_USERNAME: {{ .Values.communications.smtp.auth.username | b64enc }} + EXIVITY_MAIL_PASSWORD: {{ .Values.communications.smtp.auth.password | b64enc }} +{{- end }} diff --git a/charts/exivity/values.schema.json b/charts/exivity/values.schema.json index 888cb811..ea867de5 100644 --- a/charts/exivity/values.schema.json +++ b/charts/exivity/values.schema.json @@ -182,6 +182,73 @@ } ] }, + "communications": { + "type": "object", + "properties": { + "smtp": { + "type": "object", + "properties": { + "driver": { + "type": "string", + "description": "Mail driver to use, e.g. smtp" + }, + "host": { + "type": "string", + "format": "hostname", + "description": "SMTP server hostname" + }, + "port": { + "type": "integer", + "minimum": 1, + "maximum": 65535, + "description": "SMTP server port" + }, + "encryption": { + "type": "string", + "enum": ["none", "ssl", "tls"], + "description": "One of: none | ssl | tls" + }, + "verifyPeer": { + "type": "boolean", + "description": "Verify certificate trust chain and hostname" + }, + "fromAddress": { + "type": "string", + "format": "email", + "description": "Sender email address" + }, + "fromName": { + "type": "string", + "description": "Sender name" + }, + "auth": { + "type": "object", + "properties": { + "username": { + "type": "string", + "description": "SMTP username" + }, + "password": { + "type": "string", + "description": "SMTP password" + } + }, + "required": ["username"], + "additionalProperties": false + } + }, + "required": [ + "host", + "port", + "encryption", + "fromAddress", + "fromName", + "auth" + ], + "additionalProperties": false + } + } + }, "postgresql": { "type": "object", "default": {}, @@ -2775,6 +2842,7 @@ } ] }, + "logLevel": { "type": "object", "default": {}, @@ -3032,6 +3100,19 @@ "helmResourcePolicyKeep": true, "sharedVolumeAccessMode": "ReadWriteMany" }, + "smtp": { + "mail": { + "driver": "", + "host": "", + "port": "", + "encryption": "", + "smtpVerifyPeer": false, + "fromAddress": "", + "fromName": "", + "username": "", + "password": "" + } + }, "postgresql": { "enabled": true, "global": { diff --git a/charts/exivity/values.yaml b/charts/exivity/values.yaml index 90d9a03e..224163b4 100644 --- a/charts/exivity/values.yaml +++ b/charts/exivity/values.yaml @@ -78,6 +78,22 @@ storage: import: 1Gi report: 1Gi +communications: + {} + # SMTP settings + # smtp: + # driver: smtp # mail "driver" (e.g. smtp) + # host: smtp.example.com # SMTP server hostname + # port: 465 # SMTP server port + # encryption: tls # one of: none | ssl | tls + # verifyPeer: true # verify certificate trust chain and hostname + # fromAddress: noreply@exivity.com + # fromName: Exivity + # auth: + # username: info@your-domain + # password: SuperSecure + + # Configuration for PostgreSQL, either as an embedded database using the Bitnami PostgreSQL chart or an external database. # It is recommended to use an external PostgreSQL server for production environments to ensure scalability and manageability. # The embedded PostgreSQL chart is primarily intended for testing and non-production purposes.