Skip to content

Commit

Permalink
Work in progress on getting the latest HTML5 client to run in Docker
Browse files Browse the repository at this point in the history
  • Loading branch information
ffdixon committed Jun 7, 2018
1 parent 0f322af commit cf8a791
Show file tree
Hide file tree
Showing 4 changed files with 57 additions and 27 deletions.
9 changes: 5 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ FROM ubuntu:16.04
MAINTAINER [email protected]

ENV DEBIAN_FRONTEND noninteractive
# RUN echo 'Acquire::http::Proxy "http://192.168.0.130: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

RUN echo "deb http://ubuntu.bigbluebutton.org/xenial-200 bigbluebutton-xenial main " | tee /etc/apt/sources.list.d/bigbluebutton.list
RUN echo "deb http://ubuntu.bigbluebutton.org/xenial-200-dev 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 apt-get update && apt-get -y dist-upgrade

Expand Down Expand Up @@ -37,8 +37,8 @@ RUN sudo apt-get update && sudo apt-get install -y mongodb-org curl
# -- Install nodejs (for HTML5 client)
RUN apt-get install -y apt-transport-https
RUN curl -s https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add -
RUN echo 'deb http://deb.nodesource.com/node_6.x xenial main' > /etc/apt/sources.list.d/nodesource.list
RUN echo 'deb-src http://deb.nodesource.com/node_6.x xenial main' >> /etc/apt/sources.list.d/nodesource.list
RUN echo 'deb http://deb.nodesource.com/node_8.x xenial main' > /etc/apt/sources.list.d/nodesource.list
RUN echo 'deb-src http://deb.nodesource.com/node_8.x xenial main' >> /etc/apt/sources.list.d/nodesource.list
RUN apt-get update && apt-get install -y nodejs

# -- Install HTML5 client
Expand All @@ -55,4 +55,5 @@ ADD mod/event_socket.conf.xml /opt/freeswitch/etc/freeswitch/autoload_configs
# -- Finish startup
ADD setup.sh /root/setup.sh
ENTRYPOINT ["/root/setup.sh"]
RUN apt-get install -y vim
CMD []
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
# Overview

These are scripts to run BigBlueButton within Docker.
This repository contains the scripts create a single docker container running BigBlueButton.

For detailed instructions on how to setup BigBlueButton in Docker, see the [setup instructions](http://docs.bigbluebutton.org/labs/docker.html).

To run BigBlueButton in Docker with a single command, run:
To run BigBlueButton in Docker, run the command

~~~
docker run -p 80:80/tcp -p 1935:1935/tcp -p 5066:5066/tcp -p 32730-32768:32730-32768/udp -p 2202:2202 --cap-add=NET_ADMIN --name bigbluebutton bigbluebutton/bigbluebutton -h <YOUR_HOST_IP>
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 <YOUR_HOST_IP>
~~~

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.

For details see the [setup instructions](http://docs.bigbluebutton.org/labs/docker.html).

Once running, you can navigate to `http://<YOUR_HOST_IP>` to access your BigBlueButton server.

## Keep in mind...
## Future Plans

Our goal was to allow people to try a BigBlueButton server with a single command. This is not meant for production use, but rather for testing and trying out BigBlueButton.
Our goal was to allow developers to run BigBlueButton server with a single command. This Docker image is not meant for production use, but rather for testing and trying out BigBlueButton.

We may work on a production-ready version that seperates the BigBlueButton components into containers using [docker-compose](https://github.com/docker/compose) in the future.
Still, it good step towards separating BigBlueButton into individual components for running under docker-compose or kubernetes.
48 changes: 35 additions & 13 deletions setup.sh
Original file line number Diff line number Diff line change
@@ -1,13 +1,29 @@
#!/bin/bash

#
# BlueButton open source conferencing system - http://www.bigbluebutton.org/
#
# Copyright (c) 2018 BigBlueButton Inc.
#
# This program is free software; you can redistribute it and/or modify it under the
# terms of the GNU Lesser General Public License as published by the Free Software
# Foundation; either version 3.0 of the License, or (at your option) any later
# version.
#
# BigBlueButton is distributed in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License along
# with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
#
set -x

change_var_value () {
sed -i "s<^[[:blank:]#]*\(${2}\).*<\1=${3}<" $1
}

# docker build -t ffdixon/play_win .
# docker run -p 80:80/tcp -p 443:443/tcp -p 1935:1935/tcp -p 5066:5066/tcp -p 2202:2202 -p 32750-32768:32750-32768/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 2202:2202 -p 32750-32768:32750-32768/udp --cap-add=NET_ADMIN ffdixon/play_win -h 192.168.10.186
# 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

while getopts "eh:" opt; do
case $opt in
Expand Down Expand Up @@ -58,8 +74,10 @@ 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/<!-- <param name="rtp-start-port" value="16384"\/> -->/<param name="rtp-start-port" value="32750"\/>/g' /opt/freeswitch/etc/freeswitch/autoload_configs/switch.conf.xml
sed -i 's/<!-- <param name="rtp-end-port" value="32768"\/> -->/<param name="rtp-end-port" value="32768"\/>/g' /opt/freeswitch/etc/freeswitch/autoload_configs/switch.conf.xml
sed -i 's/<param name="rtp-start-port" value="[^"]*"\/>/<param name="rtp-start-port" value="16384"\/>/g' \
/opt/freeswitch/etc/freeswitch/autoload_configs/switch.conf.xml
sed -i 's/<param name="rtp-end-port" value="[^"]*"\/>/<param name="rtp-end-port" value="16434"\/>/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/<X-PRE-PROCESS cmd=\"set\" data=\"local_ip_v4=.*//g" /opt/freeswitch/etc/freeswitch/vars.xml
Expand All @@ -70,15 +88,15 @@ sed -i "s/<param name=\"ws-binding\".*/<param name=\"ws-binding\" value=\"$HOST

sed -i "s/proxy_pass .*/proxy_pass $PROTOCOL_HTTP:\/\/$HOST: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/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

sed -i "s/server_name .*/server_name $HOST;/g" /etc/nginx/sites-available/bigbluebutton

sed -i "s/bigbluebutton.web.serverURL=http[s]*:\/\/.*/bigbluebutton.web.serverURL=$PROTOCOL_HTTP:\/\/$HOST/g" \
/var/lib/tomcat7/webapps/bigbluebutton/WEB-INF/classes/bigbluebutton.properties
/var/lib/tomcat7/webapps/bigbluebutton/WEB-INF/classes/bigbluebutton.properties

change_var_value /usr/share/red5/webapps/screenshare/WEB-INF/screenshare.properties streamBaseUrl rtmp://$HOST/screenshare
change_var_value /usr/share/red5/webapps/screenshare/WEB-INF/screenshare.properties jnlpUrl $PROTOCOL_HTTP://$HOST/screenshare
Expand All @@ -88,26 +106,30 @@ change_var_value /usr/share/red5/webapps/sip/WEB-INF/bigbluebutton-sip.propertie
change_var_value /usr/share/red5/webapps/sip/WEB-INF/bigbluebutton-sip.properties freeswitch.ip $IP

sed -i "s/bbbWebAPI[ ]*=[ ]*\"[^\"]*\"/bbbWebAPI=\"${PROTOCOL_HTTP}:\/\/$HOST\/bigbluebutton\/api\"/g" \
/usr/share/bbb-apps-akka/conf/application.conf
/usr/share/bbb-apps-akka/conf/application.conf
sed -i "s/bbbWebHost[ ]*=[ ]*\"[^\"]*\"/bbbWebHost=\"$HOST\"/g" \
/usr/share/bbb-apps-akka/conf/application.conf
/usr/share/bbb-apps-akka/conf/application.conf
sed -i "s/deskshareip[ ]*=[ ]*\"[^\"]*\"/deskshareip=\"$HOST\"/g" \
/usr/share/bbb-apps-akka/conf/application.conf
/usr/share/bbb-apps-akka/conf/application.conf
sed -i "s/defaultPresentationURL[ ]*=[ ]*\"[^\"]*\"/defaultPresentationURL=\"${PROTOCOL_HTTP}:\/\/$HOST\/default.pdf\"/g" \
/usr/share/bbb-apps-akka/conf/application.conf
/usr/share/bbb-apps-akka/conf/application.conf

# Fix to ensure application.conf has the latest shared secret
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
/usr/share/bbb-apps-akka/conf/application.conf

sed -i "s/BigBlueButtonURL = \"http[s]*:\/\/\([^\"\/]*\)\([\"\/]\)/BigBlueButtonURL = \"$PROTOCOL_HTTP:\/\/$HOST\2/g" \
/var/lib/tomcat7/webapps/demo/bbb_api_conf.jsp
/var/lib/tomcat7/webapps/demo/bbb_api_conf.jsp

sed -i "s/playback_host: .*/playback_host: $HOST/g" /usr/local/bigbluebutton/core/scripts/bigbluebutton.yml

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
Expand Down
11 changes: 9 additions & 2 deletions supervisord.conf
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,18 @@ stderr_logfile=/var/log/supervisor/%(program_name)s.log
user=mongodb
autorestart=true

[program:kurento-media-server]
command=/usr/bin/kurento-media-server
directory=/usr/share/meteor/bundle
user=kurento
group=kurento
autorestart=true

[program:bbb-html5]
command=/usr/share/meteor/bundle/systemd_start.sh
directory=/usr/share/meteor/bundle
user=meteor
group=meteor
#user=meteor
#group=meteor
autorestart=true

[program:tomcat7]
Expand Down

0 comments on commit cf8a791

Please sign in to comment.