diff --git a/jvb/Dockerfile b/jvb/Dockerfile index 7062b5a..870bf53 100644 --- a/jvb/Dockerfile +++ b/jvb/Dockerfile @@ -3,7 +3,7 @@ ARG BASE_TAG=latest FROM ${JITSI_REPO}/base-java:${BASE_TAG} RUN apt-dpkg-wrap apt-get update && \ - apt-dpkg-wrap apt-get install -y jitsi-videobridge2 jq curl iproute2 && \ + apt-dpkg-wrap apt-get install -y jitsi-videobridge2 jq curl iproute2 dnsutils && \ apt-cleanup COPY rootfs/ / diff --git a/jvb/rootfs/defaults/jvb.conf b/jvb/rootfs/defaults/jvb.conf index 900565d..689eada 100644 --- a/jvb/rootfs/defaults/jvb.conf +++ b/jvb/rootfs/defaults/jvb.conf @@ -1,12 +1,12 @@ +{{ $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 }} {{ $JVB_TCP_PORT := .Env.JVB_TCP_PORT | default "4443" }} {{ $JVB_TCP_MAPPED_PORT := .Env.JVB_TCP_MAPPED_PORT | default $JVB_TCP_PORT }} {{ $PUBLIC_URL_DOMAIN := .Env.PUBLIC_URL | default "https://localhost:8443" | trimPrefix "https://" | trimSuffix "/" -}} -{{ $WS_DOMAIN := .Env.JVB_WS_DOMAIN | default $PUBLIC_URL_DOMAIN -}} -{{ $WS_SERVER_ID := .Env.JVB_WS_SERVER_ID | default .Env.LOCAL_ADDRESS -}} -{{ $COLIBRI_REST_ENABLED := .Env.COLIBRI_REST_ENABLED | default "false" | toBool }} {{ $SHUTDOWN_REST_ENABLED := .Env.SHUTDOWN_REST_ENABLED | default "false" | toBool }} +{{ $WS_DOMAIN := .Env.JVB_WS_DOMAIN | default $PUBLIC_URL_DOMAIN -}} +{{ $WS_SERVER_ID := .Env.JVB_WS_SERVER_ID | default .Env.JVB_WS_SERVER_ID_FALLBACK -}} videobridge { ice { @@ -84,7 +84,6 @@ ice4j { enabled = false {{ end -}} } - static-mappings = [ {{ if .Env.DOCKER_HOST_ADDRESS -}} { diff --git a/jvb/rootfs/etc/cont-init.d/10-config b/jvb/rootfs/etc/cont-init.d/10-config index 769b153..b7ae088 100644 --- a/jvb/rootfs/etc/cont-init.d/10-config +++ b/jvb/rootfs/etc/cont-init.d/10-config @@ -1,8 +1,5 @@ #!/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}') -export SENTRY_RELEASE="${SENTRY_RELEASE:-$(apt-cache policy jitsi-videobridge2 | sed -n '/Installed/p' | sed -e 's/[^:]*: //')}" - if [[ -z $JVB_AUTH_PASSWORD ]]; then echo 'FATAL ERROR: JVB auth password must be set' exit 1 @@ -14,6 +11,16 @@ if [[ "$JVB_AUTH_PASSWORD" == "$OLD_JVB_AUTH_PASSWORD" ]]; then exit 1 fi +# On environments like Swarm the IP address used by the default gateway need not be +# the one used for inter-container traffic. Use that one for our fallback ID. +XMPP_SERVER_IP=$(dig +short ${XMPP_SERVER}) +export JVB_WS_SERVER_ID_FALLBACK=$(ip route get ${XMPP_SERVER_IP} | grep -oP '(?<=src ).*' | awk '{ print $1 '}) + +# Local IP for the ice4j mapping harvester. +export LOCAL_ADDRESS=$(ip route get 1 | grep -oP '(?<=src ).*' | awk '{ print $1 '}) + +export SENTRY_RELEASE="${SENTRY_RELEASE:-$(apt-cache policy jitsi-videobridge2 | sed -n '/Installed/p' | sed -e 's/[^:]*: //')}" + if [[ -f /config/custom-sip-communicator.properties ]]; then cat /config/custom-sip-communicator.properties > /config/sip-communicator.properties fi