FICUSONLINE F9E
BigBlueButton v3.0 on Docker
BigBlueButton は、主にオンライン教育を目的として開発されたオープンソースのWeb会議システムです。教育機関がリモート授業やセミナーを実施するための多彩な機能を備えており、世界中の学校や大学、学習プラットフォームで活用されています。 BigBlueButtonは、リアルタイムの音声・ビデオ通話に加え、プレゼン資料の共有、ホワイトボード、画面共有、チャット、ブレイクアウトルームといった、教育現場に求められるインタラクティブな機能が標準で利用可能です。また、会議の録画機能を備えており、授業やセミナーを後から見直すこともできます。MoodleなどのLMS(学習管理システム)との統合も容易で、学習環境全体をシームレスに構築できます。 Dockerコンテナにより運用する手順を示します。
Takanobu FuseAdministrator

4 days ago

Cloud / Server

動作条件

以下の推奨構成条件下では、約200人(4クラス:参加者50人/クラス)の同時接続ユーザ数を想定しています。

  • Ubuntu 22.04 64-bit OS running Linux kernel 5.x
  • Latest version of docker installed
  • 16 GB of memory with swap enabled
  • 8 CPU cores, with high single-thread performance
  • 500 GB of free disk space (or more) for recordings, or 50GB if session recording is disabled on the server.
  • TCP ports 80 and 443 are accessible
  • UDP ports 16384 - 32768 are accessible
  • 250 Mbits/sec bandwidth (symmetrical) or more
  • TCP port 80 and 443 are not in use by another web server or reverse proxy
  • A hostname (such as bbb.example.com) for setup of a SSL certificate
  • IPV4 and IPV6 address

但し以下のスペックでも同時参加者を20-25人程度に制限することで利用可能。

  • 4 CPU cores/8 GB of memory
  • Installation on a local VM container
  • 50G of disk space
  • IPV4 address only

bbb-dockerのダウンロード

システムは以下コンテナ郡から構成されます。Nginxのポートを8443に設定しています。ホストのポート443からIptablesで8443へリダイレクトされる設定となっています(Podmanでのユーザモードでの使用も想定)。

BBB-Docker

BBB-Dockerソース:GitHub からソースをダウンロード後、安定版として提供しているmainブランチ(バージョン3.0.4)へチェックアウトします。

$ git clone https://github.com/bigbluebutton/docker.git bbb-docker
$ cd bbb-docker
$ git checkout main 

以下のスクリプトを実行すると.envとdocker-compose.ymlファイルが作成されます。(LetsencryptによるTLS認証は別途設定するため"n"を選択)。

$ ./scripts/setup
Should greenlight be included? (y/n): y
Should an automatic HTTPS Proxy be included? (y/n): n
Please enter the domain name: bbb.ficusonline.com
Should the recording feature be included?
   IMPORTANT: this is currently a big privacy issues, because it will 
   record everything which happens in the conference, even when the button
   suggests, that it does not.
   make sure that you always get people's consent, before they join a room!
   https://github.com/bigbluebutton/bigbluebutton/issues/9202
Choice (y/n): y
Should a Prometheus exporter be included? (y/n): n
Should old recordings be removed? (y/n): y
Please enter max age(days) for keeping recordings: 3
Is xx.xx.xx.xx your external IPv4 address? (y/n): y
Is xx:xx:xx:xx:xx:xx:xx:xx your external IPv6 address? (y/n): y

.envを確認・変更後、以下のスクリプトを実行し、docker-compose.yml にその内容を反映させます。

$ ./scripts/generate-compose

Nginxコンテナ

コンテナNginxのネットワークをhostからdocker networkへ変更し、リバースプロキシとしても利用するため

./nginx_config_temp:/etc/nginx/templates

をvolumesセクションに追加。また、Letsencryptの認証ファイルを事前に取得し、そのフォルダもvolumesセクションに追加します。ホストのポート443で受け入れたHTTPSリクエストを、Iptablesでポート8443へリダイレクトしているため、ポートマッピング8443:443も追加します。

  • docker-compose.yml
  nginx:
    build:
      context: mod/nginx
      additional_contexts:
        - src-learning-dashboard=./repos/bigbluebutton/bbb-learning-dashboard
        - src-playback=./repos/bbb-playback
        - src-html5=./repos/bigbluebutton/bigbluebutton-html5
      args:
        BBB_BUILD_TAG: v3.0.x-release--2025-02-06-143818
        TAG_BBB: v3.0.4
    image: alangecker/bbb-docker-nginx:v3.0.4-v5.3.1-1.25
    restart: unless-stopped
    ports:
            - '8443:443'
    volumes:
      - ./data/bigbluebutton:/var/bigbluebutton
      - ${DEFAULT_PRESENTATION:-/dev/null}:/www/default.pdf
      
      - ./mod/nginx/bigbluebutton/:/etc/nginx/conf.d/default.conf
      - ./mod/nginx/nginx.conf:/etc/nginx/nginx.conf

      # in advance, execute certbot on docker to get ssl certification.
      # "$ sudo docker run -it --rm --name certbot -v "$PWD/letsencrypt:/etc/letsencrypt" -p 80:80 certbot/certbot certonly --standalone -d www.example.com"
      
      # added 4096-bit diffie-hellman parameters. see https://docs.bigbluebutton.org/2.2/install.html#configure-freeswitch-for-using-ssl
      # need /etc/letsencrypt/dhp-4096.pem: "$ openssl dhparam -out letsencrypt/dhp-4096.pem 4096"
      
      # For FreeSwith Web Socket, need to implement the following files.
      # $ sudo cat cert.pem privkey.pem fullchain.pem > wss.pem
      # add symbolic links
      # "$ sudo ln -s wss.pem agent.pem"
      # "$ sudo ln -s wss.pem tls.pem"
      # "$ sudo ln -s wss.pem dtls-srtp.pem"
      - ./letsencrypt:/etc/letsencrypt
      
      # added for reverse-proxy config template file; see https://hub.docker.com/_/nginx
      # *.conf.template changed into /etc/nginx/conf.d/*.conf after variables transferred.
      - ./nginx_config_temp:/etc/nginx/templates
      
    tmpfs:
     - /tmp
#    network_mode: host
    networks:
      bbb-net:
        ipv4_address: 10.7.7.3
        ipv6_address: fd6c:dfc7:8a45:2::3
    extra_hosts:
      - "host.docker.internal:10.7.7.1"
      - "bbb-web:10.7.7.2"
      - "etherpad:10.7.7.4"
      - "webrtc-sfu:10.7.7.1"
      - "greenlight:10.7.7.21"
      - "bbb-graphql-server:10.7.7.31"
      - "bbb-graphql-middleware:10.7.7.32"
  • nginx_config_temp/reverse-proxy.conf.template
map $http_upgrade $connection_upgrade {
    default upgrade;
    '' close;
}
map $remote_addr $endpoint_addr {
    "~:"    [::1];
    default    127.0.0.1;
}

server {
  listen 443 ssl default_server;
  listen [::]:443 ssl default_server;
  http2 on;
  server_name test.ficusonline.com;

  ssl_certificate /etc/letsencrypt/live/ficusonline.com/fullchain.pem;
  ssl_certificate_key /etc/letsencrypt/live/ficusonline.com/privkey.pem;
  
  ssl_session_cache shared:SSL:10m;
  ssl_session_timeout 10m;
  ssl_protocols TLSv1.2 TLSv1.3;
  ssl_ciphers "ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384";
  ssl_prefer_server_ciphers on;
  # on the host machine, "$ sudo openssl dhparam -out ./letsencrypt/ssl-dhparams.pem 4096"
  ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;

  access_log  /var/log/nginx/bigbluebutton.access.log;
  error_log /var/log/nginx/bigbluebutton.error.log;

  location / {
    proxy_http_version 1.1;
    proxy_pass http://$endpoint_addr:48087;
    proxy_set_header Host $host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X-Forwarded-Proto $scheme;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection $connection_upgrade;
    proxy_cache_bypass $http_upgrade;
  }

  # main websocket
  location ~ ^/cool/(.*)/ws$ {
      proxy_pass http://collabora:9980;
      proxy_set_header Upgrade $http_upgrade;
      proxy_set_header Connection "Upgrade";
      proxy_set_header Host $host;
      proxy_read_timeout 36000s;
  }

  # download, presentation and image upload
  # we accept 'lool' to be backward compatible
  location ~ ^/(c|l)ool {
      proxy_pass http://collabora:9980;
      proxy_set_header Host $host;
  }

}

ファイル修正

Nginxの記述ルールの変更、NginxのネットワークをホストからDockerネットワークへ変更したことに伴い関連ファイルの内容を修正、その他誤記、Mediasoupの設定を修正。

  • mod/nginx.conf
  • mod/bigbluebutton
  • reverse-proxy.conf.template

“http2” directive is deprecated" エラーのため、上記nginx設定ファイルのhttp2記述ルール変更。

listen 443 ssl hhtp2;

以下訂正後

listen 443 ssl;
http2 on;

この変更を反映させるには再ビルドする必要があるため、docker-compose.ymlファイルに修正したファイルを直接nginxコンテナに読み込みます。

  • docker-compose.yml
    volumes:
      
      - ./mod/nginx/bigbluebutton/:/etc/nginx/conf.d/default.conf
      - ./mod/nginx/nginx.conf:/etc/nginx/nginx.conf

Nginxのネットワークモードをhostからdockerネットワークへ変更したことに伴う修正。

以下の設定ファイルのlisten IPを、Nginxコンテナに割当てたdockerネットワークIP10.7.7.3に変更する必要があります。

  • mod/bigbluebutton
server {
    listen 10.7.7.3:8185;
    listen 127.0.0.1:8185;

同じ理由で以下ファイル内のIPを10.7.7.1から10.7.7.3へ変更。

  • docker-compose.yml
  bbb-graphql-middleware:

    extra_hosts:
      - "nginx:10.7.7.3"
  • mod/nginx/nginx.conf
    server {
        # additional server only used for greenlight in dev mode
        # allows it to use the BBB API without failing 
        # due to the self signed certificates
        # 
        # all other requests (e.g. /join) is then redirected
        listen 48083;
        http2 on;
        
        location /bigbluebutton/api/join {
            return 301 https://10.7.7.3$request_uri;
        }
        location /bigbluebutton/api {
            proxy_pass http://127.0.0.1:48087;
        }
        location / {
            return 301 https://10.7.7.3$request_uri;
        }
    }

}

以下はDEV_MODEを有効にした場合

  • mod/nginx/bbb-html5.dev.nginx
  proxy_pass http://10.7.7.3:3000/;

freeswitchのコンテナIP誤記:10.7.7.1 —> 10.7.7.10

  • mod/periodic/bbb-resync-freeswitch
docker exec -it bbb-freeswitch fs_cli -H 10.7.7.10 -P 8021 -x 'fsctl sync_clock_when_idle'

デバイス接続エラー(マイク・ビデオエラー)

BBB Device Error

MediasoupのListenIPを変更。

  • docker-compose.yml
webrtc-sfu:

    environment:
      ESL_PASSWORD: ${FSESL_PASSWORD:-ClueCon}
      #MS_WEBRTC_LISTEN_IPS: '[{"ip":"::", "announcedIp":"${EXTERNAL_IPv6}"}, {"ip":"${EXTERNAL_IPv4}", "announcedIp":"${EXTERNAL_IPv4}"}]'
      MS_WEBRTC_LISTEN_IPS: '[{"ip":"0.0.0.0", "announcedIp":"${EXTERNAL_IPv4}"}, {"ip":"${EXTERNAL_IPv6}"}]'


Collabora Online

Collabora OnlineはLibreOfficeをブラウザ上で操作できるようにしたWebアプリです。

Etherpad 単体では PDF 出力に対応していないため、Collabora Online をバックエンドとして使い、HTMLをPDFに変換しています。

Etherpad HTML出力 -> Collabora Online にリクエスト(/convert-to?pdf) -> LibreOfficeエンジンでPDF生成 -> Etherpadがそれを受け取ってユーザーに返す


TLS認証に対応するため、Nginxのリバースプロキシ経由でCollaboraコンテナへアクセスするよう以下の関連ファイルを変更。

以下スクリプト内で、curlでhttpsを指定しているため、URLを正規のドメインへ変更、-k オプションを削除。

  • mod/bbb-web/office-convert.sh
timeout $(printf %03d $timeoutSecs)s curl -F "data=@${source}" https://test.ficusonline.com/cool/convert-to/$convertTo > "${dest}"
  • mod/etherpad/etherpad-export.sh
curl -v -F "data=@${src}" https://test.ficusonline.com/cool/convert-to/$convertTo > "${dest}"

Nginxのプロキシ設定ファイルにCollaboraに対応したlocationセクションを追加。

Nginx Proxy Settings

  • nginx_config_temp/reverse-proxy.conf.template
  # main websocket
  location ~ ^/cool/(.*)/ws$ {
      proxy_pass http://collabora:9980;
      proxy_set_header Upgrade $http_upgrade;
      proxy_set_header Connection "Upgrade";
      proxy_set_header Host $host;
      proxy_read_timeout 36000s;
  }

  # download, presentation and image upload
  # we accept 'lool' to be backward compatible
  location ~ ^/(c|l)ool {
      proxy_pass http://collabora:9980;
      proxy_set_header Host $host;
  }

再ビルドして上記.shファイルの内容を反映させるか、直接docker-composeファイルで指定して上書きします。また、collaboraサービスに環境変数(コンテナでのSSL認証を無効 : extra_params=–o:ssl.enable=false --o:ssl.termination=true)を追加します。

  • docker-compose.yml
  bbb-web:

      # overwrite script for collabora
      - ./mod/bbb-web/office-convert.sh:/usr/share/bbb-libreoffice-conversion/convert.sh

  etherpad:

    # added the below volume section for having modified script.
    volumes:
      - ./mod/etherpad/etherpad-export.sh:/etherpad-export.sh

  collabora:

    environment:
      - extra_params=--o:ssl.enable=false --o:ssl.termination=true

環境変数については以下参照。 Collabora Online Docker Environment


BigBlueButtonを起動

BigBlueButtonを起動します。-dオプションを省略すると、リアルタイムで各コンテナのログを確認できます。

$ docker compose up -d

BBB Main View

管理者権限でログインするため暫定管理者アカウントを作成します。

$ docker compose exec greenlight bundle exec rake admin:create
User account was created successfully!
  Name: Administrator
  Email: [email protected]
  Password: Administrator1!
  Role: Administrator

上記暫定管理者アカウント(メールアドレスとパスワード)でログイン

BBB Login

ログイン後、正規の管理者を作成しログアウト

BBB User Manage

正規の管理者でログイン(メールによるアクティベーション必須)

BBB Mail Activation

ログイン後、暫定管理者を削除、会議室を作成

BBB Conference List

会議室画面

BBB Conference View

マイク・ビデオ動作確認、画面共有、録画機能確認

画面共有・カメラ・マイク動作確認

BBB Sharing View

録画リスト(再生の動作確認)

BBB Recording List

Androidでの確認(画面共有)

BBB Android View Sharing

Collabora画面

BBB Collabora