Skip to content

Commit e6586f2

Browse files
authored
jvb: set LOCAL_ADDRESS to the correct local IP (jitsi#630)
NAT_HARVESTER_LOCAL_ADDRESS needs to bet set to the local IP that is actually used to communicate with clients. In Docker containers "hostname -I" returns the IPs of all interfaces. The order of the IPs depends on the interface create order. Docker makes no guarantees about the interface order and in my tests it is random. As a result NAT_HARVESTER_LOCAL_ADDRESS is sometimes set to the IP of the internal meet.jitsi interface. Fix this by setting it to the source IP used for routing to $DOCKER_HOST_ADDRESS Adds 2803 kB disk space for iproute2 and dependencies. Partly addresses jitsi#338
1 parent 97f5e75 commit e6586f2

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

jvb/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ FROM ${JITSI_REPO}/base-java
33

44
RUN \
55
apt-dpkg-wrap apt-get update && \
6-
apt-dpkg-wrap apt-get install -y jitsi-videobridge2 jq curl && \
6+
apt-dpkg-wrap apt-get install -y jitsi-videobridge2 jq curl iproute2 && \
77
apt-cleanup
88

99
COPY rootfs/ /

jvb/rootfs/etc/services.d/jvb/run

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
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"
44

55
if [[ ! -z "$DOCKER_HOST_ADDRESS" ]]; then
6-
LOCAL_ADDRESS=$(hostname -I | cut -d " " -f1)
6+
LOCAL_ADDRESS=$(ip route get "$DOCKER_HOST_ADDRESS" | head -n1 | cut -d " " -f7)
77
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"
88
fi
99

0 commit comments

Comments
 (0)