From ed095bc28e912601c7231657f9fbc7bccb52adcb Mon Sep 17 00:00:00 2001 From: Aaron van Meerten Date: Thu, 16 Mar 2023 07:08:52 -0500 Subject: [PATCH] misc: support alternate xmpp server for jvb (#1495) --- docker-compose.yml | 10 ++++++++++ jicofo/rootfs/defaults/jicofo.conf | 19 +++++++++++++++++++ jvb/rootfs/defaults/jvb.conf | 22 ++++++++++++++++++++++ 3 files changed, 51 insertions(+) diff --git a/docker-compose.yml b/docker-compose.yml index 88f2610..939d5f7 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -268,6 +268,7 @@ services: - ENABLE_CODEC_VP8 - ENABLE_CODEC_VP9 - ENABLE_CODEC_H264 + - ENABLE_JVB_XMPP_SERVER - ENABLE_OCTO - ENABLE_RECORDING - ENABLE_SCTP @@ -284,6 +285,10 @@ services: - JIGASI_BREWERY_MUC - JIGASI_SIP_URI - JVB_BREWERY_MUC + - JVB_XMPP_AUTH_DOMAIN + - JVB_XMPP_INTERNAL_MUC_DOMAIN + - JVB_XMPP_PORT + - JVB_XMPP_SERVER - MAX_BRIDGE_PARTICIPANTS - OCTO_BRIDGE_SELECTION_STRATEGY - SENTRY_DSN="${JICOFO_SENTRY_DSN:-0}" @@ -314,6 +319,7 @@ services: environment: - DOCKER_HOST_ADDRESS - ENABLE_COLIBRI_WEBSOCKET + - ENABLE_JVB_XMPP_SERVER - ENABLE_OCTO - JVB_ADVERTISE_IPS - JVB_ADVERTISE_PRIVATE_CANDIDATES @@ -329,6 +335,10 @@ services: - JVB_OCTO_RELAY_ID - JVB_WS_DOMAIN - JVB_WS_SERVER_ID + - JVB_XMPP_AUTH_DOMAIN + - JVB_XMPP_INTERNAL_MUC_DOMAIN + - JVB_XMPP_PORT + - JVB_XMPP_SERVER - PUBLIC_URL - SENTRY_DSN="${JVB_SENTRY_DSN:-0}" - SENTRY_ENVIRONMENT diff --git a/jicofo/rootfs/defaults/jicofo.conf b/jicofo/rootfs/defaults/jicofo.conf index 026cf1c..8f8e638 100644 --- a/jicofo/rootfs/defaults/jicofo.conf +++ b/jicofo/rootfs/defaults/jicofo.conf @@ -5,10 +5,15 @@ {{ $ENABLE_OCTO := .Env.ENABLE_OCTO | default "0" | toBool }} {{ $ENABLE_AUTO_LOGIN := .Env.ENABLE_AUTO_LOGIN | default "1" | toBool }} {{ $ENABLE_REST := Env.JICOFO_ENABLE_REST | default "0" | toBool }} +{{ $ENABLE_JVB_XMPP_SERVER := Env.ENABLE_JVB_XMPP_SERVER | default "0" | toBool }} {{ $JIBRI_BREWERY_MUC := .Env.JIBRI_BREWERY_MUC | default "jibribrewery" -}} {{ $JIGASI_BREWERY_MUC := .Env.JIGASI_BREWERY_MUC | default "jigasibrewery" -}} {{ $JVB_BREWERY_MUC := .Env.JVB_BREWERY_MUC | default "jvbbrewery" -}} {{ $JIBRI_PENDING_TIMEOUT := .Env.JIBRI_PENDING_TIMEOUT | default 90 -}} +{{ $JVB_XMPP_AUTH_DOMAIN := .Env.JVB_XMPP_AUTH_DOMAIN | default "auth.jvb.meet.jitsi" -}} +{{ $JVB_XMPP_INTERNAL_MUC_DOMAIN := .Env.JVB_XMPP_INTERNAL_MUC_DOMAIN | default "muc.jvb.meet.jitsi" -}} +{{ $JVB_XMPP_PORT := .Env.JVB_XMPP_PORT | default "6222" -}} +{{ $JVB_XMPP_SERVER := .Env.JVB_XMPP_SERVER | default "xmpp.jvb.meet.jitsi" -}} {{ $XMPP_AUTH_DOMAIN := .Env.XMPP_AUTH_DOMAIN | default "auth.meet.jitsi" -}} {{ $XMPP_MUC_DOMAIN := .Env.XMPP_MUC_DOMAIN | default "muc.meet.jitsi" -}} {{ $XMPP_INTERNAL_MUC_DOMAIN := .Env.XMPP_INTERNAL_MUC_DOMAIN | default "internal-muc.meet.jitsi" -}} @@ -65,7 +70,11 @@ jicofo { } {{ end }} + {{ if $ENABLE_JVB_XMPP_SERVER }} + brewery-jid = "{{ $JVB_BREWERY_MUC }}@{{ $JVB_XMPP_INTERNAL_MUC_DOMAIN }}" + {{ else }} brewery-jid = "{{ $JVB_BREWERY_MUC }}@{{ $XMPP_INTERNAL_MUC_DOMAIN }}" + {{ end }} } // Configure the codecs and RTP extensions to be used in the offer sent to clients. codec { @@ -157,6 +166,16 @@ jicofo { client-proxy = "focus.{{ $XMPP_DOMAIN }}" disable-certificate-verification = true } + {{ if $ENABLE_JVB_XMPP_SERVER }} + service { + enabled = true + hostname = "{{ $JVB_XMPP_SERVER }}" + port = "{{ $JVB_XMPP_PORT }}" + domain = "{{ $JVB_XMPP_AUTH_DOMAIN }}" + username = "focus" + password = "{{ .Env.JICOFO_AUTH_PASSWORD }}" + } + {{ end }} {{ if $ENABLE_RECORDING }} trusted-domains = [ "{{ $XMPP_RECORDER_DOMAIN }}" ] {{ end }} diff --git a/jvb/rootfs/defaults/jvb.conf b/jvb/rootfs/defaults/jvb.conf index dad07aa..3406412 100644 --- a/jvb/rootfs/defaults/jvb.conf +++ b/jvb/rootfs/defaults/jvb.conf @@ -1,6 +1,7 @@ {{ $COLIBRI_REST_ENABLED := .Env.COLIBRI_REST_ENABLED | default "false" | toBool -}} {{ $ENABLE_COLIBRI_WEBSOCKET := .Env.ENABLE_COLIBRI_WEBSOCKET | default "1" | toBool -}} {{ $ENABLE_OCTO := .Env.ENABLE_OCTO | default "0" | toBool -}} +{{ $ENABLE_JVB_XMPP_SERVER := Env.ENABLE_JVB_XMPP_SERVER | default "0" | toBool }} {{ $JVB_DISABLE_STUN := .Env.JVB_DISABLE_STUN | default "0" | toBool -}} {{ $JVB_STUN_SERVERS := .Env.JVB_STUN_SERVERS | default "meet-jit-si-turnrelay.jitsi.net:443" -}} {{ $JVB_AUTH_USER := .Env.JVB_AUTH_USER | default "jvb" -}} @@ -9,6 +10,11 @@ {{ $JVB_ADVERTISE_PRIVATE_CANDIDATES := .Env.JVB_ADVERTISE_PRIVATE_CANDIDATES | default "true" | toBool -}} {{ $JVB_ADVERTISE_IPS := .Env.JVB_ADVERTISE_IPS | default "" -}} {{ $JVB_IPS := splitList "," $JVB_ADVERTISE_IPS -}} +{{ $JVB_XMPP_AUTH_DOMAIN := .Env.JVB_XMPP_AUTH_DOMAIN | default "auth.jvb.meet.jitsi" -}} +{{ $JVB_XMPP_INTERNAL_MUC_DOMAIN := .Env.JVB_XMPP_INTERNAL_MUC_DOMAIN | default "muc.jvb.meet.jitsi" -}} +{{ $JVB_XMPP_PORT := .Env.JVB_XMPP_PORT | default "6222" -}} +{{ $JVB_XMPP_SERVER := .Env.JVB_XMPP_SERVER | default "xmpp.jvb.meet.jitsi" -}} +{{ $JVB_XMPP_SERVERS := splitList "," $JVB_XMPP_SERVER -}} {{ $PUBLIC_URL_DOMAIN := .Env.PUBLIC_URL | default "https://localhost:8443" | trimPrefix "https://" | trimSuffix "/" -}} {{ $SHUTDOWN_REST_ENABLED := .Env.SHUTDOWN_REST_ENABLED | default "false" | toBool -}} {{ $WS_DOMAIN := .Env.JVB_WS_DOMAIN | default $PUBLIC_URL_DOMAIN -}} @@ -31,6 +37,21 @@ videobridge { apis { xmpp-client { configs { +{{ if $ENABLE_JVB_XMPP_SERVER }} +{{ range $index, $element := $JVB_XMPP_SERVERS -}} +{{ $SERVER := splitn ":" 2 $element }} + shard{{ $index }} { + HOSTNAME = "{{ $SERVER._0 }}" + PORT = "{{ $SERVER._1 | default $JVB_XMPP_PORT }}" + DOMAIN = "{{ $JVB_XMPP_AUTH_DOMAIN }}" + USERNAME = "{{ $JVB_AUTH_USER }}" + PASSWORD = "{{ $ENV.JVB_AUTH_PASSWORD }}" + MUC_JIDS = "{{ $JVB_BREWERY_MUC }}@{{ $JVB_XMPP_INTERNAL_MUC_DOMAIN }}" + MUC_NICKNAME = "{{ $JVB_MUC_NICKNAME }}" + DISABLE_CERTIFICATE_VERIFICATION = true + } +{{ end -}} +{{ else }} {{ range $index, $element := $XMPP_SERVERS -}} {{ $SERVER := splitn ":" 2 $element }} shard{{ $index }} { @@ -44,6 +65,7 @@ videobridge { DISABLE_CERTIFICATE_VERIFICATION = true } {{ end -}} +{{ end }} } } rest {