From dcfbb984f4e493321c70500b92e8465609d1690d Mon Sep 17 00:00:00 2001
From: Michael Jerger <michael.jerger@meissa-gmbh.de>
Date: Fri, 28 Feb 2025 19:13:20 +0100
Subject: [PATCH 1/4] expose via ingress

---
 src/main/cljc/dda/c4k_jitsi/core.cljc | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/main/cljc/dda/c4k_jitsi/core.cljc b/src/main/cljc/dda/c4k_jitsi/core.cljc
index 3202e6e..eabc78c 100644
--- a/src/main/cljc/dda/c4k_jitsi/core.cljc
+++ b/src/main/cljc/dda/c4k_jitsi/core.cljc
@@ -65,6 +65,11 @@
                                             :service-port 80
                                             :fqdns [(str "moderator-elector." (:fqdn resolved-config))]}
                                            resolved-config))
+           (ing/generate-ingress-and-cert (merge
+                                           {:service-name "coturn-turn-tcp"
+                                            :service-port 3478
+                                            :fqdns [(str "stun." (:fqdn resolved-config))]}
+                                           resolved-config))
            (when (:contains? resolved-config :mon-cfg)
              (mon/generate-config)))))))
 

From 19e1b136d97e4abe08cd9e3c890cc79180de2221 Mon Sep 17 00:00:00 2001
From: Michael Jerger <michael.jerger@meissa-gmbh.de>
Date: Fri, 28 Feb 2025 19:14:38 +0100
Subject: [PATCH 2/4] expose via ingress

---
 src/main/resources/jitsi/coturn-config-tcp-service.yaml | 1 -
 src/main/resources/jitsi/coturn-config-udp-service.yaml | 1 -
 src/test/cljc/dda/c4k_jitsi/core_test.cljc              | 2 +-
 3 files changed, 1 insertion(+), 3 deletions(-)

diff --git a/src/main/resources/jitsi/coturn-config-tcp-service.yaml b/src/main/resources/jitsi/coturn-config-tcp-service.yaml
index c255a57..f708df6 100644
--- a/src/main/resources/jitsi/coturn-config-tcp-service.yaml
+++ b/src/main/resources/jitsi/coturn-config-tcp-service.yaml
@@ -9,7 +9,6 @@ metadata:
     metallb.universe.tf/allow-shared-ip: "shared-ip-service-group"
     metallb.universe.tf/address-pool: public
 spec:
-  type: LoadBalancer
   ports:
     - name: turn-tcp
       port: 3478
diff --git a/src/main/resources/jitsi/coturn-config-udp-service.yaml b/src/main/resources/jitsi/coturn-config-udp-service.yaml
index f394094..155c03c 100644
--- a/src/main/resources/jitsi/coturn-config-udp-service.yaml
+++ b/src/main/resources/jitsi/coturn-config-udp-service.yaml
@@ -9,7 +9,6 @@ metadata:
     metallb.universe.tf/allow-shared-ip: "shared-ip-service-group"
     metallb.universe.tf/address-pool: public
 spec:
-  type: LoadBalancer
   ports:
     - name: turn-udp
       port: 3478
diff --git a/src/test/cljc/dda/c4k_jitsi/core_test.cljc b/src/test/cljc/dda/c4k_jitsi/core_test.cljc
index 2c9067a..5500786 100644
--- a/src/test/cljc/dda/c4k_jitsi/core_test.cljc
+++ b/src/test/cljc/dda/c4k_jitsi/core_test.cljc
@@ -17,7 +17,7 @@
   (is (s/valid? cut/auth? (yaml/load-as-edn "jitsi-test/valid-auth.yaml"))))
 
 (deftest test-whole-generation
-  (is (= 63
+  (is (= 65
          (count
           (cut/config-objects
            (yaml/load-as-edn "jitsi-test/valid-config.yaml")))))

From 2f48a556d282c12c90bbb41a81e4f1a3acd2ca66 Mon Sep 17 00:00:00 2001
From: Michael Jerger <michael.jerger@meissa-gmbh.de>
Date: Fri, 28 Feb 2025 19:15:02 +0100
Subject: [PATCH 3/4] missing stun/turn configs

---
 project.clj                                            | 4 ++--
 src/main/cljc/dda/c4k_jitsi/jitsi.cljc                 | 5 ++++-
 src/main/resources/jitsi/prosody-config-common-cm.yaml | 6 +++++-
 src/main/resources/jitsi/web-config-envs-cm.yaml       | 5 +----
 src/test/cljc/dda/c4k_jitsi/jitsi_test.cljc            | 6 +++++-
 5 files changed, 17 insertions(+), 9 deletions(-)

diff --git a/project.clj b/project.clj
index 0e94e64..b5ac68d 100644
--- a/project.clj
+++ b/project.clj
@@ -24,9 +24,9 @@
                        :main dda.c4k-jitsi.uberjar
                        :uberjar-name "c4k-jitsi-standalone.jar"
                        :dependencies [[org.clojure/tools.cli "1.1.230"]
-                                      [ch.qos.logback/logback-classic "1.5.16"
+                                      [ch.qos.logback/logback-classic "1.5.17"
                                        :exclusions [com.sun.mail/javax.mail]]
-                                      [org.slf4j/jcl-over-slf4j "2.0.16"]
+                                      [org.slf4j/jcl-over-slf4j "2.0.17"]
                                       [com.github.clj-easy/graal-build-time "1.0.5"]]}}
   :release-tasks [["test"]
                   ["vcs" "assert-committed"]
diff --git a/src/main/cljc/dda/c4k_jitsi/jitsi.cljc b/src/main/cljc/dda/c4k_jitsi/jitsi.cljc
index e62f6f9..5048583 100644
--- a/src/main/cljc/dda/c4k_jitsi/jitsi.cljc
+++ b/src/main/cljc/dda/c4k_jitsi/jitsi.cljc
@@ -40,7 +40,9 @@
     [(load-and-adjust-namespace "jitsi/prosody-config-serviceaccount.yaml" namespace)
      (->
       (load-and-adjust-namespace "jitsi/prosody-config-common-cm.yaml" namespace)
-      (cm/replace-all-matching "JITSI_FQDN" fqdn))
+      (cm/replace-all-matching "JITSI_FQDN" fqdn)
+      (cm/replace-key-value :STUN_HOST (str "stun." fqdn))
+      (cm/replace-key-value :TURN_HOST (str "stun." fqdn)))
      (load-and-adjust-namespace "jitsi/prosody-config-default-cm.yaml" namespace)
      (load-and-adjust-namespace "jitsi/prosody-config-envs-cm.yaml" namespace)
      (load-and-adjust-namespace "jitsi/prosody-config-init-cm.yaml" namespace)
@@ -87,6 +89,7 @@
      (-> 
       (load-and-adjust-namespace "jitsi/web-config-envs-cm.yaml" namespace)
       (cm/replace-key-value :XMPP_BOSH_URL_BASE (str "http://prosody." namespace ".svc.cluster.local:5280"))
+      (cm/replace-key-value :P2P_STUN_SERVERS (str "stun." fqdn ":443"))
       (cm/replace-key-value :ETHERPAD_PUBLIC_URL (str "https://etherpad." fqdn "/p/"))
       (cm/replace-key-value :WHITEBOARD_COLLAB_SERVER_PUBLIC_URL (str "https://excalidraw." fqdn))
       )
diff --git a/src/main/resources/jitsi/prosody-config-common-cm.yaml b/src/main/resources/jitsi/prosody-config-common-cm.yaml
index 8f0e06e..ea47cc1 100644
--- a/src/main/resources/jitsi/prosody-config-common-cm.yaml
+++ b/src/main/resources/jitsi/prosody-config-common-cm.yaml
@@ -22,4 +22,8 @@ data:
   ENABLE_XMPP_WEBSOCKET: 'true'
   ENABLE_RECORDING: "true"
   ENABLE_FILE_RECORDING_SERVICE_SHARING: "true"
-  TZ: 'Europe/Berlin'
\ No newline at end of file
+  TZ: 'Europe/Berlin'
+  STUN_HOST: STUN_FQDN
+  STUN_PORT: "443"
+  TURN_HOST: STUN_FQDN
+  TURN_PORT: "443"
\ No newline at end of file
diff --git a/src/main/resources/jitsi/web-config-envs-cm.yaml b/src/main/resources/jitsi/web-config-envs-cm.yaml
index b8386cb..c996e0f 100644
--- a/src/main/resources/jitsi/web-config-envs-cm.yaml
+++ b/src/main/resources/jitsi/web-config-envs-cm.yaml
@@ -12,9 +12,6 @@ data:
   JICOFO_AUTH_USER: focus
   XMPP_BOSH_URL_BASE: REPLACE_ME
   DEFAULT_LANGUAGE: de
-  RESOLUTION: "480"
-  RESOLUTION_MIN: "240"
-  RESOLUTION_WIDTH: "853"
-  RESOLUTION_WIDTH_MIN: "427"
+  P2P_STUN_SERVERS: REPLACE_ME
   ETHERPAD_PUBLIC_URL: REPLACE_ME
   WHITEBOARD_COLLAB_SERVER_PUBLIC_URL: REPLACE_ME
\ No newline at end of file
diff --git a/src/test/cljc/dda/c4k_jitsi/jitsi_test.cljc b/src/test/cljc/dda/c4k_jitsi/jitsi_test.cljc
index 364d778..4158399 100644
--- a/src/test/cljc/dda/c4k_jitsi/jitsi_test.cljc
+++ b/src/test/cljc/dda/c4k_jitsi/jitsi_test.cljc
@@ -47,7 +47,11 @@
            :ENABLE_XMPP_WEBSOCKET "true",
            :ENABLE_RECORDING "true",
            :ENABLE_FILE_RECORDING_SERVICE_SHARING "true",
-           :TZ "Europe/Berlin"}}
+           :TZ "Europe/Berlin"
+           :STUN_HOST "stun.xy.xy.xy",
+           :STUN_PORT "443",
+           :TURN_HOST "stun.xy.xy.xy",
+           :TURN_PORT "443"}}
          (second (cut/prosody-config
                   {:fqdn "xy.xy.xy"
                    :namespace "jitsi"}))))

From 43c8116106b2ef970955e89c2e128f03f86e9f90 Mon Sep 17 00:00:00 2001
From: Michael Jerger <michael.jerger@meissa-gmbh.de>
Date: Sat, 1 Mar 2025 10:27:53 +0100
Subject: [PATCH 4/4] disable turn

---
 src/main/cljc/dda/c4k_jitsi/jitsi.cljc                 | 3 +--
 src/main/resources/jitsi/prosody-config-common-cm.yaml | 2 --
 src/test/cljc/dda/c4k_jitsi/jitsi_test.cljc            | 4 +---
 3 files changed, 2 insertions(+), 7 deletions(-)

diff --git a/src/main/cljc/dda/c4k_jitsi/jitsi.cljc b/src/main/cljc/dda/c4k_jitsi/jitsi.cljc
index 5048583..b8ea4b6 100644
--- a/src/main/cljc/dda/c4k_jitsi/jitsi.cljc
+++ b/src/main/cljc/dda/c4k_jitsi/jitsi.cljc
@@ -41,8 +41,7 @@
      (->
       (load-and-adjust-namespace "jitsi/prosody-config-common-cm.yaml" namespace)
       (cm/replace-all-matching "JITSI_FQDN" fqdn)
-      (cm/replace-key-value :STUN_HOST (str "stun." fqdn))
-      (cm/replace-key-value :TURN_HOST (str "stun." fqdn)))
+      (cm/replace-key-value :STUN_HOST (str "stun." fqdn)))
      (load-and-adjust-namespace "jitsi/prosody-config-default-cm.yaml" namespace)
      (load-and-adjust-namespace "jitsi/prosody-config-envs-cm.yaml" namespace)
      (load-and-adjust-namespace "jitsi/prosody-config-init-cm.yaml" namespace)
diff --git a/src/main/resources/jitsi/prosody-config-common-cm.yaml b/src/main/resources/jitsi/prosody-config-common-cm.yaml
index ea47cc1..98aed92 100644
--- a/src/main/resources/jitsi/prosody-config-common-cm.yaml
+++ b/src/main/resources/jitsi/prosody-config-common-cm.yaml
@@ -25,5 +25,3 @@ data:
   TZ: 'Europe/Berlin'
   STUN_HOST: STUN_FQDN
   STUN_PORT: "443"
-  TURN_HOST: STUN_FQDN
-  TURN_PORT: "443"
\ No newline at end of file
diff --git a/src/test/cljc/dda/c4k_jitsi/jitsi_test.cljc b/src/test/cljc/dda/c4k_jitsi/jitsi_test.cljc
index 4158399..65c40ea 100644
--- a/src/test/cljc/dda/c4k_jitsi/jitsi_test.cljc
+++ b/src/test/cljc/dda/c4k_jitsi/jitsi_test.cljc
@@ -49,9 +49,7 @@
            :ENABLE_FILE_RECORDING_SERVICE_SHARING "true",
            :TZ "Europe/Berlin"
            :STUN_HOST "stun.xy.xy.xy",
-           :STUN_PORT "443",
-           :TURN_HOST "stun.xy.xy.xy",
-           :TURN_PORT "443"}}
+           :STUN_PORT "443"}}
          (second (cut/prosody-config
                   {:fqdn "xy.xy.xy"
                    :namespace "jitsi"}))))