From 726683b62c7172ebc53fa85ebf8edd7db7d0e8cb Mon Sep 17 00:00:00 2001 From: Fred Dixon Date: Sat, 28 Jul 2018 22:40:33 -0400 Subject: [PATCH 1/3] Local changes --- Dockerfile | 7 ++----- setup.sh | 16 ++++++++++------ supervisord.conf | 2 +- 3 files changed, 13 insertions(+), 12 deletions(-) diff --git a/Dockerfile b/Dockerfile index 7f96e08..6a0f3b6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,7 +2,7 @@ FROM ubuntu:16.04 MAINTAINER ffdixon@bigbluebutton.org ENV DEBIAN_FRONTEND noninteractive -RUN echo 'Acquire::http::Proxy "http://10.0.9.74:3142 ";' > /etc/apt/apt.conf.d/01proxy +RUN echo 'Acquire::http::Proxy "http://192.168.0.130:3142 ";' > /etc/apt/apt.conf.d/01proxy RUN apt-get update && apt-get install -y wget software-properties-common RUN echo "deb http://ubuntu.bigbluebutton.org/xenial-200 bigbluebutton-xenial main " | tee /etc/apt/sources.list.d/bigbluebutton.list @@ -44,10 +44,7 @@ RUN apt-get update && apt-get install -y nodejs # -- Install HTML5 client RUN apt-get install -y bbb-html5 - -RUN echo 'Acquire::http::Proxy "http://192.168.0.16:3142 ";' > /etc/apt/apt.conf.d/01proxy -RUN apt-get update -RUN apt-get install -y coturn vim +RUN apt-get install -y coturn vim mlocate # -- Install supervisor to run all the BigBlueButton processes (replaces systemd) RUN apt-get install -y supervisor diff --git a/setup.sh b/setup.sh index 4181bbd..dc85b1e 100755 --- a/setup.sh +++ b/setup.sh @@ -23,7 +23,7 @@ change_var_value () { sed -i "s<^[[:blank:]#]*\(${2}\).*<\1=${3}<" $1 } -# docker run -p 80:80/tcp -p 443:443/tcp -p 1935:1935/tcp -p 5066:5066/tcp -p 3478:3478/udp -p 3478:3478/tcp --cap-add=NET_ADMIN bigbluebutton/d2 -h 10.0.9.74 +# docker run -p 80:80/tcp -p 443:443/tcp -p 1935:1935/tcp -p 5066:5066/tcp -p 3478:3478/udp -p 3478:3478/tcp --cap-add=NET_ADMIN bigbluebutton/d2 -h 192.168.0.130 while getopts "eh:" opt; do case $opt in @@ -120,10 +120,10 @@ cat > /etc/kurento/modules/kurento/WebRtcEndpoint.conf.ini << HERE ; You have to find a valid stun server. You can check if it works ; usin this tool: ; http://webrtc.github.io/samples/src/content/peerconnection/trickle-ice/ -stunServerAddress=64.233.177.127 -stunServerPort=19302 +;stunServerAddress=64.233.177.127 +;stunServerPort=19302 -turnURL=user:password@${HOST}:3478 +turnURL=kurento:kurento@${HOST}:3478 ;pemCertificate is deprecated. Please use pemCertificateRSA instead ;pemCertificate= @@ -149,6 +149,7 @@ lt-cred-mech use-auth-secret static-auth-secret=$TURN_SECRET user=user:password +log-file=/var/log/turn.log HERE # Setup tomcat7 to use the TURN server (wiht matching secret) @@ -237,9 +238,12 @@ export KURENTO_LOGS_PATH=$DAEMON_LOG cat << HERE - BigBlueButton is running at http://$HOST/ +BigBlueButton is running at + + http://$HOST HERE -exec /usr/bin/supervisord +updatedb +exec /usr/bin/supervisord > /var/log/supervisord.log diff --git a/supervisord.conf b/supervisord.conf index 75068aa..f6fcba7 100644 --- a/supervisord.conf +++ b/supervisord.conf @@ -108,5 +108,5 @@ command=/usr/lib/jvm/java-1.8.0-openjdk-amd64/jre/bin/java -Djava.util.logging.c startsecs = 0 autorestart = false user=turnserver -command=/usr/bin/turnserver -c /etc/turnserver.conf +command=/usr/bin/turnserver -c /etc/turnserver.conf -u kurento:kurento From 9266b568885f1099ea3f1d61f92c7f2ce0a2ebad Mon Sep 17 00:00:00 2001 From: Fred Dixon Date: Sun, 29 Jul 2018 11:20:10 -0400 Subject: [PATCH 2/3] Updated setup.sh to configure coturn server --- setup.sh | 38 ++++++++++---------------------------- 1 file changed, 10 insertions(+), 28 deletions(-) diff --git a/setup.sh b/setup.sh index dc85b1e..cb11ef9 100755 --- a/setup.sh +++ b/setup.sh @@ -24,6 +24,7 @@ change_var_value () { } # docker run -p 80:80/tcp -p 443:443/tcp -p 1935:1935/tcp -p 5066:5066/tcp -p 3478:3478/udp -p 3478:3478/tcp --cap-add=NET_ADMIN bigbluebutton/d2 -h 192.168.0.130 +# docker run -p 80:80/tcp -p 443:443/tcp -p 1935:1935 -p 5066:5066 -p 3478:3478 -p 3478:3478/udp b2 -h 192.168.0.130 while getopts "eh:" opt; do case $opt in @@ -64,27 +65,19 @@ while [ ! -f /var/lib/tomcat7/webapps/demo/bbb_api_conf.jsp ]; do sleep 1; done sudo /etc/init.d/tomcat7 stop -# Setup loopback address so FreeSWITCH can bind WS-BIND-URL to host IP -# -sudo ip addr add $HOST dev lo - # Setup the BigBlueButton configuration files # PROTOCOL_HTTP=http PROTOCOL_RTMP=rtmp + IP=$(echo "$(LANG=c ifconfig | awk -v RS="" '{gsub (/\n[ ]*inet /," ")}1' | grep ^et.* | grep addr: | head -n1 | sed 's/.*addr://g' | sed 's/ .*//g')$(LANG=c ifconfig | awk -v RS="" '{gsub (/\n[ ]*inet /," ")}1' | grep ^en.* | grep addr: | head -n1 | sed 's/.*addr://g' | sed 's/ .*//g')" | head -n1) -sed -i "s/stun:stun.freeswitch.org/$HOST/g" /opt/freeswitch/etc/freeswitch/vars.xml -sed -i "s//g" /opt/freeswitch/conf/sip_profiles/external.xml +xmlstarlet edit --inplace --update '//X-PRE-PROCESS[@cmd="set" and starts-with(@data, "external_rtp_ip=")]/@data' --value "stun:coturn" /opt/freeswitch/conf/vars.xml +xmlstarlet edit --inplace --update '//X-PRE-PROCESS[@cmd="set" and starts-with(@data, "external_sip_ip=")]/@data' --value "stun:coturn" /opt/freeswitch/conf/vars.xml +xmlstarlet edit --inplace --update '//X-PRE-PROCESS[@cmd="set" and starts-with(@data, "local_ip_v4=")]/@data' --value "${IP}" /opt/freeswitch/conf/vars.xml sed -i "s/proxy_pass .*/proxy_pass $PROTOCOL_HTTP:\/\/$IP:5066;/g" /etc/bigbluebutton/nginx/sip.nginx -#sed -i "s/porttest host=\(\"[^\"]*\"\)/porttest host=\"$HOST\"/g" /var/www/bigbluebutton/client/conf/config.xml -sed -i "s/publishURI=\"[^\"]*\"/publishURI=\"$HOST\"/" /var/www/bigbluebutton/client/conf/config.xml sed -i "s/http[s]*:\/\/\([^\"\/]*\)\([\"\/]\)/$PROTOCOL_HTTP:\/\/$HOST\2/g" /var/www/bigbluebutton/client/conf/config.xml sed -i "s/rtmp[s]*:\/\/\([^\"\/]*\)\([\"\/]\)/$PROTOCOL_RTMP:\/\/$HOST\2/g" /var/www/bigbluebutton/client/conf/config.xml @@ -110,15 +103,10 @@ sed -i "s/deskshareip[ ]*=[ ]*\"[^\"]*\"/deskshareip=\"$HOST\"/g" \ sed -i "s/defaultPresentationURL[ ]*=[ ]*\"[^\"]*\"/defaultPresentationURL=\"${PROTOCOL_HTTP}:\/\/$HOST\/default.pdf\"/g" \ /usr/share/bbb-apps-akka/conf/application.conf -#cat > /etc/kurento/modules/kurento/BaseRtpEndpoint.conf.ini << HERE -#minPort=16435 -#maxPort=16484 -#HERE - cat > /etc/kurento/modules/kurento/WebRtcEndpoint.conf.ini << HERE ; Only IP address are supported, not domain names for addresses ; You have to find a valid stun server. You can check if it works -; usin this tool: +; using this tool: ; http://webrtc.github.io/samples/src/content/peerconnection/trickle-ice/ ;stunServerAddress=64.233.177.127 ;stunServerPort=19302 @@ -131,13 +119,6 @@ turnURL=kurento:kurento@${HOST}:3478 ;pemCertificateECDSA= HERE -#sed -i 's/.*stunServerAddress.*/stunServerAddress=64.233.177.127/g' /etc/kurento/modules/kurento/WebRtcEndpoint.conf.ini -#sed -i 's/.*stunServerPort.*/stunServerPort=19302/g' /etc/kurento/modules/kurento/WebRtcEndpoint.conf.ini -#sed -i 's/.*turnURL*/turnURL=user:password@$IP:3478/g' /etc/kurento/modules/kurento/WebRtcEndpoint.conf.ini - -echo "denied-peer-ip=0.0.0.0-255.255.255.255" >> /etc/turnserver.conf -echo "allowed-peer-ip=$IP" >> /etc/turnserver.conf - TURN_SECRET=`openssl rand -hex 16` # Configure coturn to handle incoming UDP connections @@ -152,7 +133,7 @@ user=user:password log-file=/var/log/turn.log HERE -# Setup tomcat7 to use the TURN server (wiht matching secret) +# Setup tomcat7 to share the TURN server information with clients (with matching secret) cat > /var/lib/tomcat7/webapps/bigbluebutton/WEB-INF/spring/turn-stun-servers.xml << HERE /opt/freeswitch/conf/autoload_configs/acl.conf.xml << HERE HERE -# Fix to ensure application.conf has the latest shared secret +# Ensure bbb-apps-akka has the latest shared secret from bbb-web SECRET=$(cat /var/lib/tomcat7/webapps/bigbluebutton/WEB-INF/classes/bigbluebutton.properties | grep -v '#' | grep securitySalt | cut -d= -f2); sed -i "s/sharedSecret[ ]*=[ ]*\"[^\"]*\"/sharedSecret=\"$SECRET\"/g" \ /usr/share/bbb-apps-akka/conf/application.conf @@ -222,6 +203,7 @@ sed -i "s|\"wsUrl.*|\"wsUrl\": \"ws://$HOST/bbb-webrtc-sfu\",|g" \ rm /usr/share/red5/log/sip.log # Add a sleep to each recording process so we can restart with supervisord +# (This works around the limitation that supervisord can't restart after intervals) sed -i 's/BigBlueButton.logger.debug("rap-archive-worker done")/sleep 20; BigBlueButton.logger.debug("rap-archive-worker done")/g' /usr/local/bigbluebutton/core/scripts/rap-archive-worker.rb sed -i 's/BigBlueButton.logger.debug("rap-process-worker done")/sleep 20; BigBlueButton.logger.debug("rap-process-worker done")/g' /usr/local/bigbluebutton/core/scripts/rap-process-worker.rb sed -i 's/BigBlueButton.logger.debug("rap-sanity-worker done")/sleep 20 ; BigBlueButton.logger.debug("rap-sanity-worker done")/g' /usr/local/bigbluebutton/core/scripts/rap-sanity-worker.rb @@ -238,7 +220,7 @@ export KURENTO_LOGS_PATH=$DAEMON_LOG cat << HERE -BigBlueButton is running at +BigBlueButton is now starting up at this address http://$HOST From 1032ea5f5e86a5d30a42237c9aae5553ae066127 Mon Sep 17 00:00:00 2001 From: Fred Dixon Date: Fri, 10 Aug 2018 10:54:33 +0100 Subject: [PATCH 3/3] Updates to README --- README.md | 4 ++-- setup.sh | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index b0a400d..c5b6f85 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,11 @@ # Overview -This repository contains the scripts create a single docker container running BigBlueButton. +Note: This branch contains work in progress for incorporating the HTML5 client into the Docker image. To run BigBlueButton in Docker, run the command ~~~ -docker run -p 80:80/tcp -p 1935:1935/tcp -p 5066:5066/tcp -p 16384-16484:16384-16484/udp -p 2202:2202 --cap-add=NET_ADMIN --name bigbluebutton bigbluebutton/bigbluebutton -h +docker run -p 80:80/tcp -p 443:443/tcp -p 1935:1935 -p 5066:5066 -p 3478:3478 -p 3478:3478/udp b2 -h ~~~ Make sure you provide the host IP at the end of the command. This will take some time to pull the image from Docker hub. diff --git a/setup.sh b/setup.sh index cb11ef9..9ab6427 100755 --- a/setup.sh +++ b/setup.sh @@ -23,7 +23,6 @@ change_var_value () { sed -i "s<^[[:blank:]#]*\(${2}\).*<\1=${3}<" $1 } -# docker run -p 80:80/tcp -p 443:443/tcp -p 1935:1935/tcp -p 5066:5066/tcp -p 3478:3478/udp -p 3478:3478/tcp --cap-add=NET_ADMIN bigbluebutton/d2 -h 192.168.0.130 # docker run -p 80:80/tcp -p 443:443/tcp -p 1935:1935 -p 5066:5066 -p 3478:3478 -p 3478:3478/udp b2 -h 192.168.0.130 while getopts "eh:" opt; do