Skip to content

bigbluebot - Installation step to use with greenlight #14

@aguerson

Description

@aguerson

OK I did it !
To reproduce

  1. create a CT from an OpenVZ server with ubuntu 18.04 LTS template ( or a lxd container ? ) in a moderate server ( Intel(R) Xeon(R) CPU X5690 @ 3.47GHz / 16G RAM )

  2. create bigbluebutton user and customize it

adduser bigbluebutton

vim /home/bigbluebutton/.bashrc
...
HISTTIMEFORMAT="%F %T : "
HISTSIZE=1000000
HISTFILESIZE=1000000
...
export LANG="en_US.UTF-8"
cd /opt/bigbluebutton/bbb-bot
  1. create sub dir
    mkdir -p /opt/bigbluebutton/bbb-bot

  2. change rights

chown -R bigbluebutton:bigbluebutton /opt/bigbluebutton/bbb-bot
chmod 1770 /opt/bigbluebutton/bbb-bot
  1. you need to install the mandatory packages
apt-get update

apt-get remove nodejs --purge

apt-get autoremove

apt-get -y install curl dirmngr apt-transport-https lsb-release ca-certificates

curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash -

apt-get -y install nodejs

apt-get install -y gconf-service libasound2 libatk1.0-0 libatk-bridge2.0-0 libc6 libcairo2 libcups2 libdbus-1-3 libexpat1 libfontconfig1 libgcc1 libgconf-2-4 libgdk-pixbuf2.0-0 libglib2.0-0 libgtk-3-0 libnspr4 libpango-1.0-0 libpangocairo-1.0-0 libstdc++6 libx11-6 libx11-xcb1 libxcb1 libxcomposite1 libxcursor1 libxdamage1 libxext6 libxfixes3 libxi6 libxrandr2 libxrender1 libxss1 libxtst6 ca-certificates fonts-liberation libappindicator1 libnss3 lsb-release xdg-utils wget gcc g++ make libnss3  libxcb-dri3-0 libxcb-dri3-dev libdrm-common libdrm-dev libgbm1 libgbm-dev wget gnupg yarn xauth x11-apps firefox language-pack-en language-pack-fr

echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" > /etc/apt/sources.list.d/google-chrome-unstable.list

wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add -

apt-get update

apt-get install -y google-chrome-unstable fonts-ipafont-gothic fonts-wqy-zenhei fonts-thai-tlwg fonts-kacst fonts-freefont-ttf --no-install-recommends
  1. you need to configure openssh daemon ( in case you use X display over ssh like me )

vim /etc/ssh/sshd_config

ListenAddress 0.0.0.0
ChallengeResponseAuthentication no
UsePAM yes
X11Forwarding yes
X11UseLocalhost no
PrintMotd no
AcceptEnv LANG LC_*
AcceptEnv LC_PAPER LC_NAME LC_ADDRESS LC_TELEPHONE LC_MEASUREMENT
AcceptEnv LC_IDENTIFICATION LC_ALL LANGUAGE
AcceptEnv XMODIFIERS
Subsystem       sftp    /usr/lib/openssh/sftp-server
PermitRootLogin yes

systemctl restart sshd.service

  1. modify the LANG
update-locale LANG=en_US.UTF-8
systemctl set-environment LANG=en_US.UTF-8
  1. clone the repo
su - bigbluebutton
git clone git://github.com/mconf/bigbluebot.git /opt/bigbluebutton/bbb-bot/
  1. modify the "name" in /opt/bigbluebutton/bbb-bot/package.json to bbbbot
{
  "name": "bigbluebot",
  "version": "1.3.6",

to

{
  "name": "bbbbot",
  "version": "1.3.6",

  1. install the librairies
su - bigbluebutton

npm i --save-dev bufferutil

npm i --save-dev utf-8-validate

npm i bigbluebot

  1. create start script

vim /opt/bigbluebutton/bbb-bot/run.js

const bigbluebot = require('bigbluebot')

let actions = async page => {
  await bigbluebot.audio.modal.listen(page)
}

bigbluebot.run(actions)
chmod 555 /opt/bigbluebutton/bbb-bot/run.js
chown bigbluebutton:bigbluebutton /opt/bigbluebutton/bbb-bot/run.js
  1. Now you have to modify the code to adapt the use with greenlight !

vim /opt/bigbluebutton/bbb-bot/node_modules/bigbluebot/lib/api.js

modify

let query = '';
  if (list.length > 0) query = list.join('&');

  return query;
};

by

let query = '';
  if (list.length > 0) query = list.join('&');

  let userdata = '&userdata-bbb_auto_join_audio=true&userdata-bbb_enable_video=true&userdata-bbb_listen_only_mode=true&userdata-bbb_force_listen_only=true&userdata-bbb_skip_check_audio=true';
  let fullquery = query + userdata;

  return fullquery;
};

and modify ( I just want to join the room. I don't want to create it. I will create it manually using greenlight interface ).

const getURL = (action, params) => {
  const query = buildQuery(params);
  const checksum = calculateChecksum(action, query);
  const host = config.url.host;
  const api = config.api.path;
  const url = `${host}/${api}/${action}?${query}&checksum=${checksum}`;

  return url;
};

by

const getURL = (action, params) => {
  const query = buildQuery(params);
  const checksum = calculateChecksum(action, query);
  const host = config.url.host;
  const api = config.api.path;
  //const url = `${host}/${api}/${action}?${query}&checksum=${checksum}`;
  const url = `${host}/${api}/join?${query}&checksum=${checksum}`;

  return url;
};

vim /opt/bigbluebutton/bbb-bot/node_modules/bigbluebot/lib/pool.js

modify

const args = [
  `--lang=${browser.lang}`,
  `--disable-dev-shm-usage`,
  `--no-user-gesture-required`,
  `--use-fake-ui-for-media-stream`,
  `--use-fake-device-for-media-stream`,
];

by

const args = [
  `--lang=${browser.lang}`,
  `--disable-dev-shm-usage`,
  `--no-user-gesture-required`,
  //`--use-fake-ui-for-media-stream`,
  //`--use-fake-device-for-media-stream`,
];

vim /opt/bigbluebutton/bbb-bot/node_modules/bigbluebot/config/config.json

modify

{
  "url": {
    "host": null,
    "locale": "html5client/locale?locale",
    "demo": "demo/demoHTML5.jsp?action=create",
    "user": {
      "param": "username"
    },
    "moderator": {
      "param": "isModerator",
      "value": true
    },

by

{
  "url": {
    "host": null,
    "locale": "html5client/locale?locale",
    "demo": "join",
    "user": {
      "param": "fullName"
    },
    "moderator": {
      "param": "isModerator",
      "value": false
    },

and modify ( for this part, it depends if you want to play with the bots or not with the chrome browser )

  "browser": {
    "headless": true,
    "endpoint": null,
    "token": null,
    "path": null,
    "lang": "EN",
    "window": {
      "width": 1280,
      "height": 720
    },

by

  "browser": {
    "headless": false,
    "endpoint": null,
    "token": null,
    "path": null,
    "lang": "EN",
    "window": {
      "width": 1280,
      "height": 720
    },

and to finish, modify

  "timeout": {
    "selector": 60000
  },

by

  },
  "timeout": {
    "selector": 1800000
  },
  1. Create you .env config file
cp /opt/bigbluebutton/bbb-bot/.env.template /opt/bigbluebutton/bbb-bot/.env

vim /opt/bigbluebutton/bbb-bot/.env
# BigBlueButton hostname
BIGBLUEBOT_HOST=https://hostname.domain

# Room name the bot should join
BIGBLUEBOT_ROOM=${roomid of your conf}

# Set the passwords if the room name is the ID of an existing room.
# Very important point !
# Each time you create a room with greenlight, greenlight set the ATTENDEE password and the MODERATOR password. These values are stored in the database
# To find it: Launch this SQL request
# select * from $(user_database_schema).rooms where bbb_id='${roomid_of_your_conf}';
# The fields are "moderator_pw" or "attendee_pw". It depends what you need.
BIGBLUEBOT_ATTENDEE_PW=${attendee_pw_of_roomid}
# BIGBLUEBOT_MODERATOR_PW=

# BigBlueButton secret
# bbb-conf --secret on the BBB server
BIGBLUEBOT_SECRET=${bbb_server_secret}

# Number of bots to spawn
BIGBLUEBOT_BOTS=50

# Time between bots to join (ms)
BIGBLUEBOT_WAIT=5000

# Bot life span (ms)
# Test during 30 min = 30x60x1000 = 1800000
BIGBLUEBOT_LIFE=1800000

# Use an external browser
#BIGBLUEBOT_BROWSER=/usr/bin/google-chrome

# Number of browser processes
# the number of the tab opened in the same chrome browser
BIGBLUEBOT_POOL=50

# Use endpoint browser websocket
#BIGBLUEBOT_ENDPOINT=

# Use endpoint authentication token
# BIGBLUEBOT_TOKEN=

# Log level
BIGBLUEBOT_LOG=debug
  1. Try it

Launch the meeting with the greenlight interface

and

ssh -X bigbluebutton@bbb-bot.domain

cd /opt/bigbluebutton/bbb-bot/

node run.js

Enjoy !

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions