Add Etherpad integration

* Add Etherpad container, service and ingress
* Enable jitsi etherpad integration by passing env variable
This commit is contained in:
bom 2022-06-04 15:21:04 +02:00
parent ae5603b767
commit 0bdf94d732
6 changed files with 82 additions and 10 deletions

View file

@ -20,6 +20,7 @@
(jitsi/generate-secret config)
(jitsi/generate-jvb-service)
(jitsi/generate-web-service)
(jitsi/generate-etherpad-service)
(jitsi/generate-deployment config)]))
(defn-spec generate any?

View file

@ -16,6 +16,8 @@
#?(:cljs
(defmethod yaml/load-resource :jitsi [resource-name]
(case resource-name
"jitsi/deployment.yaml" (rc/inline "jitsi/deployment.yaml")
"jitsi/etherpad-service.yaml" (rc/inline "jitsi/etherpad-service.yaml")
"jitsi/ingress.yaml" (rc/inline "jitsi/ingress.yaml")
"jitsi/jvb-service.yaml" (rc/inline "jitsi/jvb-service.yaml")
"jitsi/secret.yaml" (rc/inline "jitsi/secret.yaml")
@ -31,7 +33,8 @@
(yaml/from-string (yaml/load-resource "jitsi/ingress.yaml"))
(assoc-in [:metadata :annotations :cert-manager.io/cluster-issuer] letsencrypt-issuer)
(assoc-in [:metadata :annotations :kubernetes.io/ingress.class] ingress-kind)
(cm/replace-all-matching-values-by-new-value "FQDN" fqdn))))
(cm/replace-all-matching-values-by-new-value "FQDN" fqdn)
(cm/replace-all-matching-values-by-new-value "ETHERPAD_FQDN" (str "https://etherpad." fqdn "/p/")))))
(defn generate-secret [config]
(let [{:keys [jvb-auth-password jicofo-auth-password jicofo-component-secret]} config]
@ -47,8 +50,12 @@
(defn generate-web-service []
(yaml/from-string (yaml/load-resource "jitsi/web-service.yaml")))
(defn generate-etherpad-service []
(yaml/from-string (yaml/load-resource "jitsi/etherpad-service.yaml")))
(defn generate-deployment [config]
(let [{:keys [fqdn]} config]
(->
(yaml/from-string (yaml/load-resource "jitsi/deployment.yaml"))
(cm/replace-all-matching-values-by-new-value "FQDN" fqdn))))
(cm/replace-all-matching-values-by-new-value "FQDN" fqdn)
(cm/replace-all-matching-values-by-new-value "ETHERPAD_FQDN" (str "https://etherpad." fqdn "/p/")))))

View file

@ -119,6 +119,8 @@ spec:
value: "427"
- name: DISABLE_AUDIO_LEVELS
value: "true"
- name: ETHERPAD_PUBLIC_URL
value: ETHERPAD_FQDN
- name: jvb
image: jitsi/jvb:stable-7287
imagePullPolicy: IfNotPresent
@ -156,4 +158,31 @@ spec:
- name: JVB_BREWERY_MUC
value: jvbbrewery
- name: TZ
value: Europe/Berlin
value: Europe/Berlin
- name: etherpad
image: jitsi/etherpad
env:
- name: XMPP_SERVER
value: localhost
- name: XMPP_DOMAIN
value: meet.meissa-gmbh
- name: XMPP_AUTH_DOMAIN
value: auth.meet.meissa-gmbh
- name: JICOFO_COMPONENT_SECRET
valueFrom:
secretKeyRef:
name: jitsi-config
key: JICOFO_COMPONENT_SECRET
- name: JICOFO_AUTH_USER
value: focus
- name: JVB_BREWERY_MUC
value: jvbbrewery
- name: XMPP_INTERNAL_MUC_DOMAIN
value: internal-muc.meet.meissa-gmbh
- name: JICOFO_AUTH_PASSWORD
valueFrom:
secretKeyRef:
name: jitsi-config
key: JICOFO_AUTH_PASSWORD
- name: TZ
value: Europe/Berlin

View file

@ -0,0 +1,13 @@
apiVersion: v1
kind: Service
metadata:
labels:
service: etherpad
name: etherpad
spec:
ports:
- name: etherpad
port: 9001
targetPort: 9001
selector:
app: jitsi

View file

@ -20,4 +20,14 @@ spec:
service:
name: web
port:
number: 80
number: 80
- host: etherpad.jitsi.test.meissa-gmbh.de
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: etherpad
port:
number: 9001

View file

@ -67,7 +67,8 @@
{:name "RESOLUTION_MIN", :value "240"}
{:name "RESOLUTION_WIDTH", :value "853"}
{:name "RESOLUTION_WIDTH_MIN", :value "427"}
{:name "DISABLE_AUDIO_LEVELS", :value "true"}]}
{:name "DISABLE_AUDIO_LEVELS", :value "true"}
{:name "ETHERPAD_PUBLIC_URL", :value "https://etherpad.xy/p/"}]}
{:name "jvb",
:image "jitsi/jvb:stable-7287",
:imagePullPolicy "IfNotPresent",
@ -85,6 +86,19 @@
{:name "JVB_AUTH_PASSWORD", :valueFrom {:secretKeyRef {:name "jitsi-config", :key "JVB_AUTH_PASSWORD"}}}
{:name "JICOFO_AUTH_PASSWORD", :valueFrom {:secretKeyRef {:name "jitsi-config", :key "JICOFO_AUTH_PASSWORD"}}}
{:name "JVB_BREWERY_MUC", :value "jvbbrewery"}
{:name "TZ", :value "Europe/Berlin"}]}
{:name "etherpad",
:image "jitsi/etherpad",
:env
[{:name "XMPP_SERVER", :value "localhost"}
{:name "XMPP_DOMAIN", :value "meet.meissa-gmbh"}
{:name "XMPP_AUTH_DOMAIN", :value "auth.meet.meissa-gmbh"}
{:name "JICOFO_COMPONENT_SECRET",
:valueFrom {:secretKeyRef {:name "jitsi-config", :key "JICOFO_COMPONENT_SECRET"}}}
{:name "JICOFO_AUTH_USER", :value "focus"}
{:name "JVB_BREWERY_MUC", :value "jvbbrewery"}
{:name "XMPP_INTERNAL_MUC_DOMAIN", :value "internal-muc.meet.meissa-gmbh"}
{:name "JICOFO_AUTH_PASSWORD", :valueFrom {:secretKeyRef {:name "jitsi-config", :key "JICOFO_AUTH_PASSWORD"}}}
{:name "TZ", :value "Europe/Berlin"}]}]}}}}
(cut/generate-deployment {:fqdn "xy"}))))
@ -101,11 +115,9 @@
{:tls [{:hosts ["test.com"], :secretName "tls-jitsi"}],
:rules
[{:host "test.com",
:http
{:paths
[{:path "/",
:pathType "Prefix",
:backend {:service {:name "web", :port {:number 80}}}}]}}]}}
:http {:paths [{:path "/", :pathType "Prefix", :backend {:service {:name "web", :port {:number 80}}}}]}}
{:host "etherpad.jitsi.test.meissa-gmbh.de",
:http {:paths [{:path "/", :pathType "Prefix", :backend {:service {:name "etherpad", :port {:number 9001}}}}]}}]}}
(cut/generate-ingress {:fqdn "test.com" :issuer :staging}))))
(deftest should-generate-secret