From dfbe11f74d7864c9f0c59586f4e726b7f9015601 Mon Sep 17 00:00:00 2001 From: chandi Date: Sun, 3 Apr 2022 23:28:49 +0200 Subject: [PATCH] basic 2.5 support (bbb-pads, mongo 5.0, ruby 2.7) --- docker-compose.tmpl.yml | 26 ++++++++++++++++++++++---- mod/bbb-pads/Dockerfile | 18 ++++++++++++++++++ mod/bbb-pads/entrypoint.sh | 15 +++++++++++++++ mod/etherpad/bbb-etherpad-skin | 2 +- mod/html5/bbb-html5.yml | 6 +----- mod/html5/entrypoint.sh | 4 ++-- mod/mongo/init-replica.sh | 14 ++++++++++++-- mod/nginx/bbb/notes.nginx | 2 +- mod/periodic/Dockerfile | 7 ------- mod/periodic/bbb-restart-kms | 2 +- mod/periodic/bbb-resync-freeswitch | 3 +-- mod/recordings/Dockerfile | 2 +- mod/recordings/bigbluebutton.yml | 2 +- mod/webrtc-sfu/bbb-webrtc-sfu | 2 +- 14 files changed, 77 insertions(+), 28 deletions(-) create mode 100644 mod/bbb-pads/Dockerfile create mode 100755 mod/bbb-pads/entrypoint.sh diff --git a/docker-compose.tmpl.yml b/docker-compose.tmpl.yml index dcd9ca1..41a972d 100644 --- a/docker-compose.tmpl.yml +++ b/docker-compose.tmpl.yml @@ -21,7 +21,6 @@ x-html5-backend: &html5backend environment: &html5backend-env DOMAIN: ${DOMAIN} CLIENT_TITLE: ${CLIENT_TITLE} - ETHERPAD_API_KEY: ${ETHERPAD_API_KEY} LISTEN_ONLY_MODE: ${LISTEN_ONLY_MODE:-true} DISABLE_ECHO_TEST: ${DISABLE_ECHO_TEST:-false} AUTO_SHARE_WEBCAM: ${AUTO_SHARE_WEBCAM:-false} @@ -164,8 +163,20 @@ services: bbb-net: ipv4_address: 10.7.7.4 + bbb-pads: + build: mod/bbb-pads + restart: unless-stopped + depends_on: + - redis + - etherpad + environment: + ETHERPAD_API_KEY: ${ETHERPAD_API_KEY} + networks: + bbb-net: + ipv4_address: 10.7.7.18 + redis: - image: redis:6.2-alpine + image: redis:7.0-rc-alpine restart: unless-stopped healthcheck: test: ["CMD", "redis-cli", "ping"] @@ -177,7 +188,8 @@ services: ipv4_address: 10.7.7.5 mongodb: - image: mongo:4.4 + container_name: bbb-mongodb + image: mongo:5.0 restart: unless-stopped volumes: - ./mod/mongo/mongod.conf:/etc/mongod.conf @@ -231,6 +243,8 @@ services: extra_hosts: - host.docker.internal:10.7.7.1 - kurento:10.7.7.1 + volumes: + - vol-mediasoup:/var/mediasoup networks: bbb-net: ipv4_address: 10.7.7.10 @@ -292,6 +306,7 @@ services: volumes: - /var/run/docker.sock:/var/run/docker.sock - bigbluebutton:/var/bigbluebutton + - vol-mediasoup:/var/mediasoup tmpfs: - /var/log/bigbluebutton environment: @@ -313,12 +328,14 @@ services: restart: unless-stopped depends_on: - redis + - bbb-pads environment: DOMAIN: ${DOMAIN} volumes: - bigbluebutton:/var/bigbluebutton - vol-freeswitch:/var/freeswitch/meetings - vol-kurento:/var/kurento + - vol-mediasoup:/var/mediasoup tmpfs: - /var/log/bigbluebutton - /tmp @@ -366,7 +383,7 @@ services: {{ if isTrue .Env.ENABLE_COTURN }} # coturn coturn: - image: instrumentisto/coturn:4.5 + image: coturn/coturn:4.5 restart: unless-stopped command: - "--external-ip=${EXTERNAL_IPv4}/${EXTERNAL_IPv4}" @@ -447,6 +464,7 @@ volumes: bigbluebutton: vol-freeswitch: vol-kurento: + vol-mediasoup: html5-static: {{ if isTrue .Env.ENABLE_HTTPS_PROXY }} ssl_data: diff --git a/mod/bbb-pads/Dockerfile b/mod/bbb-pads/Dockerfile new file mode 100644 index 0000000..88ef640 --- /dev/null +++ b/mod/bbb-pads/Dockerfile @@ -0,0 +1,18 @@ +FROM node:14.18.1-bullseye-slim AS builder + +COPY ./bbb-pads /bbb-pads +RUN cd /bbb-pads && rm -r .git && npm install --production + + +RUN chmod 777 /bbb-pads/config +# ------------------------------ + +FROM node:14.18.1-bullseye-slim + +RUN apt update && apt install -y jq moreutils \ + && useradd --uid 2003 --user-group bbb-pads + +COPY --from=builder /bbb-pads /bbb-pads +USER bbb-pads +COPY entrypoint.sh /entrypoint.sh +ENTRYPOINT /entrypoint.sh \ No newline at end of file diff --git a/mod/bbb-pads/entrypoint.sh b/mod/bbb-pads/entrypoint.sh new file mode 100755 index 0000000..9f93722 --- /dev/null +++ b/mod/bbb-pads/entrypoint.sh @@ -0,0 +1,15 @@ +#!/bin/sh +set -e + +TARGET=/bbb-pads/config/settings.json + +cp /bbb-pads/config/settings.json.template $TARGET +sed -i "s/ETHERPAD_API_KEY/\"$ETHERPAD_API_KEY\"/g" $TARGET +jq '.etherpad.host = "etherpad"' $TARGET | sponge $TARGET +jq '.express.host = "0.0.0.0"' $TARGET | sponge $TARGET +jq '.redis.host = "redis"' $TARGET | sponge $TARGET + + +cd /bbb-pads +export NODE_ENV=production +npm start \ No newline at end of file diff --git a/mod/etherpad/bbb-etherpad-skin b/mod/etherpad/bbb-etherpad-skin index 91b052c..8328b77 160000 --- a/mod/etherpad/bbb-etherpad-skin +++ b/mod/etherpad/bbb-etherpad-skin @@ -1 +1 @@ -Subproject commit 91b052c2cc4c169f2e381538e4342e894f944dbe +Subproject commit 8328b7744abe664e44b7802142eaa48fade63eae diff --git a/mod/html5/bbb-html5.yml b/mod/html5/bbb-html5.yml index 5194e43..93a5b71 100644 --- a/mod/html5/bbb-html5.yml +++ b/mod/html5/bbb-html5.yml @@ -13,15 +13,11 @@ public: chat: enabled: {{ .Env.CHAT_ENABLED }} startClosed: {{ .Env.CHAT_START_CLOSED }} - note: + pads: url: https://{{ .Env.DOMAIN }}/pad private: app: host: 0.0.0.0 - etherpad: - apikey: {{ .Env.ETHERPAD_API_KEY }} - host: etherpad - port: 9001 redis: host: redis port: '6379' diff --git a/mod/html5/entrypoint.sh b/mod/html5/entrypoint.sh index bb4d61a..6dac08a 100755 --- a/mod/html5/entrypoint.sh +++ b/mod/html5/entrypoint.sh @@ -11,7 +11,7 @@ export BIND_IP=0.0.0.0 export LANG=en_US.UTF-8 export INSTANCE_MAX=1 export ENVIRONMENT_TYPE=production -export NODE_VERSION=node-v12.16.1-linux-x64 +export NODE_VERSION=node-v14.18.3-linux-x64 export BBB_HTML5_LOCAL_SETTINGS=/app/bbb-html5.yml if [ "$DEV_MODE" == true ]; then @@ -26,7 +26,7 @@ fi # if container is the first frontend, do some additional tasks if [ "$BBB_HTML5_ROLE" == "frontend" ] && [ "$INSTANCE_ID" == "1" ]; then - # delete potential old settings.yml + # copy static files into volume for direct access by nginx # https://github.com/bigbluebutton/bigbluebutton/issues/10739 diff --git a/mod/mongo/init-replica.sh b/mod/mongo/init-replica.sh index e572796..188cdda 100755 --- a/mod/mongo/init-replica.sh +++ b/mod/mongo/init-replica.sh @@ -4,10 +4,20 @@ set -e host=${HOSTNAME:-$(hostname -f)} +# shut down again +mongod --pidfilepath /tmp/docker-entrypoint-temp-mongod.pid --shutdown +# restart again binding to 0.0.0.0 to allow a replset with 10.7.7.6 +mongod --oplogSize 8 --replSet rs0 --noauth \ + --config /tmp/docker-entrypoint-temp-config.json \ + --bind_ip 0.0.0.0 --port 27017 \ + --tlsMode disabled \ + --logpath /proc/1/fd/1 --logappend \ + --pidfilepath /tmp/docker-entrypoint-temp-mongod.pid --fork + # init replset with defaults -mongo local --eval "rs.initiate({ +mongo 10.7.7.6 --eval "rs.initiate({ _id: 'rs0', - members: [ { _id: 0, host: '127.0.0.1:27017' } ] + members: [ { _id: 0, host: '10.7.7.6:27017' } ] })" echo "Waiting to become a master" diff --git a/mod/nginx/bbb/notes.nginx b/mod/nginx/bbb/notes.nginx index 95bde11..bcd2436 100644 --- a/mod/nginx/bbb/notes.nginx +++ b/mod/nginx/bbb/notes.nginx @@ -13,7 +13,7 @@ location /pad/p/ { proxy_set_header X-Forwarded-Proto $scheme; # for EP to set secure cookie flag when https is used proxy_http_version 1.1; - auth_request /bigbluebutton/connection/validatePad; + auth_request /bigbluebutton/connection/checkAuthorization; auth_request_set $auth_status $upstream_status; } diff --git a/mod/periodic/Dockerfile b/mod/periodic/Dockerfile index 56fea76..bf98d56 100644 --- a/mod/periodic/Dockerfile +++ b/mod/periodic/Dockerfile @@ -1,12 +1,5 @@ FROM debian:bullseye-slim -# -- install mongo cli -RUN apt-get update \ - && apt-get install -y wget libcurl4 \ - && wget https://repo.mongodb.org/apt/debian/dists/buster/mongodb-org/4.2/main/binary-amd64/mongodb-org-shell_4.2.6_amd64.deb \ - && dpkg -i mongodb*.deb \ - && rm mongodb*.deb - # -- install docker cli COPY --from=library/docker:latest /usr/local/bin/docker /usr/bin/docker diff --git a/mod/periodic/bbb-restart-kms b/mod/periodic/bbb-restart-kms index 3787ade..2788203 100755 --- a/mod/periodic/bbb-restart-kms +++ b/mod/periodic/bbb-restart-kms @@ -12,7 +12,7 @@ if [ ! -f /tmp/bbb-kms-last-restart.txt ]; then exit fi -users=$(mongo --quiet mongodb://10.7.7.6:27017/meteor --eval "db.users.count()") +users=$(docker exec bbb-mongodb mongo --quiet mongodb://10.7.7.6:27017/meteor --eval "db.users.count()") echo "currently active users: $users" if [ "$users" -eq 0 ]; then diff --git a/mod/periodic/bbb-resync-freeswitch b/mod/periodic/bbb-resync-freeswitch index 5e0c138..ee3d087 100755 --- a/mod/periodic/bbb-resync-freeswitch +++ b/mod/periodic/bbb-resync-freeswitch @@ -2,5 +2,4 @@ # https://github.com/bigbluebutton/bigbluebutton/pull/9597/files -CONTAINER_ID=$(docker ps | grep freeswitch | awk '{print $1}') -docker exec -it $CONTAINER_ID fs_cli -H 10.7.7.1 -P 8021 -x 'fsctl sync_clock_when_idle' \ No newline at end of file +docker exec -it bbb-freeswitch fs_cli -H 10.7.7.1 -P 8021 -x 'fsctl sync_clock_when_idle' \ No newline at end of file diff --git a/mod/recordings/Dockerfile b/mod/recordings/Dockerfile index 7acd64a..f1b9c19 100644 --- a/mod/recordings/Dockerfile +++ b/mod/recordings/Dockerfile @@ -1,5 +1,5 @@ -FROM ruby:2.5-slim-buster +FROM ruby:2.7-slim-buster # install apt dependencies RUN apt-get update && apt-get install -y \ diff --git a/mod/recordings/bigbluebutton.yml b/mod/recordings/bigbluebutton.yml index c023382..e93228d 100644 --- a/mod/recordings/bigbluebutton.yml +++ b/mod/recordings/bigbluebutton.yml @@ -7,7 +7,7 @@ raw_screenshare_src: /usr/share/red5/webapps/screenshare/streams raw_webrtc_deskshare_src: /usr/share/red5/webapps/video-broadcast/streams raw_deskshare_src: /var/bigbluebutton/deskshare raw_presentation_src: /var/bigbluebutton -notes_endpoint: http://etherpad:9001/p +notes_endpoint: http://bbb-pads:9002/p # Specify the notes formats we archive # txt, doc and odt are also supported notes_formats: diff --git a/mod/webrtc-sfu/bbb-webrtc-sfu b/mod/webrtc-sfu/bbb-webrtc-sfu index 3dc34eb..a342bfd 160000 --- a/mod/webrtc-sfu/bbb-webrtc-sfu +++ b/mod/webrtc-sfu/bbb-webrtc-sfu @@ -1 +1 @@ -Subproject commit 3dc34eb558ce2f0e230c358580d8e7e1cd9b8f67 +Subproject commit a342bfd08d0caf66611addb292da53164a4f7fa4