mirror of
https://github.com/rubenhensen/k8scd.git
synced 2026-09-18 18:42:56 +02:00
stalwart: Add x-forwarded configmap
This commit is contained in:
@@ -0,0 +1,94 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: ConfigMap
|
||||||
|
metadata:
|
||||||
|
name: {{ include "stalwart.fullname" . }}-config
|
||||||
|
labels:
|
||||||
|
{{- include "stalwart.labels" . | nindent 4 }}
|
||||||
|
data:
|
||||||
|
config.toml: |
|
||||||
|
[server]
|
||||||
|
hostname = "{{ .Values.config.hostname }}"
|
||||||
|
max-connections = 8192
|
||||||
|
allowed-ip = {{ .Values.config.allowedIPs | toJson }}
|
||||||
|
|
||||||
|
[server.socket]
|
||||||
|
backlog = 1024
|
||||||
|
nodelay = true
|
||||||
|
reuse-addr = true
|
||||||
|
reuse-port = true
|
||||||
|
|
||||||
|
[server.listener.http]
|
||||||
|
bind = "[::]:8080"
|
||||||
|
protocol = "http"
|
||||||
|
|
||||||
|
[server.listener.https]
|
||||||
|
bind = "[::]:443"
|
||||||
|
protocol = "http"
|
||||||
|
tls.implicit = true
|
||||||
|
|
||||||
|
[server.listener.smtp]
|
||||||
|
bind = "[::]:25"
|
||||||
|
protocol = "smtp"
|
||||||
|
|
||||||
|
[server.listener.submission]
|
||||||
|
bind = "[::]:587"
|
||||||
|
protocol = "smtp"
|
||||||
|
|
||||||
|
[server.listener.submissions]
|
||||||
|
bind = "[::]:465"
|
||||||
|
protocol = "smtp"
|
||||||
|
tls.implicit = true
|
||||||
|
|
||||||
|
[server.listener.imap]
|
||||||
|
bind = "[::]:143"
|
||||||
|
protocol = "imap"
|
||||||
|
|
||||||
|
[server.listener.imaptls]
|
||||||
|
bind = "[::]:993"
|
||||||
|
protocol = "imap"
|
||||||
|
tls.implicit = true
|
||||||
|
|
||||||
|
[server.listener.pop3]
|
||||||
|
bind = "[::]:110"
|
||||||
|
protocol = "pop3"
|
||||||
|
|
||||||
|
[server.listener.pop3s]
|
||||||
|
bind = "[::]:995"
|
||||||
|
protocol = "pop3"
|
||||||
|
tls.implicit = true
|
||||||
|
|
||||||
|
[server.listener.sieve]
|
||||||
|
bind = "[::]:4190"
|
||||||
|
protocol = "managesieve"
|
||||||
|
|
||||||
|
[http]
|
||||||
|
use-x-forwarded = {{ .Values.config.useXForwarded }}
|
||||||
|
|
||||||
|
[storage]
|
||||||
|
data = "rocksdb"
|
||||||
|
blob = "rocksdb"
|
||||||
|
fts = "rocksdb"
|
||||||
|
lookup = "rocksdb"
|
||||||
|
directory = "internal"
|
||||||
|
|
||||||
|
[store.rocksdb]
|
||||||
|
type = "rocksdb"
|
||||||
|
path = "/opt/stalwart/data"
|
||||||
|
compression = "lz4"
|
||||||
|
|
||||||
|
[directory.internal]
|
||||||
|
type = "internal"
|
||||||
|
store = "rocksdb"
|
||||||
|
|
||||||
|
[authentication.fallback-admin]
|
||||||
|
user = "admin"
|
||||||
|
secret = "{{ .Values.config.adminPasswordHash }}"
|
||||||
|
|
||||||
|
[tracer.log]
|
||||||
|
type = "log"
|
||||||
|
enable = true
|
||||||
|
level = "info"
|
||||||
|
path = "/opt/stalwart/logs"
|
||||||
|
prefix = "stalwart.log"
|
||||||
|
rotate = "daily"
|
||||||
|
ansi = false
|
||||||
@@ -11,6 +11,8 @@ spec:
|
|||||||
{{- include "stalwart.selectorLabels" . | nindent 6 }}
|
{{- include "stalwart.selectorLabels" . | nindent 6 }}
|
||||||
template:
|
template:
|
||||||
metadata:
|
metadata:
|
||||||
|
annotations:
|
||||||
|
checksum/config: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }}
|
||||||
labels:
|
labels:
|
||||||
{{- include "stalwart.selectorLabels" . | nindent 8 }}
|
{{- include "stalwart.selectorLabels" . | nindent 8 }}
|
||||||
spec:
|
spec:
|
||||||
@@ -50,7 +52,13 @@ spec:
|
|||||||
volumeMounts:
|
volumeMounts:
|
||||||
- name: stalwart-volume
|
- name: stalwart-volume
|
||||||
mountPath: {{ .Values.persistence.mountPath }}
|
mountPath: {{ .Values.persistence.mountPath }}
|
||||||
|
- name: config
|
||||||
|
mountPath: /opt/stalwart/etc/config.toml
|
||||||
|
subPath: config.toml
|
||||||
volumes:
|
volumes:
|
||||||
- name: stalwart-volume
|
- name: stalwart-volume
|
||||||
persistentVolumeClaim:
|
persistentVolumeClaim:
|
||||||
claimName: {{ include "stalwart.fullname" . }}
|
claimName: {{ include "stalwart.fullname" . }}
|
||||||
|
- name: config
|
||||||
|
configMap:
|
||||||
|
name: {{ include "stalwart.fullname" . }}-config
|
||||||
|
|||||||
@@ -23,3 +23,15 @@ persistence:
|
|||||||
mountPath: /opt/stalwart
|
mountPath: /opt/stalwart
|
||||||
|
|
||||||
replicaCount: 1
|
replicaCount: 1
|
||||||
|
|
||||||
|
config:
|
||||||
|
hostname: "mail.hensen.io"
|
||||||
|
# Whitelist cluster IPs to prevent ingress from being banned
|
||||||
|
allowedIPs:
|
||||||
|
- "127.0.0.1"
|
||||||
|
- "::1"
|
||||||
|
- "10.0.0.0/8"
|
||||||
|
# Trust X-Forwarded-For header from reverse proxy for real client IP
|
||||||
|
useXForwarded: true
|
||||||
|
# Admin password hash (generate with: echo -n 'password' | openssl passwd -6 -stdin)
|
||||||
|
adminPasswordHash: "$6$nUKyIdu3tyREoEza$lfXMSXAmDzokPlsXasZw6gvSKkLE/2xxC4Jp5Wq2cFA0wi1udS.lt5Kvp2EuUA7ZWNbkP7foG4BseXkIR24e40"
|
||||||
|
|||||||
Reference in New Issue
Block a user