mirror of https://github.com/OpenVidu/openvidu.git
deployment-openvidu-ce: Fixed infinite logs in coturn and add new execution mode
parent
08fcdbdb15
commit
de2cbe4836
|
@ -11,4 +11,4 @@ RUN chmod +x /tmp/configuration-files.sh \
|
||||||
&& chmod +x /usr/local/bin/entrypoint.sh \
|
&& chmod +x /usr/local/bin/entrypoint.sh \
|
||||||
&& chmod +x /usr/local/bin/discover_my_public_ip.sh
|
&& chmod +x /usr/local/bin/discover_my_public_ip.sh
|
||||||
|
|
||||||
CMD /usr/local/bin/entrypoint.sh
|
ENTRYPOINT [ "/usr/local/bin/entrypoint.sh" ]
|
|
@ -28,9 +28,15 @@ docker run --rm --name some-redis -d -p 6379:6379 redis
|
||||||
Get the ip of the container and after that, run coturn, you can use url as ip too, in this example I am running coturn with nip.io:
|
Get the ip of the container and after that, run coturn, you can use url as ip too, in this example I am running coturn with nip.io:
|
||||||
|
|
||||||
```
|
```
|
||||||
docker run -it -e REDIS_IP=172.17.0.2 -e DB_NAME=0 -e DB_PASSWORD=turn -e MIN_PORT=40000 -e MAX_PORT=65535 -e TURN_LISTEN_PORT=3478 --network=host coturn-openvidu
|
docker run -it -e REDIS_IP=172.17.0.2 -e DB_NAME=0 -e DB_PASSWORD=turn -e MIN_PORT=40000 -e MAX_PORT=65535 -e TURN_LISTEN_PORT=3478 --network=host openvidu/openvidu-coturn
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Execute turn locally with fixed username and password
|
||||||
|
```
|
||||||
|
docker run -it -e TURN_USERNAME_PASSWORD=<USER>:<PASSWORD> -e MIN_PORT=40000 -e MAX_PORT=65535 -e TURN_LISTEN_PORT=3478 --network=host openvidu/openvidu-coturn
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
# Kubernetes
|
# Kubernetes
|
||||||
|
|
||||||
TODO
|
TODO
|
||||||
|
|
|
@ -13,9 +13,16 @@ fingerprint
|
||||||
lt-cred-mech
|
lt-cred-mech
|
||||||
max-port=${MAX_PORT:-65535}
|
max-port=${MAX_PORT:-65535}
|
||||||
min-port=${MIN_PORT:-40000}
|
min-port=${MIN_PORT:-40000}
|
||||||
|
simple-log
|
||||||
pidfile="/var/run/turnserver.pid"
|
pidfile="/var/run/turnserver.pid"
|
||||||
realm=openvidu
|
realm=openvidu
|
||||||
simple-log
|
|
||||||
redis-userdb="ip=${REDIS_IP} dbname=${DB_NAME} password=${DB_PASSWORD} connect_timeout=30"
|
|
||||||
verbose
|
verbose
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
|
if [[ ! -z "${REDIS_IP}" ]] && [[ ! -z "${DB_NAME}" ]] && [[ ! -z "${DB_PASSWORD}" ]]; then
|
||||||
|
echo "redis-userdb=\"ip=${REDIS_IP} dbname=${DB_NAME} password=${DB_PASSWORD} connect_timeout=30\"" >> /etc/turnserver.conf
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ ! -z "${TURN_USERNAME_PASSWORD}" ]]; then
|
||||||
|
echo "user=${TURN_USERNAME_PASSWORD}" >> /etc/turnserver.conf
|
||||||
|
fi
|
|
@ -12,12 +12,6 @@ echo "TURN public IP: ${TURN_PUBLIC_IP}"
|
||||||
[[ ! -z "${TURN_LISTEN_PORT}" ]] && echo "TURN listening port: ${TURN_LISTEN_PORT}" ||
|
[[ ! -z "${TURN_LISTEN_PORT}" ]] && echo "TURN listening port: ${TURN_LISTEN_PORT}" ||
|
||||||
{ echo "TURN_LISTEN_PORT environment variable is not defined"; exit 1; }
|
{ echo "TURN_LISTEN_PORT environment variable is not defined"; exit 1; }
|
||||||
|
|
||||||
[[ ! -z "${REDIS_IP}" ]] && echo "REDIS IP: ${REDIS_IP}" || { echo "REDIS_IP environment variable is not defined"; exit 1; }
|
|
||||||
|
|
||||||
[[ ! -z "${DB_NAME}" ]] || { echo "DB_NAME environment variable is not defined"; exit 1; }
|
|
||||||
|
|
||||||
[[ ! -z "${DB_PASSWORD}" ]] || { echo "DB_PASSWORD environment variable is not defined"; exit 1; }
|
|
||||||
|
|
||||||
[[ ! -z "${MIN_PORT}" ]] && echo "Defined min port coturn: ${MIN_PORT}" || echo "Min port coturn: 40000"
|
[[ ! -z "${MIN_PORT}" ]] && echo "Defined min port coturn: ${MIN_PORT}" || echo "Min port coturn: 40000"
|
||||||
|
|
||||||
[[ ! -z "${MAX_PORT}" ]] && echo "Defined max port coturn: ${MAX_PORT}" || echo "Max port coturn: 65535"
|
[[ ! -z "${MAX_PORT}" ]] && echo "Defined max port coturn: ${MAX_PORT}" || echo "Max port coturn: 65535"
|
||||||
|
@ -28,19 +22,4 @@ source /tmp/configuration-files.sh
|
||||||
# Remove temp file with configuration parameters
|
# Remove temp file with configuration parameters
|
||||||
rm /tmp/configuration-files.sh
|
rm /tmp/configuration-files.sh
|
||||||
|
|
||||||
# Save coturn External IP for other services
|
/usr/bin/turnserver -c /etc/turnserver.conf -v --log-file /dev/null
|
||||||
|
|
||||||
|
|
||||||
# Execute turn daemon
|
|
||||||
/usr/bin/turnserver -c /etc/turnserver.conf -v &
|
|
||||||
|
|
||||||
|
|
||||||
MAX_SECONDS=30
|
|
||||||
# K8s only show turn server log in this way
|
|
||||||
while [ -z $(ls /var/log/ | grep turn_) ] && [ $SECONDS -lt $MAX_SECONDS ]
|
|
||||||
do
|
|
||||||
echo "Waiting turnserver to be running"
|
|
||||||
sleep 2
|
|
||||||
done
|
|
||||||
|
|
||||||
tail -f /var/log/turn_*.log
|
|
Loading…
Reference in New Issue