From 6d5e3d514ada67acb93f60a149962558ebf6cba0 Mon Sep 17 00:00:00 2001 From: Astra Logical Date: Thu, 30 Jul 2026 18:56:29 -0400 Subject: [PATCH] Mautrix-discord bridge --- data-restorer.yaml | 3 +- keel/keel.yaml | 2 + services/matrix/matrix-synapse.yaml | 3 + .../mautrix-discord-deployment.yaml | 66 +++++++++++++++++++ .../mautrix-discord-external-secrets.yaml | 25 +++++++ .../mautrix-discord/mautrix-discord-pvcs.yaml | 28 ++++++++ .../mautrix-discord-service.yaml | 25 +++++++ .../nest-matrix-bot-deployment.yaml | 7 +- services/nextcloud/nextcloud-deployment.yaml | 4 ++ 9 files changed, 155 insertions(+), 8 deletions(-) create mode 100644 services/mautrix-discord/mautrix-discord-deployment.yaml create mode 100644 services/mautrix-discord/mautrix-discord-external-secrets.yaml create mode 100644 services/mautrix-discord/mautrix-discord-pvcs.yaml create mode 100644 services/mautrix-discord/mautrix-discord-service.yaml diff --git a/data-restorer.yaml b/data-restorer.yaml index b3afe8c..f91141a 100644 --- a/data-restorer.yaml +++ b/data-restorer.yaml @@ -2,7 +2,6 @@ apiVersion: v1 kind: Pod metadata: name: data-restorer - namespace: matrix spec: containers: - name: alpine @@ -14,4 +13,4 @@ spec: volumes: - name: target-volume persistentVolumeClaim: - claimName: postgres-data + claimName: mautrix-discord-data diff --git a/keel/keel.yaml b/keel/keel.yaml index e8c5cd0..d85a1aa 100644 --- a/keel/keel.yaml +++ b/keel/keel.yaml @@ -55,6 +55,8 @@ spec: labels: app: keel spec: + nodeSelector: + kubernetes.io/arch: amd64 # Official image does not have arm support serviceAccountName: keel containers: - name: keel diff --git a/services/matrix/matrix-synapse.yaml b/services/matrix/matrix-synapse.yaml index ed1ec8c..f746537 100644 --- a/services/matrix/matrix-synapse.yaml +++ b/services/matrix/matrix-synapse.yaml @@ -11,6 +11,9 @@ data: media_store_path: "/data/media_store" uploads_path: "/data/uploads" + app_service_config_files: + - /data/discord-registration.yaml + serve_server_wellknown: true serve_client_wellknown: true diff --git a/services/mautrix-discord/mautrix-discord-deployment.yaml b/services/mautrix-discord/mautrix-discord-deployment.yaml new file mode 100644 index 0000000..8004362 --- /dev/null +++ b/services/mautrix-discord/mautrix-discord-deployment.yaml @@ -0,0 +1,66 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: mautrix-discord + labels: + app.kubernetes.io/name: mautrix-discord + annotations: + keel.sh/policy: "all" + keel.sh/match-tag: "true" + keel.sh/schedule: "0 3 * * *" +spec: + replicas: 1 + strategy: + type: Recreate + selector: + matchLabels: + app.kubernetes.io/name: mautrix-discord + template: + metadata: + labels: + app.kubernetes.io/name: mautrix-discord + spec: + containers: + - name: mautrix-discord + image: dock.mau.dev/mautrix/discord:latest + ports: + - containerPort: 29334 + name: appservice + volumeMounts: + - name: data + mountPath: /data + volumes: + - name: data + persistentVolumeClaim: + claimName: mautrix-discord-data +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: mautrix-discord-postgres +spec: + replicas: 1 + selector: + matchLabels: + app: mautrix-discord-postgres + template: + metadata: + labels: + app: mautrix-discord-postgres + spec: + containers: + - name: postgres + image: postgres:16-alpine + ports: + - containerPort: 5432 + envFrom: + - secretRef: + name: mautrix-discord-secret + volumeMounts: + - name: postgres-storage + mountPath: /var/lib/postgresql/data + subPath: mautrix-discord-data + volumes: + - name: postgres-storage + persistentVolumeClaim: + claimName: mautrix-discord-postgres-pvc diff --git a/services/mautrix-discord/mautrix-discord-external-secrets.yaml b/services/mautrix-discord/mautrix-discord-external-secrets.yaml new file mode 100644 index 0000000..600a182 --- /dev/null +++ b/services/mautrix-discord/mautrix-discord-external-secrets.yaml @@ -0,0 +1,25 @@ +apiVersion: external-secrets.io/v1 +kind: ExternalSecret +metadata: + name: mautrix-discord-secret +spec: + refreshInterval: "1h" + secretStoreRef: + name: vault-external-secrets-store + kind: ClusterSecretStore + target: + name: mautrix-discord-secret + creationPolicy: Owner + data: + - secretKey: POSTGRES_DB + remoteRef: + key: mautrix-discord + property: postgres-db + - secretKey: POSTGRES_USER + remoteRef: + key: mautrix-discord + property: postgres-user + - secretKey: POSTGRES_PASSWORD + remoteRef: + key: mautrix-discord + property: postgres-pass diff --git a/services/mautrix-discord/mautrix-discord-pvcs.yaml b/services/mautrix-discord/mautrix-discord-pvcs.yaml new file mode 100644 index 0000000..705181a --- /dev/null +++ b/services/mautrix-discord/mautrix-discord-pvcs.yaml @@ -0,0 +1,28 @@ +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: mautrix-discord-data + labels: + recurring-job.longhorn.io/source: "enabled" + recurring-job-group.longhorn.io/app-config-group: "enabled" +spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 2Gi +--- +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: mautrix-discord-postgres-pvc + labels: + recurring-job.longhorn.io/source: "enabled" + recurring-job-group.longhorn.io/app-config-group: "enabled" +spec: + storageClassName: longhorn + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 5Gi diff --git a/services/mautrix-discord/mautrix-discord-service.yaml b/services/mautrix-discord/mautrix-discord-service.yaml new file mode 100644 index 0000000..675953b --- /dev/null +++ b/services/mautrix-discord/mautrix-discord-service.yaml @@ -0,0 +1,25 @@ +apiVersion: v1 +kind: Service +metadata: + name: mautrix-discord + labels: + app.kubernetes.io/name: mautrix-discord +spec: + type: ClusterIP + ports: + - port: 29334 + targetPort: 29334 + name: appservice + selector: + app.kubernetes.io/name: mautrix-discord +--- +apiVersion: v1 +kind: Service +metadata: + name: mautrix-discord-postgres +spec: + ports: + - port: 5432 + targetPort: 5432 + selector: + app: mautrix-discord-postgres diff --git a/services/nest-matrix-bot/nest-matrix-bot-deployment.yaml b/services/nest-matrix-bot/nest-matrix-bot-deployment.yaml index 09ebb61..65fcf43 100644 --- a/services/nest-matrix-bot/nest-matrix-bot-deployment.yaml +++ b/services/nest-matrix-bot/nest-matrix-bot-deployment.yaml @@ -28,7 +28,7 @@ spec: fsGroup: 10001 containers: - name: bot - image: weaver.mynest.love/nest/nest-matrix-bot:latest + image: weaver.mynest.love/the-nest/nest-matrix-bot:latest imagePullPolicy: Always securityContext: allowPrivilegeEscalation: false @@ -67,11 +67,6 @@ spec: secretKeyRef: name: matrix-bot-credentials key: client-secret - - name: MATRIX_RECOVERY_KEY - valueFrom: - secretKeyRef: - name: matrix-bot-credentials - key: recovery-key volumeMounts: - mountPath: /app/store name: bot-store diff --git a/services/nextcloud/nextcloud-deployment.yaml b/services/nextcloud/nextcloud-deployment.yaml index d55a19b..2ad6447 100644 --- a/services/nextcloud/nextcloud-deployment.yaml +++ b/services/nextcloud/nextcloud-deployment.yaml @@ -3,6 +3,10 @@ kind: Deployment metadata: name: nextcloud-app namespace: nextcloud + annotations: + keel.sh/policy: "all" + keel.sh/match-tag: "true" + keel.sh/schedule: "0 3 * * *" spec: replicas: 1 selector: