apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
  name: matrix-roglog
  namespace: argocd
  finalizers:
    - resources-finalizer.argocd.argoproj.io
spec:
  project: default
  sources:
    - repoURL: http://gitea.gitea.svc.cluster.local:3000/admin/main.git
      targetRevision: master
      path: manifests/matrix-roglog
      directory:
        recurse: true
        include: "*.yaml"
    - repoURL: ghcr.io
      chart: element-hq/ess-helm/matrix-stack
      targetRevision: 26.6.1
      helm:
        values: |
          serverName: roglog.space

          certManager:
            clusterIssuer: letsencrypt-production

          ingress:
            className: traefik

          postgres:
            enabled: false

          synapse:
            postgres:
              host: shared-pg-rw.cnpg.svc.cluster.local
              database: synapse_roglog
              user: synapse_roglog
              password:
                secret: pg-creds
                secretKey: synapse
            media:
              storage:
                size: 10Gi
            ingress:
              host: matrix.roglog.space

          matrixAuthenticationService:
            postgres:
              host: shared-pg-rw.cnpg.svc.cluster.local
              database: mas_roglog
              user: mas_roglog
              password:
                secret: pg-creds
                secretKey: mas
            ingress:
              host: auth.roglog.space
            additional:
              0-registration:
                config: |
                  account:
                    password_registration_enabled: true
                    password_registration_email_required: false
                    password_recovery_enabled: false
                    registration_token_required: false

          elementWeb:
            ingress:
              host: chat.roglog.space

          elementAdmin:
            ingress:
              host: admin.roglog.space

          matrixRTC:
            ingress:
              host: rtc.roglog.space
            sfu:
              manualIP: "81.26.181.240"
              useStunToDiscoverPublicIP: false
              exposedServices:
                rtcTcp:
                  port: 30005
                  portType: NodePort
                  nodePort: ""
                rtcMuxedUdp:
                  port: 30004
                  portType: NodePort
                  nodePort: ""

          hookshot:
            enabled: true
  destination:
    server: https://kubernetes.default.svc
    namespace: matrix-roglog
  syncPolicy:
    syncOptions:
      - CreateNamespace=true
