Skip to content

Commit

Permalink
fix: add compatibility with latest Mailu master branch (#44)
Browse files Browse the repository at this point in the history
  • Loading branch information
fastlorenzo authored Dec 8, 2022
2 parents 345f84c + 86d3cd7 commit 25eb5e5
Show file tree
Hide file tree
Showing 13 changed files with 245 additions and 230 deletions.
2 changes: 1 addition & 1 deletion ct.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
helm-extra-args: --timeout 720s
helm-extra-args: --timeout 360s
chart-dirs:
- .
chart-repos:
Expand Down
1 change: 1 addition & 0 deletions mailu/MIGRATION_GUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,3 +61,4 @@ You will also need to manually delete the existing `Ingress`, as well as all exi
| `certmanager.*` | `-` | Removed. Configure using annotations on `ingress.annotations` to generate a valid certificate instead. |
| `ingress.tlsFlavor` | `ingress.tlsFlavorOverride` | |
| `ingress.externalIngress` | `ingress.enabled` | |
| `roundcube.*` | `webmail.*` | `roundcube` has been renamed to `webmail` |
109 changes: 56 additions & 53 deletions mailu/README.md

Large diffs are not rendered by default.

58 changes: 30 additions & 28 deletions mailu/ci/helm-lint-values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,13 @@ domain: example.com
initialAccount:
enabled: true
username: mailadmin
domain: mydomain.com
domain: example.com
password: chang3m3!

secretKey: chang3m3!

subnet: 10.0.0.0/8

persistence:
single_pvc: false

Expand Down Expand Up @@ -38,9 +40,9 @@ ingress:
auth.cluster.arpa/enabled: "false"

front:
logLevel: WARNING
# image:
# tag: master
logLevel: INFO
image:
tag: master
resources:
requests:
memory: 100Mi
Expand All @@ -50,9 +52,9 @@ front:
cpu: 200m

admin:
logLevel: WARNING
# image:
# tag: master
logLevel: DEBUG
image:
tag: master
resources:
requests:
memory: 500Mi
Expand All @@ -62,9 +64,9 @@ admin:
cpu: 1

postfix:
logLevel: WARNING
# image:
# tag: master
logLevel: INFO
image:
tag: master
resources:
requests:
memory: 2Gi
Expand All @@ -74,9 +76,9 @@ postfix:
cpu: 1

dovecot:
logLevel: WARNING
# image:
# tag: master
logLevel: INFO
image:
tag: master
resources:
requests:
memory: 500Mi
Expand All @@ -87,8 +89,8 @@ dovecot:

rspamd:
logLevel: INFO
# image:
# tag: master
image:
tag: master
resources:
requests:
memory: 100Mi
Expand All @@ -98,9 +100,9 @@ rspamd:
cpu: 1

clamav:
logLevel: WARNING
# image:
# tag: master
logLevel: INFO
image:
tag: master
resources:
requests:
memory: 1Gi
Expand All @@ -109,10 +111,10 @@ clamav:
memory: 2Gi
cpu: 1

roundcube:
logLevel: WARNING
# image:
# tag: master
webmail:
logLevel: INFO
image:
tag: master
resources:
requests:
memory: 100Mi
Expand All @@ -122,14 +124,14 @@ roundcube:
cpu: 1

webdav:
logLevel: WARNING
# image:
# tag: master
logLevel: INFO
image:
tag: master

fetchmail:
logLevel: WARNING
# image:
# tag: master
logLevel: INFO
image:
tag: master

redis:
master:
Expand Down
4 changes: 2 additions & 2 deletions mailu/templates/_claims.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
{{- end -}}

{{/* Roundcube pod persistent volume claim name */}}
{{ define "mailu.roundcube.claimName" }}
{{- .Values.persistence.single_pvc | ternary (include "mailu.claimName" .) .Values.roundcube.persistence.claimNameOverride | default (printf "%s-roundcube" (include "mailu.fullname" .)) -}}
{{ define "mailu.webmail.claimName" }}
{{- .Values.persistence.single_pvc | ternary (include "mailu.claimName" .) .Values.webmail.persistence.claimNameOverride | default (printf "%s-webmail" (include "mailu.fullname" .)) -}}
{{- end -}}

{{/* Fetchmail pod persistent volume claim name */}}
Expand Down
14 changes: 7 additions & 7 deletions mailu/templates/_services.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Mailu services:
- front
- postfix
- redis
- roundcube
- webmail
- rspamd
- webdav
Expand Down Expand Up @@ -119,13 +119,13 @@ Service fqdn (within cluster) can be retrieved with `mailu.SERVICE.serviceFqdn`
{{- end -}}


{{/* Returns roundcube internal service name. */}}
{{- define "mailu.roundcube.serviceName" -}}
{{- printf "%s-roundcube" (include "mailu.fullname" .) -}}
{{/* Returns webmail internal service name. */}}
{{- define "mailu.webmail.serviceName" -}}
{{- printf "%s-webmail" (include "mailu.fullname" .) -}}
{{- end -}}
{{/* Returns roundcube internal service fqdn. */}}
{{- define "mailu.roundcube.serviceFqdn" -}}
{{- printf "%s.%s.svc.%s" (include "mailu.roundcube.serviceName" . ) (include "common.names.namespace" . ) (include "mailu.clusterDomain" . ) -}}
{{/* Returns webmail internal service fqdn. */}}
{{- define "mailu.webmail.serviceFqdn" -}}
{{- printf "%s.%s.svc.%s" (include "mailu.webmail.serviceName" . ) (include "common.names.namespace" . ) (include "mailu.clusterDomain" . ) -}}
{{- end -}}

{{/* Returns rspamd internal service name. */}}
Expand Down
12 changes: 8 additions & 4 deletions mailu/templates/admin/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -97,13 +97,13 @@ spec:
value: {{ include "mailu.postfix.serviceFqdn" . }}
- name: REDIS_ADDRESS
value: {{ include "mailu.redis.serviceFqdn" . }}
{{- if .Values.roundcube.enabled }}
{{- if .Values.webmail.enabled }}
- name: WEBMAIL
value: roundcube
value: {{ .Values.webmail.type | quote }}
- name: WEB_WEBMAIL
value: {{ required "roundcube.uri" .Values.roundcube.uri }}
value: {{ required "webmail.uri" .Values.webmail.uri }}
- name: WEBMAIL_ADDRESS
value: {{ include "mailu.roundcube.serviceFqdn" . }}
value: {{ include "mailu.webmail.serviceFqdn" . }}
{{- else }}
- name: WEBMAIL
value: none
Expand Down Expand Up @@ -218,6 +218,10 @@ spec:
path: /sso/login
port: http
{{- end }}
securityContext:
capabilities:
add:
- NET_BIND_SERVICE
volumes:
- name: data
persistentVolumeClaim:
Expand Down
10 changes: 5 additions & 5 deletions mailu/templates/front/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -98,15 +98,15 @@ spec:
- name: REAL_IP_FROM
value: {{ default "0.0.0.0/0" .Values.ingress.realIpFrom }}
{{- end }}
{{- if .Values.roundcube.enabled }}
{{- if .Values.webmail.enabled }}
- name: WEBMAIL
value: roundcube
value: {{ .Values.webmail.type | quote }}
- name: WEBMAIL_ADDRESS
value: {{ include "mailu.roundcube.serviceFqdn" . }}
value: {{ include "mailu.webmail.serviceFqdn" . }}
- name: WEB_WEBMAIL
value: {{ required "roundcube.uri" .Values.roundcube.uri }}
value: {{ required "webmail.uri" .Values.webmail.uri }}
- name: WEBROOT_REDIRECT
value: {{ required "roundcube.uri" .Values.roundcube.uri }}
value: {{ required "webmail.uri" .Values.webmail.uri }}
{{- else }}
- name: WEBMAIL
value: none
Expand Down
Loading

0 comments on commit 25eb5e5

Please sign in to comment.