jvb: make colibri websocket endpoints dynamic for multiple jvbs

pull/791/head
Paul Tiedtke 4 years ago committed by Saúl Ibarra Corretgé
parent 991f695275
commit b277926332
  1. 5
      jvb/rootfs/defaults/sip-communicator.properties
  2. 2
      jvb/rootfs/etc/cont-init.d/10-config
  3. 13
      jvb/rootfs/etc/services.d/jvb/run
  4. 4
      web/rootfs/defaults/meet.conf

@ -4,6 +4,10 @@ org.jitsi.videobridge.TCP_HARVESTER_PORT={{ .Env.JVB_TCP_PORT }}
{{ if .Env.JVB_STUN_SERVERS }} {{ if .Env.JVB_STUN_SERVERS }}
org.ice4j.ice.harvest.STUN_MAPPING_HARVESTER_ADDRESSES={{ .Env.JVB_STUN_SERVERS }} org.ice4j.ice.harvest.STUN_MAPPING_HARVESTER_ADDRESSES={{ .Env.JVB_STUN_SERVERS }}
{{ end }} {{ end }}
{{ if .Env.DOCKER_HOST_ADDRESS }}
org.ice4j.ice.harvest.NAT_HARVESTER_LOCAL_ADDRESS={{ .Env.LOCAL_ADDRESS }}
org.ice4j.ice.harvest.NAT_HARVESTER_PUBLIC_ADDRESS={{ .Env.DOCKER_HOST_ADDRESS }}
{{ end }}
{{ $JVB_TCP_PORT := .Env.JVB_TCP_PORT | default "4443" }} {{ $JVB_TCP_PORT := .Env.JVB_TCP_PORT | default "4443" }}
{{ $JVB_TCP_MAPPED_PORT := .Env.JVB_TCP_MAPPED_PORT | default $JVB_TCP_PORT }} {{ $JVB_TCP_MAPPED_PORT := .Env.JVB_TCP_MAPPED_PORT | default $JVB_TCP_PORT }}
{{ if not (eq $JVB_TCP_PORT $JVB_TCP_MAPPED_PORT) }} {{ if not (eq $JVB_TCP_PORT $JVB_TCP_MAPPED_PORT) }}
@ -28,5 +32,6 @@ org.jitsi.videobridge.rest.COLIBRI_WS_DISABLE=false
org.jitsi.videobridge.rest.jetty.port=9090 org.jitsi.videobridge.rest.jetty.port=9090
org.jitsi.videobridge.rest.COLIBRI_WS_DOMAIN={{ $WS_DOMAIN }} org.jitsi.videobridge.rest.COLIBRI_WS_DOMAIN={{ $WS_DOMAIN }}
org.jitsi.videobridge.rest.COLIBRI_WS_TLS=true org.jitsi.videobridge.rest.COLIBRI_WS_TLS=true
org.jitsi.videobridge.rest.COLIBRI_WS_SERVER_ID={{ .Env.LOCAL_ADDRESS }}
org.jitsi.videobridge.rest.private.jetty.host=0.0.0.0 org.jitsi.videobridge.rest.private.jetty.host=0.0.0.0

@ -1,5 +1,7 @@
#!/usr/bin/with-contenv bash #!/usr/bin/with-contenv bash
export LOCAL_ADDRESS=$(ip addr show dev "$(ip route|awk '/^default/ { print $5 }')" | grep -oP '(?<=inet\s)\d+(\.\d+){3}')
if [[ -z $JVB_AUTH_PASSWORD ]]; then if [[ -z $JVB_AUTH_PASSWORD ]]; then
echo 'FATAL ERROR: JVB auth password must be set' echo 'FATAL ERROR: JVB auth password must be set'
exit 1 exit 1

@ -1,16 +1,7 @@
#!/usr/bin/with-contenv bash #!/usr/bin/with-contenv bash
JAVA_SYS_PROPS="-Dnet.java.sip.communicator.SC_HOME_DIR_LOCATION=/ -Dnet.java.sip.communicator.SC_HOME_DIR_NAME=config -Djava.util.logging.config.file=/config/logging.properties" export JAVA_SYS_PROPS="-Dnet.java.sip.communicator.SC_HOME_DIR_LOCATION=/ -Dnet.java.sip.communicator.SC_HOME_DIR_NAME=config -Djava.util.logging.config.file=/config/logging.properties"
if [[ ! -z "$DOCKER_HOST_ADDRESS" ]]; then
LOCAL_ADDRESS=$(ip route get "$DOCKER_HOST_ADDRESS" | head -n1 | cut -d " " -f7)
JAVA_SYS_PROPS="$JAVA_SYS_PROPS -Dorg.ice4j.ice.harvest.NAT_HARVESTER_LOCAL_ADDRESS=$LOCAL_ADDRESS -Dorg.ice4j.ice.harvest.NAT_HARVESTER_PUBLIC_ADDRESS=$DOCKER_HOST_ADDRESS"
fi
DAEMON=/usr/share/jitsi-videobridge/jvb.sh DAEMON=/usr/share/jitsi-videobridge/jvb.sh
DEFAULT_DAEMON_OPTS="none"
DAEMON_OPTS=${JVB_ENABLE_APIS:=$DEFAULT_DAEMON_OPTS}
exec s6-setuidgid jvb /bin/bash -c "JAVA_SYS_PROPS=\"$JAVA_SYS_PROPS\" exec $DAEMON --apis=${DAEMON_OPTS}"
exec s6-setuidgid jvb /bin/bash -c "exec $DAEMON --apis=${JVB_ENABLE_APIS:="none"}"

@ -35,8 +35,8 @@ location ~ ^/(libs|css|static|images|fonts|lang|sounds|connection_optimization|.
} }
# colibri (JVB) websockets # colibri (JVB) websockets
location ~ ^/colibri-ws/default-id/(.*) { location ~ ^/colibri-ws/([a-zA-Z0-9-\.]+)/(.*) {
proxy_pass http://jvb.meet.jitsi:9090/colibri-ws/default-id/$1$is_args$args; proxy_pass http://$1:9090/colibri-ws/$1/$2$is_args$args;
proxy_http_version 1.1; proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade; proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade"; proxy_set_header Connection "upgrade";

Loading…
Cancel
Save