feat(matrix-synapse): added delegation

This commit is contained in:
jklein committed 2026-03-29 18:13:35 +02:00
1 parent 9bf90be897
commit 1aae181175
6 files changed
+111 -1

No files matched your search

@@ -0,0 +1,30 @@
{{- if .Values.matrix.delegation.enabled }}
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ .Release.Name }}-{{ .Chart.Name }}-delegation-nginx-config
data:
nginx.conf: |
worker_processes 1;
events {
worker_connections 1024;
}
http {
server {
listen 80;
location /.well-known/matrix/server {
return 200 '{"m.server": "{{ .Values.ingress.domain }}:443"}';
add_header Content-Type application/json;
}
location /.well-known/matrix/client {
return 200 '{"m.homeserver": {"base_url": "https://{{ .Values.ingress.domain }}"}}';
add_header Content-Type application/json;
add_header "Access-Control-Allow-Origin" *;
}
}
}
{{- end }}
@@ -0,0 +1,45 @@
{{- if .Values.matrix.delegation.enabled }}
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ .Release.Name }}-{{ .Chart.Name }}-delegation-nginx
labels:
app: {{ .Release.Name }}-{{ .Chart.Name }}-delegation-nginx
spec:
replicas: 1
selector:
matchLabels:
app: {{ .Release.Name }}-{{ .Chart.Name }}-delegation-nginx
template:
metadata:
labels:
app: {{ .Release.Name }}-{{ .Chart.Name }}-delegation-nginx
spec:
automountServiceAccountToken: false
containers:
- name: {{ .Release.Name }}-{{ .Chart.Name }}-delegation-nginx
image: "nginx:1.28.3"
ports:
- containerPort: 80
name: http
volumeMounts:
- name: nginx-config
mountPath: /etc/nginx/nginx.conf
subPath: nginx.conf
resources:
limits:
memory: "128Mi"
cpu: "250m"
ephemeral-storage: "100Mi"
requests:
memory: "64Mi"
cpu: "125m"
ephemeral-storage: "50Mi"
volumes:
- name: nginx-config
configMap:
name: {{ .Release.Name }}-{{ .Chart.Name }}-delegation-nginx-config
items:
- key: nginx.conf
path: nginx.conf
{{- end }}
@@ -0,0 +1,15 @@
{{- if .Values.matrix.delegation.enabled }}
apiVersion: v1
kind: Service
metadata:
name: {{ .Release.Name }}-{{ .Chart.Name }}-delegation-service
spec:
selector:
app: matrix-federation-nginx
ports:
- protocol: TCP
port: 80
targetPort: http
name: http
type: ClusterIP
{{- end }}
@@ -17,7 +17,24 @@ spec:
name: http
path: /
pathType: Prefix
{{- if .Values.matrix.delegation.enabled }}
- host: {{ required "If delegation is enabled you must provide a serverUrl" .Values.matrix.delegation.serverUrl }}
http:
paths:
- backend:
service:
name: {{ .Release.Name }}-{{ .Chart.Name }}-delegation-service
port:
name: http
path: /.well-known/matrix
pathType: Prefix
{{- end }}
tls:
{{- if .Values.matrix.delegation.enabled }}
- hosts:
- {{ required "A Domain/Host must be provided" .Values.matrix.delegation.serverUrl }}
secretName: tls-{{ .Release.Name }}-{{ .Chart.Name }}-delegation
{{- end }}
- hosts:
- {{ required "A Domain/Host must be provided" .Values.ingress.domain }}
secretName: tls-{{ .Release.Name }}-{{ .Chart.Name }}-ingress