10-config 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. #!/usr/bin/with-contenv bash
  2. if [[ -z $JVB_AUTH_PASSWORD ]]; then
  3. echo 'FATAL ERROR: JVB auth password must be set'
  4. exit 1
  5. fi
  6. OLD_JVB_AUTH_PASSWORD=passw0rd
  7. if [[ "$JVB_AUTH_PASSWORD" == "$OLD_JVB_AUTH_PASSWORD" ]]; then
  8. echo 'FATAL ERROR: JVB auth password must be changed, check the README'
  9. exit 1
  10. fi
  11. [ -z "${XMPP_SERVER}" ] && export XMPP_SERVER=xmpp.meet.jitsi
  12. # Migration from DOCKER_HOST_ADDRESS to JVB_ADVERTISE_IPS
  13. if [[ -z "${JVB_ADVERTISE_IPS}" ]]; then
  14. if [[ ! -z "${DOCKER_HOST_ADDRESS}" ]]; then
  15. echo "WARNING: DOCKER_HOST_ADDRESS is deprecated, migrate to JVB_ADVERTISE_IPS"
  16. export JVB_ADVERTISE_IPS=${DOCKER_HOST_ADDRESS}
  17. fi
  18. fi
  19. # On environments like Swarm the IP address used by the default gateway need not be
  20. # the one used for inter-container traffic. Use that one for our fallback ID.
  21. XMPP_SERVER_IP=$(dig +short +search ${XMPP_SERVER})
  22. export JVB_WS_SERVER_ID_FALLBACK=$(ip route get ${XMPP_SERVER_IP} | grep -oP '(?<=src ).*' | awk '{ print $1 '})
  23. # Local IP for the ice4j mapping harvester.
  24. export LOCAL_ADDRESS=$(ip route get 1 | grep -oP '(?<=src ).*' | awk '{ print $1 '})
  25. export SENTRY_RELEASE="${SENTRY_RELEASE:-$(apt-cache policy jitsi-videobridge2 | sed -n '/Installed/p' | sed -e 's/[^:]*: //')}"
  26. if [[ -f /config/custom-sip-communicator.properties ]]; then
  27. cat /config/custom-sip-communicator.properties > /config/sip-communicator.properties
  28. fi
  29. tpl /defaults/logging.properties > /config/logging.properties
  30. tpl /defaults/jvb.conf > /config/jvb.conf
  31. chown -R jvb:jitsi /config
  32. # Configuration checks
  33. if [[ (-z $ENABLE_COLIBRI_WEBSOCKET || $ENABLE_COLIBRI_WEBSOCKET == "0") && $ENABLE_OCTO == "1" ]]; then
  34. echo "ERROR: In order to enable Octo relays (with ENABLE_OCTO=1), you MUST enable Colibri websockets (with ENABLE_COLIBRI_WEBSOCKET=1)";
  35. exit 1;
  36. fi