2020-06-06 14:39:31 +02:00
|
|
|
#!/bin/bash
|
|
|
|
set -e
|
|
|
|
|
|
|
|
cd $(dirname $0)/..
|
|
|
|
|
|
|
|
# load .env
|
|
|
|
if [ -f .env ]
|
|
|
|
then
|
2020-07-13 16:34:09 +02:00
|
|
|
# exclude WELCOME_MESSAGE && WELCOME_FOOTER because it may contain invalid characters
|
|
|
|
export $(cat .env | sed 's/#.*//g' | grep -v "WELCOME_FOOTER" | grep -v "WELCOME_MESSAGE" | xargs)
|
2020-06-06 14:39:31 +02:00
|
|
|
fi
|
|
|
|
|
2020-07-30 12:12:13 +02:00
|
|
|
# check for non-optional environment variables,
|
|
|
|
# which got introduced later and may miss in existing
|
|
|
|
# .env files during upgrades
|
|
|
|
if [ -z "$EXTERNAL_IPv4" ]; then
|
|
|
|
echo "ERROR: EXTERNAL_IPv4 is not set in .env"
|
|
|
|
echo "BBB won't work without it."
|
|
|
|
echo "this can happen if you did an manual upgrade without executing"
|
|
|
|
echo " ./scripts/upgrade"
|
|
|
|
echo "try to run it again"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2020-07-30 12:12:36 +02:00
|
|
|
# set conditional variables
|
2020-07-22 23:02:50 +02:00
|
|
|
export CERTIFICATE_DOMAINS=$DOMAIN
|
2020-07-27 18:45:04 +02:00
|
|
|
export GREENLIGHT_ENDPOINT=https://$DOMAIN/bigbluebutton/api/
|
2020-07-22 23:02:50 +02:00
|
|
|
if [ "$DEV_MODE" == true ]; then
|
|
|
|
export CERTIFICATE_DOMAINS="invalid"
|
2020-07-27 18:45:04 +02:00
|
|
|
export GREENLIGHT_ENDPOINT=http://10.7.7.1:8080/bigbluebutton/api/
|
2020-07-22 23:02:50 +02:00
|
|
|
fi
|
2020-07-30 12:12:36 +02:00
|
|
|
if [ ! -z "$EXTERNAL_IPv6" ]; then
|
|
|
|
export HTTPS_SITE_FILE="site.conf"
|
|
|
|
else
|
|
|
|
export HTTPS_SITE_FILE="site-ipv4only.conf"
|
|
|
|
fi
|
2020-07-22 23:02:50 +02:00
|
|
|
|
2020-06-06 14:39:31 +02:00
|
|
|
# concatenate docker-compose file
|
|
|
|
COMPOSE_FILES="-f docker-compose.yml"
|
|
|
|
if [ "$ENABLE_HTTPS_PROXY" == true ]; then
|
|
|
|
COMPOSE_FILES="$COMPOSE_FILES -f docker-compose.https.yml"
|
|
|
|
fi
|
2020-06-07 13:58:56 +02:00
|
|
|
|
|
|
|
if [ "$ENABLE_COTURN" == true ]; then
|
|
|
|
COMPOSE_FILES="$COMPOSE_FILES -f docker-compose.coturn.yml"
|
|
|
|
fi
|
|
|
|
|
2020-06-06 14:39:31 +02:00
|
|
|
if [ "$ENABLE_GREENLIGHT" == true ]; then
|
|
|
|
COMPOSE_FILES="$COMPOSE_FILES -f docker-compose.greenlight.yml"
|
|
|
|
fi
|
|
|
|
|
2020-06-30 19:44:20 +02:00
|
|
|
if [ "$ENABLE_WEBHOOKS" == true ]; then
|
|
|
|
COMPOSE_FILES="$COMPOSE_FILES -f docker-compose.webhooks.yml"
|
|
|
|
fi
|
|
|
|
|
2020-07-24 19:08:17 +02:00
|
|
|
if [ "$ENABLE_PROMETHEUS_EXPORTER" == true ]; then
|
|
|
|
COMPOSE_FILES="$COMPOSE_FILES -f docker-compose.prometheus.yml"
|
|
|
|
fi
|
|
|
|
|
2020-08-15 03:26:33 +02:00
|
|
|
if [ "$ENABLE_RECORDING" == true ]; then
|
2020-08-27 10:47:33 +02:00
|
|
|
COMPOSE_FILES="$COMPOSE_FILES -f docker-compose.recordings.yml"
|
2020-08-15 03:26:33 +02:00
|
|
|
fi
|
|
|
|
|
2020-06-06 14:39:31 +02:00
|
|
|
docker-compose $COMPOSE_FILES $@
|