{{- /* ON BY DEFAULT (ingress.enabled: true): a webmail client nobody can reach is not a webmail client. AT THE ROOT OF THE HOST, AND THERE IS NO VALUE TO PUT IT UNDER A PATH. NEXT_PUBLIC_BASE_PATH is compiled into the bundle - upstream: "These are compiled into the bundle and cannot be changed at runtime" - so a sub-path deployment needs a rebuilt image, which is outside what this repository does (same limit as garage #81 and keycloak #83). A rewrite-target annotation is not a way around it either: the bundle's own asset and API URLs are built for the root, so stripping a prefix at the proxy produces a page that loads and then fetches everything from the wrong place. The rule below is therefore "/" with pathType Prefix, deliberately and permanently. GUIDELINE 1, CHECKED IN BOTH DIRECTIONS (README, "Values that must not lie"), AND FOR THIS CHART THE GATE FREES BOTH VALUES. Checked rather than assumed: nothing outside this template FUNCTIONALLY reads ingress.domain. Bulwark derives its own public URL from the request origin and takes no base-URL environment variable - there is no KC_HOSTNAME equivalent here - so a release with ingress.enabled: false is complete without a domain. That is the calibre-web-automated case rather than the matrix-synapse one. The one other READER is NOTES.txt, which prints the access URL and the OIDC redirect URI. That read is deliberately NOT guarded with a required(): `helm template` does not render NOTES.txt, so a guard there would fire for the first time during a real `helm install` and never in lint, in the render test or in CI. The bulwark.publicUrl helper renders a visible placeholder instead, and the enforcement lives here - in the template that is reached by every render with the Ingress on, which is the default. */ -}} {{- if .Values.ingress.enabled }} apiVersion: networking.k8s.io/v1 kind: Ingress metadata: name: {{ .Release.Name }}-{{ .Chart.Name }}-ingress labels: app: {{ .Release.Name }}-{{ .Chart.Name }}-sfs annotations: cert-manager.io/cluster-issuer: {{ required "A Cluster-Issuer must be provided (ingress.clusterIssuer)" .Values.ingress.clusterIssuer }} {{- /* Merged, not replaced. The one annotation worth adding here for this application is nginx.ingress.kubernetes.io/proxy-body-size: attachment uploads and the Files view go through this Ingress, and nginx's default of 1m rejects anything larger with a 413 that reads like an application fault. The chart does not set it because the right number is the mail server's limit, which this chart does not know. */}} {{- with .Values.ingress.annotations }} {{- toYaml . | nindent 4 }} {{- end }} spec: ingressClassName: {{ .Values.ingress.className }} rules: - host: {{ required "A Domain/Host must be provided (ingress.domain)" .Values.ingress.domain }} http: paths: - backend: service: name: {{ .Release.Name }}-{{ .Chart.Name }}-service port: # BY NAME, so bulwark.port and this file cannot drift apart. name: http path: / pathType: Prefix tls: - hosts: - {{ required "A Domain/Host must be provided (ingress.domain)" .Values.ingress.domain }} secretName: tls-{{ .Release.Name }}-{{ .Chart.Name }}-ingress {{- end }}