cruizba ceb58d28be Fix OPENVIDU_URL in insecure docker tutorials
OPENVIDU_URL is used properly in docker images serving nginx static insecure tutorials.
Before, location.hostname was always used
2021-10-15 00:48:24 +02:00

17 lines
601 B
Bash

#!/bin/sh
[ ! -z "${OPENVIDU_URL}" ] && echo "OPENVIDU_URL: ${OPENVIDU_URL}" || echo "OPENVIDU_URL: default"
[ ! -z "${OPENVIDU_SECRET}" ] && echo "OPENVIDU_SECRET: ${OPENVIDU_SECRET}" || echo "OPENVIDU_SECRET: default"
sed -i "s|^var OPENVIDU_SERVER_URL =.*$|var OPENVIDU_SERVER_URL = \"${OPENVIDU_URL}\";|" /var/www/openvidu-getaroom/app.js
if [ ! -z "${OPENVIDU_SECRET}" ]; then
sed -i "s/^var OPENVIDU_SERVER_SECRET =.*$/var OPENVIDU_SERVER_SECRET = \"${OPENVIDU_SECRET}\";/" /var/www/openvidu-getaroom/app.js
fi
# Run nginx
nginx -g "daemon on;"
# Show logs
tail -f /var/log/nginx/*.log