Helm Chart Release / release-chart (push) Successful in 6s
helmchart/secret-manager が各ネームスペースへ配布する cred-* Secret を WordPress 側から参照できるようにする(phpfpm と同一方針)。 - extraEnvFrom / extraEnv: 既存 Secret/ConfigMap を wordpress コンテナへ env 注入 - smtp.auth.existingSecret / existingSecretKey: パスワードファイルだけ既存 Secret から取得 - smtp.existingMsmtprcSecret / existingMsmtprcSecretKey: 完成済み msmtprc を そのままマウント(指定時は configmap-smtp を生成せず host/port/auth.* は無視) 既定値は全て空のため既存挙動は不変。手動リリース 7.1.0-b。
49 lines
1.2 KiB
YAML
49 lines
1.2 KiB
YAML
{{- if and .Values.smtp.enabled (not .Values.smtp.existingMsmtprcSecret) }}
|
|
apiVersion: v1
|
|
kind: ConfigMap
|
|
metadata:
|
|
name: {{ include "wordpress-nginx.fullname" . }}-smtp-config
|
|
labels:
|
|
{{- include "wordpress-nginx.labels" . | nindent 4 }}
|
|
data:
|
|
msmtprc: |
|
|
# msmtp設定ファイル
|
|
# PHPのsendmail_pathから呼び出される(wp_mail()経由の送信もこれを使用)
|
|
|
|
defaults
|
|
{{- if .Values.smtp.tls.verify }}
|
|
tls on
|
|
tls_trust_file /etc/ssl/certs/ca-certificates.crt
|
|
{{- else }}
|
|
tls off
|
|
{{- end }}
|
|
{{- if .Values.smtp.tls.allowSelfSigned }}
|
|
tls_certcheck off
|
|
{{- else }}
|
|
tls_certcheck on
|
|
{{- end }}
|
|
|
|
account default
|
|
host {{ .Values.smtp.host }}
|
|
port {{ .Values.smtp.port }}
|
|
{{- if eq .Values.smtp.protocol "starttls" }}
|
|
protocol smtp
|
|
{{- else if eq .Values.smtp.protocol "tls" }}
|
|
protocol smtps
|
|
{{- else if eq (int .Values.smtp.port) 465 }}
|
|
protocol smtps
|
|
{{- else }}
|
|
protocol smtp
|
|
{{- end }}
|
|
|
|
{{- if .Values.smtp.auth.enabled }}
|
|
auth on
|
|
user {{ .Values.smtp.auth.username }}
|
|
passwordeval "cat /etc/smtp-secrets/password"
|
|
{{- else }}
|
|
auth off
|
|
{{- end }}
|
|
|
|
from {{ .Values.smtp.from }}
|
|
{{- end }}
|