add jicofo

This commit is contained in:
Michael Jerger 2025-02-17 13:23:09 +01:00
parent 524fae676f
commit 360b4d1357
8 changed files with 130 additions and 3 deletions

View file

@ -165,12 +165,12 @@ def lint(project):
@task
def inst(project):
package_uberjar(project)
package_native(project)
run(
f"sudo install -m=755 target/uberjar/{project.name}-standalone.jar /usr/local/bin/{project.name}-standalone.jar",
shell=True,
check=True,
)
package_native(project)
run(
f"sudo install -m=755 target/graalvm/{project.name} /usr/local/bin/{project.name}",
shell=True,

View file

@ -34,6 +34,7 @@
(cm/concat-vec
(ns/generate resolved-config)
(jitsi/prosody-config resolved-config)
(jitsi/jicofo-config resolved-config)
(jitsi/jitsi-config resolved-config)
(jitsi/jibri-config resolved-config)
;; [(jitsi/generate-jvb-service config)

View file

@ -153,7 +153,7 @@
(cm/replace-all-matching "JITSI_FQDN" 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)
(load-and-adjust-namespace "jitsi/prosody-config-init-cm.yaml" namespace)
(load-and-adjust-namespace "jitsi/prosody-config-stateful-set.yaml" namespace)
(load-and-adjust-namespace "jitsi/prosody-config-service.yaml" namespace)
(load-and-adjust-namespace "jitsi/prosody-config-test-deployment.yaml" namespace)]))
@ -174,6 +174,16 @@
(load-and-adjust-namespace "jitsi/prosody-auth-jvb-secret.yaml" namespace)
(cm/replace-key-value :JVB_AUTH_PASSWORD (b64/encode jvb-auth-password)))]))
(defn-spec jicofo-config cp/map-or-seq?
[config config?]
(let [{:keys [namespace]} config]
[(load-and-adjust-namespace "jitsi/jicofo-config-defaults-cm.yaml" namespace)
(->
(load-and-adjust-namespace "jitsi/jicofo-config-envs-cm.yaml" namespace)
(cm/replace-key-value :XMPP_SERVER (str "prosody." namespace ".svc.cluster.local")))
(load-and-adjust-namespace "jitsi/jicofo-config-init-cm.yaml" namespace)
(load-and-adjust-namespace "jitsi/jicofo-config-deployment.yaml" namespace)]))
(defn-spec jitsi-config cp/map-or-seq?
[config config?]
(let [{:keys [fqdn namespace]} config]
@ -184,7 +194,9 @@
(let [{:keys [fqdn namespace]} config]
[(load-and-adjust-namespace "jitsi/jitsi-config-serviceaccount.yaml" namespace)
(load-and-adjust-namespace "jitsi/jibri-config-default-cm.yaml" namespace)
(load-and-adjust-namespace "jitsi/jibri-config-envs.yaml" namespace)
(->
(load-and-adjust-namespace "jitsi/jibri-config-envs.yaml" namespace)
(cm/replace-key-value :XMPP_SERVER (str "prosody." namespace ".svc.cluster.local")))
(load-and-adjust-namespace "jitsi/jibri-config-init-cm.yaml" namespace)
(load-and-adjust-namespace "jitsi/jibri-config-service.yaml" namespace)
(load-and-adjust-namespace "jitsi/jibri-config-deployment.yaml" namespace)]))

View file

@ -0,0 +1,14 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: jitsi-meet-jicofo-defaults
namespace: NAMESPACE
labels:
app.kubernetes.io/name: jitsi-meet
app.kubernetes.io/component: jicofo
data:
jicofo.conf: |
# Using jicofo /default/jicofo.conf from container image
logging.properties: |
# Using jicofo /default/logging.properties from container image

View file

@ -0,0 +1,70 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: jitsi-meet-jicofo
namespace: NAMESPACE
labels:
app.kubernetes.io/name: jitsi-meet
app.kubernetes.io/component: jicofo
spec:
replicas: 1
selector:
matchLabels:
app.kubernetes.io/name: jitsi-meet
app.kubernetes.io/component: jicofo
template:
metadata:
labels:
app.kubernetes.io/name: jitsi-meet
app.kubernetes.io/component: jicofo
spec:
serviceAccountName: jitsi-meet
securityContext:
{}
volumes:
- name: config
emptyDir: {}
- name: custom-cont-inits
configMap:
defaultMode: 493
name: jitsi-meet-jicofo-cont-inits
items:
- key: 10-config
path: 10-config
- name: custom-defaults
configMap:
name: jitsi-meet-jicofo-defaults
items:
- key: jicofo.conf
path: jicofo.conf
- key: logging.properties
path: logging.properties
containers:
- name: jitsi-meet
securityContext:
{}
image: "jitsi/jicofo:stable-9646"
imagePullPolicy: IfNotPresent
envFrom:
- secretRef:
name: prosody-jicofo
- configMapRef:
name: prosody-common
- configMapRef:
name: jitsi-meet-jicofo
ports:
- name: http
containerPort: 80
protocol: TCP
livenessProbe:
tcpSocket:
port: 8888
readinessProbe:
tcpSocket:
port: 8888
resources:
{}
volumeMounts:
# to support readOnlyRootFilesystem
- name: config
mountPath: /config

View file

@ -0,0 +1,13 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: jitsi-meet-jicofo
namespace: NAMESPACE
labels:
app.kubernetes.io/name: jitsi-meet
app.kubernetes.io/component: jicofo
data:
JVB_BREWERY_MUC: 'jvbbrewery'
XMPP_SERVER: 'prosody.NAMESPACE.svc.cluster.local'
JIBRI_BREWERY_MUC: 'jibribrewery'
JIBRI_PENDING_TIMEOUT: '90'

View file

@ -0,0 +1,11 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: jitsi-meet-jicofo-cont-inits
namespace: NAMESPACE
labels:
app.kubernetes.io/name: jitsi-meet
app.kubernetes.io/component: jicofo
data:
10-config: |
# Using jicofo /etc/cont-init.d/10-config from container image

View file

@ -138,6 +138,12 @@
:jicofo-auth-password "jicofo-auth"
:jicofo-component-secret "jicofo-comp"})))))
(deftest should-generate-jicofo
(is (= 4
(count (cut/jicofo-config
{:fqdn "xy.xy.xy"
:namespace "jitsi"})))))
(deftest should-generate-jitsi
(is (= 1
(count (cut/jitsi-config