diff --git a/Dockerfile b/Dockerfile
index dafeb02..7f96e08 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -2,11 +2,12 @@ FROM ubuntu:16.04
MAINTAINER ffdixon@bigbluebutton.org
ENV DEBIAN_FRONTEND noninteractive
-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
+RUN echo 'Acquire::http::Proxy "http://10.0.9.74: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
RUN wget http://ubuntu.bigbluebutton.org/repo/bigbluebutton.asc -O- | apt-key add -
+RUN add-apt-repository ppa:jonathonf/ffmpeg-4 -y
RUN apt-get update && apt-get -y dist-upgrade
# -- Setup tomcat7 to run under docker
@@ -44,6 +45,10 @@ 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
+
# -- Install supervisor to run all the BigBlueButton processes (replaces systemd)
RUN apt-get install -y supervisor
RUN mkdir -p /var/log/supervisor
@@ -53,10 +58,7 @@ ADD supervisord.conf /etc/supervisor/conf.d/supervisord.conf
ADD mod/event_socket.conf.xml /opt/freeswitch/etc/freeswitch/autoload_configs
ADD mod/external.xml /opt/freeswitch/conf/sip_profiles/external.xml
-RUN apt-get install -y coturn vim
-
# -- Finish startup
ADD setup.sh /root/setup.sh
ENTRYPOINT ["/root/setup.sh"]
-# RUN apt-get install -y vim
CMD []
diff --git a/setup.sh b/setup.sh
index cc05e95..4181bbd 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 16384-16484:16384-16484/udp --cap-add=NET_ADMIN ffdixon/play_win -h 192.168.0.130
+# 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
while getopts "eh:" opt; do
case $opt in
@@ -74,11 +74,6 @@ 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///g' \
-# /opt/freeswitch/etc/freeswitch/autoload_configs/switch.conf.xml
-#sed -i 's///g' \
-# /opt/freeswitch/etc/freeswitch/autoload_configs/switch.conf.xml
-
sed -i "s/stun:stun.freeswitch.org/$HOST/g" /opt/freeswitch/etc/freeswitch/vars.xml
sed -i "s/ /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:
+; http://webrtc.github.io/samples/src/content/peerconnection/trickle-ice/
+stunServerAddress=64.233.177.127
+stunServerPort=19302
+
+turnURL=user:password@${HOST}:3478
+
+;pemCertificate is deprecated. Please use pemCertificateRSA instead
+;pemCertificate=
+;pemCertificateRSA=
+;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
+echo "allowed-peer-ip=$IP" >> /etc/turnserver.conf
TURN_SECRET=`openssl rand -hex 16`
+# Configure coturn to handle incoming UDP connections
cat > /etc/turnserver.conf << HERE
denied-peer-ip=0.0.0.0-255.255.255.255
allowed-peer-ip=$IP
@@ -134,42 +148,39 @@ fingerprint
lt-cred-mech
use-auth-secret
static-auth-secret=$TURN_SECRET
+user=user:password
HERE
+# Setup tomcat7 to use the TURN server (wiht matching secret)
cat > /var/lib/tomcat7/webapps/bigbluebutton/WEB-INF/spring/turn-stun-servers.xml << HERE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
HERE
@@ -207,7 +218,6 @@ sed -i 's/daemonize no/daemonize yes/g' /etc/redis/redis.conf
sed -i "s|\"wsUrl.*|\"wsUrl\": \"ws://$HOST/bbb-webrtc-sfu\",|g" \
/usr/share/meteor/bundle/programs/server/assets/app/config/settings-production.json
-
rm /usr/share/red5/log/sip.log
# Add a sleep to each recording process so we can restart with supervisord
@@ -225,5 +235,11 @@ export DAEMON_LOG=/var/log/kurento-media-server
export GST_DEBUG="3,Kurento*:4,kms*:4"
export KURENTO_LOGS_PATH=$DAEMON_LOG
-exec /usr/bin/supervisord -c /etc/supervisor/conf.d/supervisord.conf
+cat << HERE
+
+ BigBlueButton is running at http://$HOST/
+
+HERE
+
+exec /usr/bin/supervisord
diff --git a/supervisord.conf b/supervisord.conf
index 5d9575f..75068aa 100644
--- a/supervisord.conf
+++ b/supervisord.conf
@@ -77,6 +77,13 @@ stderr_logfile=/var/log/supervisor/%(program_name)s.log
user=mongodb
autorestart=true
+[program:bbb-webrtc-sfu]
+command=/usr/bin/node server.js
+directory=/usr/local/bigbluebutton/bbb-webrtc-sfu
+user=bigbluebutton
+group=bigbluebutton
+autorestart=true
+
[program:kurento-media-server]
command=/usr/bin/kurento-media-server
directory=/usr/share/meteor/bundle