diff --git a/docker-compose.yml b/docker-compose.yml index 84392b0..3577395 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -23,8 +23,6 @@ services: - '5222' - '5347' - '5280' - ports: - - '127.0.0.1:5347:5347' volumes: - ${CONFIG}/prosody:/config environment: @@ -63,13 +61,15 @@ services: volumes: - ${CONFIG}/jvb:/config environment: + - DOCKER_HOST_ADDRESS - XMPP_DOMAIN - - XMPP_SERVER=127.0.0.1 + - XMPP_SERVER=xmpp.meet.jitsi - JVB_COMPONENT_SECRET - JVB_STUN_SERVERS - JICOFO_AUTH_USER - TZ - network_mode: 'host' + networks: + meet.jitsi: # Custom network so all services can communicate using a FQDN networks: diff --git a/jvb/rootfs/defaults/sip-communicator.properties b/jvb/rootfs/defaults/sip-communicator.properties index b4f816e..23c6e67 100644 --- a/jvb/rootfs/defaults/sip-communicator.properties +++ b/jvb/rootfs/defaults/sip-communicator.properties @@ -1,3 +1,5 @@ org.jitsi.videobridge.AUTHORIZED_SOURCE_REGEXP=${JICOFO_AUTH_USER}@auth.${XMPP_DOMAIN}/.* org.jitsi.videobridge.TCP_HARVESTER_PORT=4443 org.ice4j.ice.harvest.STUN_MAPPING_HARVESTER_ADDRESSES=${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 3bc5183..ce1339d 100644 --- a/jvb/rootfs/etc/cont-init.d/10-config +++ b/jvb/rootfs/etc/cont-init.d/10-config @@ -13,3 +13,12 @@ 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 +