Browse Source

Fix issue with mailhosts config

master
Fábio Kaiser Rauber 3 years ago
parent
commit
38861aa714
  1. 72
      charts/mailproxy/v0.1.0/templates/nginx-configmap.yaml
  2. 28
      charts/mailproxy/v0.1.0/templates/nginx-deployment.yaml
  3. 44
      charts/mailproxy/v0.1.0/templates/nginx-mailhosts-conf.yaml

72
charts/mailproxy/v0.1.0/templates/nginx-configmap.yaml

@ -1,10 +1,45 @@
apiVersion: v1 apiVersion: v1
kind: ConfigMap kind: ConfigMap
metadata: metadata:
name: {{ include "mailproxy.fullname" . }}-nginxconf name: {{ include "mailproxy.fullname" . }}-nginx-conf
labels: labels:
{{- include "mailproxy.labels" . | nindent 4 }} {{- include "mailproxy.labels" . | nindent 4 }}
data: data:
nginx-conf: |-
user nginx;
worker_processes auto;
error_log /var/log/nginx/error.log notice;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
access_log /var/log/nginx/access.log main;
sendfile off;
#tcp_nopush on;
keepalive_timeout 65;
#gzip on;
include /etc/nginx/conf.d/*.conf;
}
mail {
include /etc/nginx/mailhosts/*.conf;
}
phpfpm-conf: |- phpfpm-conf: |-
upstream backend { upstream backend {
server {{ include "mailproxy.fullname" . }}-mailauth:9000; server {{ include "mailproxy.fullname" . }}-mailauth:9000;
@ -36,40 +71,5 @@ data:
include fastcgi_params; include fastcgi_params;
} }
} }
imap-conf: |-
server {
listen 993;
server_name localhost;
protocol imap;
auth_http localhost:8080/auth-mail.php;
ssl on;
proxy_pass_error_message on;
}
pop-conf: |-
server {
listen 995;
server_name localhost;
protocol pop3;
auth_http localhost:8080/auth-mail.php;
ssl on;
proxy_pass_error_message on;
}
smtp-conf: |-
server {
listen 587;
server_name localhost;
protocol smtp;
auth_http localhost:8080/auth-mail.php;
starttls only;
xclient on;
proxy_pass_error_message on;
}
ssl-conf: |-
ssl_certificate /etc/nginx/ssl/tls.crt;
ssl_certificate_key /etc/nginx/ssl/tls.key;
ssl_session_timeout 5m;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH;
ssl_prefer_server_ciphers on;

28
charts/mailproxy/v0.1.0/templates/nginx-deployment.yaml

@ -45,20 +45,17 @@ spec:
path: / path: /
port: http port: http
volumeMounts: volumeMounts:
- mountPath: /etc/nginx/nginx.conf
subPath: nginx-conf
name: nginx-conf
- mountPath: /etc/nginx/conf.d/phpfpm.conf - mountPath: /etc/nginx/conf.d/phpfpm.conf
subPath: phpfpm-conf subPath: phpfpm-conf
name: nginxconf name: nginx-conf
- mountPath: /etc/nginx/conf.d/imap.conf - mountPath: /etc/nginx/mailhosts
subPath: imap-conf name: mailhosts-conf
name: nginxconf readOnly: true
- mountPath: /etc/nginx/conf.d/pop.conf
subPath: pop-conf
name: nginxconf
- mountPath: /etc/nginx/conf.d/smtp.conf
subPath: smtp-conf
name: nginxconf
- mountPath: /etc/nginx/ssl - mountPath: /etc/nginx/ssl
name: {{ include "mailproxy.fullname" . }}-tls name: mailproxy-tls
readOnly: true readOnly: true
resources: resources:
{{- toYaml .Values.nginx.resources | nindent 12 }} {{- toYaml .Values.nginx.resources | nindent 12 }}
@ -75,9 +72,12 @@ spec:
{{- toYaml . | nindent 8 }} {{- toYaml . | nindent 8 }}
{{- end }} {{- end }}
volumes: volumes:
- name: nginxconf - name: nginx-conf
configMap:
name: {{ include "mailproxy.fullname" . }}-nginx-conf
- name: mailhosts-conf
configMap: configMap:
name: {{ include "mailproxy.fullname" . }}-nginxconf name: {{ include "mailproxy.fullname" . }}-mailhosts-conf
- name: {{ include "mailproxy.fullname" . }}-tls - name: mailproxy-tls
secret: secret:
secretName: {{ include "mailproxy.fullname" . }}-tls secretName: {{ include "mailproxy.fullname" . }}-tls

44
charts/mailproxy/v0.1.0/templates/nginx-mailhosts-conf.yaml

@ -0,0 +1,44 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ include "mailproxy.fullname" . }}-mailhosts-conf
labels:
{{- include "mailproxy.labels" . | nindent 4 }}
data:
imap.conf: |-
server {
listen 993;
server_name localhost;
protocol imap;
auth_http localhost:8080/auth-mail.php;
ssl on;
proxy_pass_error_message on;
}
pop.conf: |-
server {
listen 995;
server_name localhost;
protocol pop3;
auth_http localhost:8080/auth-mail.php;
ssl on;
proxy_pass_error_message on;
}
smtp.conf: |-
server {
listen 587;
server_name localhost;
protocol smtp;
auth_http localhost:8080/auth-mail.php;
starttls only;
xclient on;
proxy_pass_error_message on;
}
ssl.conf: |-
ssl_certificate /etc/nginx/ssl/tls.crt;
ssl_certificate_key /etc/nginx/ssl/tls.key;
ssl_session_timeout 5m;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH;
ssl_prefer_server_ciphers on;
Loading…
Cancel
Save