Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix configuration values #4

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions charts/maildev/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ Not listing here the more general paramaters such as tolerations, nodeSelectors,

| Parameter | Description | Default |
|------------------------------:|:--------------------------------------------------------------------------------------------------|:--------------------------------------------|
| **outgoing_relay.host** | SMTP Relay host, `MAILDEV_OUTGOING_HOST`. | `` |
| **outgoing_relay.port** | SMTP Relay port, `MAILDEV_OUTGOING_PORT`. | `` |
| **outgoing_relay.user** | SMTP Relay user, `MAILDEV_OUTGOING_USER`. | `` |
| **outgoing_relay.pass** | SMTP Relay password, `MAILDEV_OUTGOING_PASS`. | `` |
| **outgoing_relay.secure** | Use SMTP SSL for outgoing emails, `MAILDEV_OUTGOING_SECURE`. | `true`. Hardcoded in the deployment due to a bug. |
| **outgoingRelay.host** | SMTP Relay host, `MAILDEV_OUTGOING_HOST`. | `` |
| **outgoingRelay.port** | SMTP Relay port, `MAILDEV_OUTGOING_PORT`. | `` |
| **outgoingRelay.user** | SMTP Relay user, `MAILDEV_OUTGOING_USER`. | `` |
| **outgoingRelay.pass** | SMTP Relay password, `MAILDEV_OUTGOING_PASS`. | `` |
| **outgoingRelay.secure** | Use SMTP SSL for outgoing emails, `MAILDEV_OUTGOING_SECURE`. | `true`. Hardcoded in the deployment due to a bug. |
| **ports.smtp** | Port where the SMTP service is listening. (Irrelevant for OCP/K8S), `MAILDEV_SMTP_PORT`. | `1025` |
| **ports.web** | Port where the Web interface service is listening. (Irrelevant for OCP/K8S), `MAILDEV_WEB_PORT`. | `1080` |
| **web.disable** | Disable Web interface. `MAILDEV_DISABLE_WEB`. | `false` |
Expand Down
4 changes: 3 additions & 1 deletion charts/maildev/templates/cm-auto-relay-rules.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
{{- if .Values.outgoingRelay.autoRelay.enabled -}}
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ include "maildev.fullname" . }}-relay-rules
labels:
{{- include "maildev.labels" . | nindent 4 }}
data:
auto-relay-rules.json: "[\n\t{ \"allow\": \"*\" }\n]\n"
auto-relay-rules.json: '{{ .Values.outgoingRelay.autoRelay.rules | toJson }}'
{{- end -}}
58 changes: 39 additions & 19 deletions charts/maildev/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,11 @@ spec:
{{- include "maildev.selectorLabels" . | nindent 6 }}
template:
metadata:
{{- with .Values.podAnnotations }}
annotations:
checksum/cm-auto-relay-rules: {{ include (print $.Template.BasePath "/cm-auto-relay-rules.yaml") . | sha256sum }}
{{- with .Values.podAnnotations }}
{{- toYaml . | nindent 8 }}
{{- end }}
{{- end }}
labels:
{{- include "maildev.selectorLabels" . | nindent 8 }}
spec:
Expand All @@ -30,8 +31,19 @@ spec:
securityContext:
{{- toYaml .Values.securityContext | nindent 12 }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
command: ["/usr/src/app/bin/maildev"]
args: ["--verbose", "--outgoing-secure", "--auto-relay"]
args:
{{- if .Values.verbose }}
- "--verbose"
{{- end }}
{{- if .Values.outgoingRelay.autoRelay.enabled }}
- "--auto-relay"
{{- end }}
{{- if .Values.outgoingRelay.secure }}
- "--outgoing-secure"
{{- end }}
{{- if .Values.web.disable }}
- "--disable-web"
{{- end }}
imagePullPolicy: {{ .Values.image.pullPolicy }}
ports:
- name: smtp-port
Expand All @@ -41,8 +53,6 @@ spec:
containerPort: {{ .Values.ports.web }}
protocol: TCP
env:
- name: MAILDEV_DISABLE_WEB
value: "{{ .Values.web.disable }}"
{{- if or .Values.web.user .Values.web.pass}}
- name: MAILDEV_WEB_USER
value: "{{ .Values.web.user }}"
Expand All @@ -55,24 +65,36 @@ spec:
value: "{{ .Values.ports.web }}"
- name: MAILDEV_HTTPS
value: "{{ .Values.https.enabled }}"
{{- if .Values.https.key }}
{{- if .Values.https.enabled }}
- name: MAILDEV_HTTPS_KEY
value: "{{ .Values.https.key }}"
{{- end }}
{{- if .Values.https.cert }}
- name: MAILDEV_HTTPS_CERT
value: "{{ .Values.https.cert }}"
{{- end }}
{{- if .Values.outgoingRelay.host }}
- name: MAILDEV_OUTGOING_HOST
value: "{{ .Values.outgoing_relay.host }}"
value: "{{ .Values.outgoingRelay.host }}"
{{- end }}
{{- if .Values.outgoingRelay.port }}
- name: MAILDEV_OUTGOING_PORT
value: "{{ .Values.outgoing_relay.port }}"
value: "{{ .Values.outgoingRelay.port }}"
{{- end }}
{{- if .Values.outgoingRelay.user }}
- name: MAILDEV_OUTGOING_USER
value: "{{ .Values.outgoing_relay.user }}"
value: "{{ .Values.outgoingRelay.user }}"
{{- end }}
{{- if .Values.outgoingRelay.pass }}
- name: MAILDEV_OUTGOING_PASS
value: "{{ .Values.outgoing_relay.pass }}"
- name: MAILDEV_OUTGOING_SECURE
value: "{{ .Values.outgoing_relay.secure }}"
value: "{{ .Values.outgoingRelay.pass }}"
{{- end }}
{{- if .Values.outgoingRelay.autoRelay.enabled }}
- name: MAILDEV_AUTO_RELAY_RULES
value: /etc/maildev/auto-relay-rules.json
{{- if .Values.outgoingRelay.autoRelay.receiver }}
- name: MAILDEV_AUTO_RELAY
value: "{{ .Values.outgoingRelay.autoRelay.receiver }}"
{{- end }}
{{- end }}
{{- if .Values.incoming }}
- name: MAILDEV_INCOMING_USER
value: "{{ .Values.incoming.user }}"
Expand All @@ -89,17 +111,15 @@ spec:
port: {{ .Values.ports.web }}
resources:
{{- toYaml .Values.resources | nindent 12 }}
{{- if .Values.outgoingRelay.autoRelay.enabled }}
volumeMounts:
- name: auto-relay-rules
mountPath: /etc/maildev
subPath: auto-relay-rules.json
volumes:
- name: auto-relay-rules
configMap:
name: maildev-relay-rules
items:
- key: auto-relay-rules.json
path: auto-relay-rules.json
{{- end }}
{{- with .Values.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
Expand Down
60 changes: 33 additions & 27 deletions charts/maildev/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,48 +4,54 @@ image:
repository: maildev/maildev
pullPolicy: IfNotPresent
# Overrides the image tag whose default is the chart appVersion.
tag: 1.1.0

outgoing_relay:
# MAILDEV_OUTGOING_HOST
host: smtp.gmail.com
# MAILDEV_OUTGOING_PORT
port: 465
# MAILDEV_OUTGOING_USER
user: 'XXX'
# MAILDEV_OUTGOING_PASS
pass: 'YYY'
# MAILDEV_OUTGOING_SECURE
secure: true

incoming:
# MAILDEV_INCOMING_USER
# user:
# MAILDEV_INCOMING_PASS
# pass:
tag: 2.0.0-beta3

verbose: false

outgoingRelay:
# # MAILDEV_OUTGOING_HOST
# host: smtp.gmail.com
# # MAILDEV_OUTGOING_PORT
# port: 465
# # MAILDEV_OUTGOING_USER
# user: 'XXX'
# # MAILDEV_OUTGOING_PASS
# pass: 'YYY'
# secure: false
autoRelay:
enabled: false
# MAILDEV_AUTO_RELAY
# receiver: test
rules:
- allow: '*'

incoming: {}
# # MAILDEV_INCOMING_USER
# user:
# # MAILDEV_INCOMING_PASS
# pass:

ports:
# MAILDEV_SMTP_PORT
smtp: 1025
# MAILDEV_WEB_PORT
web: 1080

# MAILDEV_HTTPS
## MAILDEV_HTTPS
https:
enabled: false
# MAILDEV_HTTPS_KEY
# # MAILDEV_HTTPS_KEY
# key:
# MAILDEV_HTTPS_KEY
# # MAILDEV_HTTPS_KEY
# cert:

# Web interface
web:
# MAILDEV_DISABLE_WEB
disable: false
# MAILDEV_WEB_USER
user: admin
# MAILDEV_WEB_PASS
pass: admin
# # MAILDEV_WEB_USER
# user: admin
# # MAILDEV_WEB_PASS
# pass: admin

imagePullSecrets: []
nameOverride: ""
Expand Down