Skip to content

Instantly share code, notes, and snippets.

@mariogasparoni
Last active March 24, 2022 19:55
Show Gist options
  • Save mariogasparoni/f8b4542aa4bdfe9b5f4dfaf31d739742 to your computer and use it in GitHub Desktop.
Save mariogasparoni/f8b4542aa4bdfe9b5f4dfaf31d739742 to your computer and use it in GitHub Desktop.
Setup a development environment for BigBlueButton 2.5

Setup development environment for BigBlueButton 2.5

A few considerations before we start:

  • Required OS: Ubuntu 20.04 (focal)
  • This is intended to run on containers/local-machine setup, such as LXC (don't use it in Production servers)
  • This process is similar to BBB 2.4's install.
  • For public/production servers, we recommend installing BigBlueButton using bbb-install.sh

We'll do this in 3 steps:

Install BBB 2.5

Install basic deps

Install needed tools

sudo apt-get update && sudo apt-get install curl wget net-tools software-properties-common haveged apt-transport-https -y

Add needed repositories

sudo add-apt-repository ppa:bigbluebutton/support -y
sudo add-apt-repository ppa:libreoffice/ppa

Upgrade packages

sudo apt-get update && sudo apt-get dist-upgrade

Install yq

sudo wget https://github.com/mikefarah/yq/releases/download/3.4.1/yq_linux_amd64 -O /usr/bin/yq && sudo chmod +x /usr/bin/yq

Install MongoDB

(Note: BBB 2.5 uses MongoDB 4.4, while BBB 2.4 uses MongoDB 4.2)

Add key for MongoDB's repository

wget -qO - https://www.mongodb.org/static/pgp/server-4.4.asc | sudo apt-key add -

Add APT's source for MongoDB

echo "deb [ arch=amd64 ] https://repo.mongodb.org/apt/ubuntu bionic/mongodb-org/4.4 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-4.4.list

Install MongoDB

sudo apt-get update && sudo apt-get install -y mongodb-org

Install Node.js

(Note: BBB 2.5 uses Node.js 16.x, while BBB 2.4 uses Node.js 12.x)
curl -sL https://deb.nodesource.com/setup_16.x | sudo -E bash -
sudo apt-get install nodejs

Install BigBlueButton

Add key for BigBlueButton

wget https://ubuntu.bigbluebutton.org/repo/bigbluebutton.asc -O- | sudo apt-key add -

Add APT's source for BigBlueButton

echo "deb https://ubuntu.bigbluebutton.org/focal-25-dev bigbluebutton-focal main" | sudo tee /etc/apt/sources.list.d/bigbluebutton.list

Install it

sudo apt-get update && sudo apt-get install bigbluebutton

if the bbb-record-core installation fails to locate bundle binary, you need to create a symbolic link to fix it:

sudo ln -s /usr/bin/bundle2.7 /usr/local/bin/bundle

(Optional) Install bbb-demo

If you want to test the installation, you can install demos:

sudo apt-get install bbb-demo

You can access http://BBB_IP_ADDRESS , and you will be able to join bbb-demo (probably WebRTC media won't work because it needs HTTPS to be set). BBB_IP_ADDRESS is the ip address of your container/machine running this installation.

Setup HTTPS

Configure nginx to use HTTPS

Create the directory /etc/nginx/ssl:

sudo mkdir /etc/nginx/ssl

Generate and install certificates (replace BBB_IP_ADDRESS with the ip address of your container/machine running) this installation.)

cd /tmp

wget https://gist.githubusercontent.com/mariogasparoni/a6b9d431977ec1f510c0d32264686c1c/raw/7e9316791cef3dae210286445a8b4f48397cf437/generate-pem-certificate-and-key.sh

chmod +x generate-pem-certificate-and-key.sh

./generate-pem-certificate-and-key.sh BBB_IP_ADDRESS

sudo mv BBB_IP_ADDRESS* /etc/nginx/ssl/

sudo chmod o+rx /etc/nginx/ssl/*

Edit the file /etc/nginx/sites-available/bigbluebutton to add the lines below

server {
  server_name BBB_IP_ADDRESS; # Your BBB_IP_ADDRESS should be already set from bbb installation
  listen 80;
  listen [::]:80;

  # Add the code below
  listen 443 ssl;
  listen [::]:443 ssl;

  ssl_certificate /etc/nginx/ssl/$server_name.crt;
  ssl_certificate_key /etc/nginx/ssl/$server_name.key;
  ssl_session_cache shared:SSL:10m;
  ssl_session_timeout 10m;
  ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
  ssl_ciphers "ECDH+AESGCM:DH+AESGCM:ECDH+AES256:DH+AES256:ECDH+AES128:DH+AES:ECDH+3DES:DH+3DES:RSA+AESGCM:RSA+AES:RSA+3DES:!aNULL:!MD5:!DSS:!AES256";
  ssl_prefer_server_ciphers on;
  

Configure BigBlueButton to load session via HTTPS

Edit /usr/share/bbb-web/WEB-INF/classes/bigbluebutton.properties and update the property bigbluebutton.web.serverURL to use HTTPS:

#----------------------------------------------------
# This URL is where the BBB client is accessible. When a user successfully
# enters a name and password, she is redirected here to load the client.
bigbluebutton.web.serverURL=https://BBB_IP_ADDRESS

Edit /usr/local/bigbluebutton/core/scripts/bigbluebutton.yml and change the value for playback_protocol as follows:

playback_protocol: https

If you have installed the API demos in step 4, add the following code to /var/lib/tomcat8/webapps/demo/bbb_api_conf.jsp

<%!
// This is the URL for the BigBlueButton server
String BigBlueButtonURL = "https://BBB_IP_ADDRESS/bigbluebutton/";

// Salt/Secret can be retrieved from /usr/share/bbb-web/WEB-INF/classes/bigbluebutton.properties
String salt = "YOUR_SECRET_FROM_BIGBLUEBUTTON_PROPERTIES";
%>

The salt can be retrieved from /usr/share/bbb-web/WEB-INF/classes/bigbluebutton.properties file

Add self-signed certificate to trusted certificates:

replace BBB_IP_ADDRESS with the ip address of your container/machine running

sudo cp /etc/nginx/ssl/BBB_IP_ADDRESS.crt /usr/local/share/ca-certificates/
sudo update-ca-certificates

Add self-signed certificate to java cacerts:

replace BBB_IP_ADDRESS with the ip address of your container/machine running

sudo keytool -import -v -trustcacerts -alias BBB_IP_ADDRESS -file /etc/nginx/ssl/BBB_IP_ADDRESS.crt -keystore /usr/lib/jvm/java-11-openjdk-amd64/lib/security/cacerts  -keypass changeit -storepass changeit

Update bbb-html5 config to use sipjsHackViaWs

sudo sed -ie "s/sipjsHackViaWs\:.*/sipjsHackViaWs\:\ true/g" /usr/share/meteor/bundle/programs/server/assets/app/config/settings.yml

Allow html5 to work with self-signed certificates (presentation won't show , otherwise)

echo NODE_TLS_REJECT_UNAUTHORIZED=0 | sudo tee -a /usr/share/meteor/bundle/bbb-html5-with-roles.conf
sudo bbb-conf --restart

Setup development environment

First, you need to install the core development tools.

sudo apt-get install git-core ant ant-contrib openjdk-11-jdk-headless

With the JDK installed, you need to set the JAVA_HOME variable. Edit ~/.profile (here we are using vim to edit the file)

vi ~/.profile

Add the following line at the end of the file

export JAVA_HOME=/usr/lib/jvm/java-11-openjdk-amd64

Reload your profile (this will happen automatically when you next login, but we'll do it explicitly here to load the new environment variable).

source ~/.profile

Do a quick test to ensure JAVA_HOME is set.

$ echo $JAVA_HOME
/usr/lib/jvm/java-11-openjdk-amd64

In the next step, you need to install a number of tools using sdkman.

curl -s "https://get.sdkman.io" | bash
source "$HOME/.sdkman/bin/sdkman-init.sh"

sdk install gradle 7.3.1
sdk install grails 5.0.1
sdk install sbt 1.6.2
sdk install maven 3.8.5

To develop bbb-web, you'll need these permissions:

sudo chmod -R ugo+rwx /var/bigbluebutton
sudo chmod -R ugo+rwx /var/log/bigbluebutton

Developing the HTML5 client

Install Meteor.js.

curl https://install.meteor.com/ | sh

Clone BBB

cd ~
mkdir -p dev && cd dev
git clone git@github.com:bigbluebutton/bigbluebutton.git -b v2.5.x-release
cd ~/dev/bigbluebutton/bigbluebutton-html5

In private/config/settings.yml change wsUrl to:
(replace BBB_IP_ADDRESS with the ip address of your container/machine running)

wsUrl: ws://BBB_IP_ADDRESS/bbb-webrtc-sfu

Stop bbb-html5

sudo systemctl stop bbb-html5

Install the npm dependencies.

meteor npm install

Finally, run the HTML5 code.

env NODE_TLS_REJECT_UNAUTHORIZED=0 npm start

NODE_TLS_REJECT_UNAUTHORIZED=0 allows you to run html5 with a self-signed certificate. Remove this var, if you are using a valid certificate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment