From 3a77aace5684ff6939c0f6334d0c7b9c58139fef Mon Sep 17 00:00:00 2001 From: Aaron van Meerten Date: Wed, 27 Sep 2023 08:37:21 -0500 Subject: [PATCH] jicofo: support visitors in jicofo configuration (#1610) --- docker-compose.yml | 4 +++ jicofo/rootfs/defaults/jicofo.conf | 43 ++++++++++++++++++++++++++++++ 2 files changed, 47 insertions(+) diff --git a/docker-compose.yml b/docker-compose.yml index 003d883..a27c553 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -284,6 +284,7 @@ services: - ENABLE_OCTO - ENABLE_RECORDING - ENABLE_SCTP + - ENABLE_VISITORS - ENABLE_AUTO_LOGIN - JICOFO_AUTH_LIFETIME - JICOFO_AUTH_PASSWORD @@ -319,6 +320,9 @@ services: - SENTRY_ENVIRONMENT - SENTRY_RELEASE - TZ + - VISITORS_MAX_PARTICIPANTS + - VISITORS_MAX_VISITORS_PER_NODE + - VISITORS_XMPP_SERVER - XMPP_DOMAIN - XMPP_AUTH_DOMAIN - XMPP_INTERNAL_MUC_DOMAIN diff --git a/jicofo/rootfs/defaults/jicofo.conf b/jicofo/rootfs/defaults/jicofo.conf index c5c8b3b..1546e0e 100644 --- a/jicofo/rootfs/defaults/jicofo.conf +++ b/jicofo/rootfs/defaults/jicofo.conf @@ -1,4 +1,5 @@ {{ $ENABLE_AUTH := .Env.ENABLE_AUTH | default "0" -}} +{{ $ENABLE_VISITORS := .Env.ENABLE_VISITORS | default "0" | toBool -}} {{ $JICOFO_ENABLE_AUTH := .Env.JICOFO_ENABLE_AUTH | default $ENABLE_AUTH | toBool -}} {{ $AUTH_TYPE := .Env.AUTH_TYPE | default "internal" -}} {{ $JICOFO_AUTH_TYPE := .Env.JICOFO_AUTH_TYPE | default $AUTH_TYPE -}} @@ -18,6 +19,9 @@ {{ $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" -}} +{{ $VISITORS_XMPP_SERVER := .Env.VISITORS_XMPP_SERVER | default "" -}} +{{ $VISITORS_XMPP_SERVERS := splitList "," $VISITORS_XMPP_SERVER -}} +{{ $VISITORS_XMPP_PORT := .Env.VISITORS_XMPP_PORT | default "52220" }} {{ $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" -}} @@ -25,6 +29,7 @@ {{ $XMPP_RECORDER_DOMAIN := .Env.XMPP_RECORDER_DOMAIN | default "recorder.meet.jitsi" -}} {{ $XMPP_PORT := .Env.XMPP_PORT | default "5222" -}} {{ $XMPP_SERVER := .Env.XMPP_SERVER | default "xmpp.meet.jitsi" -}} +{{ $ENV := .Env }} jicofo { {{ if $JICOFO_ENABLE_AUTH }} @@ -58,9 +63,16 @@ jicofo { stress-threshold = "{{ .Env.BRIDGE_STRESS_THRESHOLD }}" {{ end }} + {{ if $ENABLE_VISITORS }} + selection-strategy = VisitorSelectionStrategy + visitor-selection-strategy = RegionBasedBridgeSelectionStrategy + participant-selection-strategy = RegionBasedBridgeSelectionStrategy + topology-strategy = VisitorTopologyStrategy + {{ else }} {{ if .Env.OCTO_BRIDGE_SELECTION_STRATEGY }} selection-strategy = "{{ .Env.OCTO_BRIDGE_SELECTION_STRATEGY }}" {{ end }} + {{ end }} {{ if .Env.JICOFO_ENABLE_BRIDGE_HEALTH_CHECKS }} health-checks { @@ -193,8 +205,39 @@ jicofo { sctp { enabled = {{ $ENABLE_SCTP }} } +{{ if $ENABLE_VISITORS }} + visitors { + enabled = true + {{ if .Env.VISITORS_MAX_PARTICIPANTS }} + max-participants = {{ .Env.VISITORS_MAX_PARTICIPANTS }} + {{ end }} + {{ if .Env.VISITORS_MAX_VISITORS_PER_NODE }} + max-visitors-per-node = {{ .Env.VISITORS_MAX_VISITORS_PER_NODE }} + {{ end }} + } +{{ end }} xmpp { + {{ if $ENABLE_VISITORS }} + {{ if $.Env.VISITORS_XMPP_SERVER }} + visitors { + {{ range $index, $element := $VISITORS_XMPP_SERVERS -}} + {{ $SERVER := splitn ":" 2 $element }} + v{{ $index }} { + enabled = true + conference-service = conference.v{{ $index }}.{{ $XMPP_DOMAIN }} + hostname = {{ $SERVER._0 }} + {{ $DEFAULT_PORT := add $VISITORS_XMPP_PORT $index }} + port = {{ $SERVER._1 | default $DEFAULT_PORT }} + domain = "{{ $XMPP_AUTH_DOMAIN }}" + xmpp-domain = v{{ $index }}.{{ $XMPP_DOMAIN }} + password = "{{ $ENV.JICOFO_AUTH_PASSWORD }}" + disable-certificate-verification = true + } + {{ end }} + } + {{ end }} + {{ end }} client { enabled = true hostname = "{{ $XMPP_SERVER }}"