From 0014a19c2fa77bf87a8d70d1a1b3501483cfe13c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sa=C3=BAl=20Ibarra=20Corretg=C3=A9?= Date: Wed, 3 Oct 2018 07:31:37 +0200 Subject: [PATCH] jvb: simplify setting NAT options --- jvb/rootfs/defaults/sip-communicator.properties | 2 -- jvb/rootfs/etc/cont-init.d/10-config | 9 --------- jvb/rootfs/etc/services.d/jvb/run | 6 ++++++ 3 files changed, 6 insertions(+), 11 deletions(-) diff --git a/jvb/rootfs/defaults/sip-communicator.properties b/jvb/rootfs/defaults/sip-communicator.properties index 670d2b6..dc855c6 100644 --- a/jvb/rootfs/defaults/sip-communicator.properties +++ b/jvb/rootfs/defaults/sip-communicator.properties @@ -2,5 +2,3 @@ org.jitsi.videobridge.AUTHORIZED_SOURCE_REGEXP={{ .Env.JICOFO_AUTH_USER }}@{{ .E org.jitsi.videobridge.SINGLE_PORT_HARVESTER_PORT={{ .Env.JVB_PORT }} org.jitsi.videobridge.DISABLE_TCP_HARVESTER=true org.ice4j.ice.harvest.STUN_MAPPING_HARVESTER_ADDRESSES={{ .Env.JVB_STUN_SERVERS }} -org.ice4j.ice.harvest.NAT_HARVESTER_LOCAL_ADDRESS= -org.ice4j.ice.harvest.NAT_HARVESTER_PUBLIC_ADDRESS= diff --git a/jvb/rootfs/etc/cont-init.d/10-config b/jvb/rootfs/etc/cont-init.d/10-config index 937d03b..8e7b0f4 100644 --- a/jvb/rootfs/etc/cont-init.d/10-config +++ b/jvb/rootfs/etc/cont-init.d/10-config @@ -8,12 +8,3 @@ if [[ ! -f /config/logging.properties ]]; then cp /defaults/logging.properties /config fi -# Do this for every run, since the local IP may change! -if [[ ! -z "$DOCKER_HOST_ADDRESS" ]]; then - LOCAL_ADDRESS=$(hostname -I | cut -d " " -f1) - sed -i \ - -e "s,^org.ice4j.ice.harvest.NAT_HARVESTER_LOCAL_ADDRESS=.*,org.ice4j.ice.harvest.NAT_HARVESTER_LOCAL_ADDRESS=$LOCAL_ADDRESS," \ - -e "s,^org.ice4j.ice.harvest.NAT_HARVESTER_PUBLIC_ADDRESS=.*,org.ice4j.ice.harvest.NAT_HARVESTER_PUBLIC_ADDRESS=$DOCKER_HOST_ADDRESS," \ - /config/sip-communicator.properties -fi - diff --git a/jvb/rootfs/etc/services.d/jvb/run b/jvb/rootfs/etc/services.d/jvb/run index 9a04078..d359708 100644 --- a/jvb/rootfs/etc/services.d/jvb/run +++ b/jvb/rootfs/etc/services.d/jvb/run @@ -1,6 +1,12 @@ #!/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" + +if [[ ! -z "$DOCKER_HOST_ADDRESS" ]]; then + LOCAL_ADDRESS=$(hostname -I | cut -d " " -f1) + 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_OPTS="--domain=$XMPP_DOMAIN --host=$XMPP_SERVER --port=5347 --secret=$JVB_COMPONENT_SECRET"