From 36c2aa445342963552b17db7c8846f90ddc7f172 Mon Sep 17 00:00:00 2001 From: chandi Date: Tue, 26 May 2020 17:24:55 +0200 Subject: [PATCH 01/15] use static IP adresses for all containers. We otherwise run into following error sometimes: ERROR: for core Cannot start service core: Address already in use --- docker-compose.yml | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 95fdc43..591ab48 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -51,7 +51,8 @@ services: - ./mod/nginx/bigbluebutton:/etc/nginx/conf.d/default.conf - ${DEFAULT_PRESENTATION:-/dev/null}:/etc/nginx/html/default.pdf networks: - - bbb-net + bbb-net: + ipv4_address: 10.7.7.13 extra_hosts: - "host.docker.internal:10.7.7.1" @@ -122,7 +123,8 @@ services: - host.docker.internal:10.7.7.1 - kurento:10.7.7.1 networks: - - bbb-net + bbb-net: + ipv4_address: 10.7.7.10 html5: build: mod/html5 @@ -138,7 +140,8 @@ services: SCREENSHARE_EXTENSION_LINK: ${SCREENSHARE_EXTENSION_LINK} ETHERPAD_API_KEY: ${ETHERPAD_API_KEY} networks: - - bbb-net + bbb-net: + ipv4_address: 10.7.7.11 periodic: build: mod/periodic @@ -149,7 +152,8 @@ services: - /var/run/docker.sock:/var/run/docker.sock - bigbluebutton:/var/bigbluebutton networks: - - bbb-net + bbb-net: + ipv4_address: 10.7.7.12 volumes: bigbluebutton: From 3a22a510ceb37a15cdbf63ab08e5eba8a6dd1f3e Mon Sep 17 00:00:00 2001 From: chandi Date: Tue, 26 May 2020 17:30:37 +0200 Subject: [PATCH 02/15] html5: self building for node v12 --- mod/html5/Dockerfile | 61 +++++++++++++++++++++++++++-------------- mod/html5/entrypoint.sh | 4 +-- 2 files changed, 42 insertions(+), 23 deletions(-) diff --git a/mod/html5/Dockerfile b/mod/html5/Dockerfile index 2a5f232..e53385b 100644 --- a/mod/html5/Dockerfile +++ b/mod/html5/Dockerfile @@ -1,33 +1,52 @@ -# TODO: build from github repo with node:12 -FROM node:8-stretch +FROM node:12-buster-slim AS builder -ENV NODE_ENV production +RUN apt-get update && apt-get install -y wget curl subversion python2 python3 build-essential +RUN groupadd -g 2000 meteor && useradd -m -u 2001 -g meteor meteor + + +# download dockerize ENV DOCKERIZE_VERSION v0.6.1 - -# install dockerize RUN wget https://github.com/jwilder/dockerize/releases/download/$DOCKERIZE_VERSION/dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz \ && tar -C /usr/local/bin -xzvf dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz \ && rm dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz -RUN apt-get update && apt-get install -y wget binutils -RUN useradd -m meteor - -# download & install bbb-html5 package manually -RUN PACKAGE_PATH=$(curl -s https://packages-eu.bigbluebutton.org/xenial-22/dists/bigbluebutton-xenial/main/binary-amd64/Packages | grep -E 'Filename.*html5' | awk '{print $2}') \ - && wget https://packages-eu.bigbluebutton.org/xenial-22/$PACKAGE_PATH \ - && ar x bbb-html5_*.deb \ - && tar -zxf data.tar.gz ./usr/share/meteor/bundle \ - && mv /usr/share/meteor/bundle /app \ - && rm -rf /app/programs/server/node_modules \ - && chown meteor:meteor /app/programs/server \ - && chown -R meteor:meteor /app/programs/server/assets/app/config \ - && rm /*.deb /*.tar.gz - USER meteor -RUN cd /app/programs/server && npm install && npm cache clear --force +ENV METEOR_VERSION 1.9 +RUN curl -sL https://install.meteor.com?release=$METEOR_VERSION | sed s/--progress-bar/-sL/g | /bin/sh +ENV TAG v2.2.14 +RUN cd ~ \ + && svn checkout https://github.com/bigbluebutton/bigbluebutton/tags/$TAG/bigbluebutton-html5 \ + && mv ~/bigbluebutton-html5 ~/source \ + && rm -rf ~/source/.svn +# source modifications for node v12 support: +# - remove memwatch since it is not available for node v12 and disabled anyway +# - set meteor release to 1.9 +# - install newer fibers version (4.0.3) which supports node v12 + +RUN sed -i -r 's/import (memwatch|heapdump).*//g' ~/source/imports/startup/server/index.js \ + && sed -i -r 's/.*(memwatch|heapdump).*//g' ~/source/package.json \ + && echo "METEOR@$METEOR_VERSION" > ~/source/.meteor/release \ + && cat ~/source/.meteor/release + +RUN cd ~/source \ + && npm install fibers@4.0.3 --production --save \ + && ~/.meteor/meteor npm install --production \ + && ~/.meteor/meteor build --directory ~/app \ + && rm -r ~/source + +RUN cd ~/app/bundle/programs/server \ + && npm install --production + +# ------------------------------ + +FROM node:12-alpine + +RUN addgroup -g 2000 meteor && adduser -D -u 2001 -G meteor meteor +COPY --from=builder /usr/local/bin/dockerize /usr/local/bin/dockerize +COPY --from=builder --chown=meteor:meteor /home/meteor/app/bundle /app COPY entrypoint.sh /entrypoint.sh COPY settings.yml /app/programs/server/assets/app/config/settings.yml.tmpl - +USER meteor ENTRYPOINT ["/entrypoint.sh"] diff --git a/mod/html5/entrypoint.sh b/mod/html5/entrypoint.sh index 6c5bc5e..d8b175d 100755 --- a/mod/html5/entrypoint.sh +++ b/mod/html5/entrypoint.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh cd /app export ROOT_URL=http://127.0.0.1/html5client @@ -7,7 +7,7 @@ export NODE_ENV=production export ENVIRONMENT_TYPE=production export PORT=3000 -rm /app/programs/server/assets/app/config/settings.yml +rm -f /app/programs/server/assets/app/config/settings.yml dockerize \ -template /app/programs/server/assets/app/config/settings.yml.tmpl:/app/programs/server/assets/app/config/settings.yml \ node main.js From bc60c8f579cda73c9a827c43fa5d296c1d81b4ca Mon Sep 17 00:00:00 2001 From: chandi Date: Tue, 26 May 2020 20:03:04 +0200 Subject: [PATCH 03/15] html5: remove legacy screenshare extension variables --- docker-compose.yml | 2 -- mod/html5/settings.yml | 4 ++-- sample.env | 3 --- 3 files changed, 2 insertions(+), 7 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 591ab48..9920cc0 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -136,8 +136,6 @@ services: environment: DOMAIN: ${DOMAIN} CLIENT_TITLE: ${CLIENT_TITLE} - SCREENSHARE_EXTENSION_KEY: ${SCREENSHARE_EXTENSION_KEY} - SCREENSHARE_EXTENSION_LINK: ${SCREENSHARE_EXTENSION_LINK} ETHERPAD_API_KEY: ${ETHERPAD_API_KEY} networks: bbb-net: diff --git a/mod/html5/settings.yml b/mod/html5/settings.yml index 3c3ce37..6a4bda0 100644 --- a/mod/html5/settings.yml +++ b/mod/html5/settings.yml @@ -83,8 +83,8 @@ public: packetLostThreshold: 10 kurento: wsUrl: wss://{{ .Env.DOMAIN }}/bbb-webrtc-sfu - chromeDefaultExtensionKey: {{ .Env.SCREENSHARE_EXTENSION_KEY }} - chromeDefaultExtensionLink: {{ .Env.SCREENSHARE_EXTENSION_LINK }} + chromeDefaultExtensionKey: akgoaoikmbmhcopjgakkcepdgdgkjfbc + chromeDefaultExtensionLink: https://chrome.google.com/webstore/detail/bigbluebutton-screenshare/akgoaoikmbmhcopjgakkcepdgdgkjfbc chromeExtensionKey: KEY chromeExtensionLink: LINK screenshare: diff --git a/sample.env b/sample.env index cfe5a4a..8ba77cc 100644 --- a/sample.env +++ b/sample.env @@ -20,9 +20,6 @@ STUN_PORT=3478 #TURN_SERVER=turns:turn.example.com:443?transport=tcp #TURN_SECRET= -SCREENSHARE_EXTENSION_KEY=akgoaoikmbmhcopjgakkcepdgdgkjfbc -SCREENSHARE_EXTENSION_LINK=https://chrome.google.com/webstore/detail/bigbluebutton-screenshare/akgoaoikmbmhcopjgakkcepdgdgkjfbc - CLIENT_TITLE=BigBlueButton WELCOME_FOOTER=This server is running BigBlueButton. From 580c04c88e437a7ca97c03a8e8eb23135c342776 Mon Sep 17 00:00:00 2001 From: chandi Date: Tue, 26 May 2020 20:03:42 +0200 Subject: [PATCH 04/15] webrtc-sfu: alpine for reduced image size --- mod/webrtc-sfu/Dockerfile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mod/webrtc-sfu/Dockerfile b/mod/webrtc-sfu/Dockerfile index 809626f..e8138e8 100644 --- a/mod/webrtc-sfu/Dockerfile +++ b/mod/webrtc-sfu/Dockerfile @@ -1,4 +1,6 @@ -FROM node:12 +FROM node:12-alpine + +RUN apk update && apk add git ADD . app From e0b82391a2e93da1c7e08e5b8621e8615f2c5671 Mon Sep 17 00:00:00 2001 From: chandi Date: Tue, 26 May 2020 20:09:02 +0200 Subject: [PATCH 05/15] added upgrade and print-version script --- mod/html5/Dockerfile | 3 ++ scripts/print-versions | 72 ++++++++++++++++++++++++++++++++++++++++++ scripts/upgrade | 48 ++++++++++++++++++++++++++++ 3 files changed, 123 insertions(+) create mode 100755 scripts/print-versions create mode 100755 scripts/upgrade diff --git a/mod/html5/Dockerfile b/mod/html5/Dockerfile index e53385b..e722e49 100644 --- a/mod/html5/Dockerfile +++ b/mod/html5/Dockerfile @@ -50,3 +50,6 @@ COPY entrypoint.sh /entrypoint.sh COPY settings.yml /app/programs/server/assets/app/config/settings.yml.tmpl USER meteor ENTRYPOINT ["/entrypoint.sh"] + +# lets set the tag again, so that it is include in the image for later version retrieval +ENV TAG v2.2.14 diff --git a/scripts/print-versions b/scripts/print-versions new file mode 100755 index 0000000..44cc0cf --- /dev/null +++ b/scripts/print-versions @@ -0,0 +1,72 @@ +#!/bin/bash +set -e + +CORE_IMAGE=$(docker-compose images -q core) +FREESWITCH_IMAGE=$(docker-compose images -q freeswitch) +HTML5_IMAGE=$(docker-compose images -q html5) +KURENTO_IMAGE=$(docker-compose images -q kurento) +MONGO_IMAGE=$(docker-compose images -q mongodb) +REDIS_IMAGE=$(docker-compose images -q redis) + +if [[ -z $CORE_IMAGE ]] +then + echo "this script only works if containers are created" + echo "either start BigBlueButton with" + echo " $ docker-compose up -d" + echo "or at least create the containers with" + echo " $ docker-compose create" + exit 1 +fi + + + +echo "bigbluebutton-docker" +echo " commit: $(git rev-parse --short HEAD) ($(git log -1 --pretty=%B | head -n 1))" +echo " branch: $(git rev-parse --abbrev-ref HEAD)" +echo "" + +echo "core" +docker run --rm --entrypoint /bin/sh $CORE_IMAGE -c "dpkg -l 'bbb-*' | grep ii | cut -c 5-42 | sed 's/bbb-/ bbb-/g'" +echo "" + +echo "etherpad" +ETHERPAD_VERSION=$(docker-compose images etherpad | grep etherpad | awk '{print $3}') +echo " version: $ETHERPAD_VERSION" +echo "" + +echo "freeswitch" +FREESWITCH_VERSION=$(docker run --rm --entrypoint freeswitch $FREESWITCH_IMAGE -version | cut -c 21-) +FREESWTICH_CONFIG_VERSION=$(docker image inspect $FREESWITCH_IMAGE | grep GIT_TAG= | head -n 1 | xargs | cut -c 9-) +echo " build: $FREESWITCH_VERSION" +echo " config: $FREESWTICH_CONFIG_VERSION" +echo "" + +echo "html5" +HTML5_VERSION=$(docker image inspect $HTML5_IMAGE | grep TAG= | head -n 1 | xargs | cut -c 5-) +echo " version: $HTML5_VERSION" +echo "" + +echo "kurento" +KURENTO_VERSION=$(docker run --rm --entrypoint kurento-media-server $KURENTO_IMAGE --version | grep Kurento | sed 's/Kurento Media Server version: //') +echo " version: $KURENTO_VERSION" +echo "" + +echo "mongodb" +MONGO_VERSION=$(docker image inspect $MONGO_IMAGE | grep MONGO_VERSION | head -n 1 | xargs | cut -c 15-) +echo " version: $MONGO_VERSION" +echo "" + +# TODO: +# - nginx +# - periodic + +echo "redis" +REDIS_VERSION=$(docker image inspect $REDIS_IMAGE | grep REDIS_VERSION | head -n 1 | xargs | cut -c 15-) +echo " version: $REDIS_VERSION" +echo "" + +echo "webrtc-sfu" +SFU_VERSION=$(cd bbb-webrtc-sfu && cat package.json | grep version | awk -F\" '{print $4}') +SFU_COMMIT=$(cd bbb-webrtc-sfu && git rev-parse --short HEAD) +echo " version: $SFU_VERSION" +echo " commit: $SFU_COMMIT" diff --git a/scripts/upgrade b/scripts/upgrade new file mode 100755 index 0000000..1c0ee17 --- /dev/null +++ b/scripts/upgrade @@ -0,0 +1,48 @@ +#!/bin/bash + +set -e +cd $(dirname $0)/.. + +if [ -z $RESTARTED ] +then + + echo "# pull newest bigblugbutton-docker.git" + #git pull + + # restart script, since it might have changed. + RESTARTED=1 ./scripts/upgrade + +else + echo "" + echo "# pull newest bbb-webrtc-sfu" + git submodule update --remote + + + echo "" + echo "# pull newest images" + docker-compose pull + docker-compose -f docker-compose.greenlight.yml pull + docker-compose -f docker-compose.https.yml pull + + echo "" + echo "# rebuild images" + docker-compose build --pull --no-cache + + + COMMIT_HASH=$(git rev-parse --short HEAD) + BRANCH_NAME=$(git rev-parse --abbrev-ref HEAD) + + echo "" + echo "-------------------------------------" + echo "images successfully rebuilt!" + echo "we are on $COMMIT_HASH ($BRANCH_NAME)" + echo "" + echo "use following commands for restarting:" + echo "BigBlueButton:" + echo " $ docker-compose up -d" + echo "HTTPS Proxy:" + echo " $ docker-compose -f docker-compose.https.yml up -d" + echo "Greenlight:" + echo " $ docker-compose -f docker-compose.greenlight.yml up -d" + echo "-------------------------------------" +fi \ No newline at end of file From 53a348fded715d8453057b36d7474b6cfada443c Mon Sep 17 00:00:00 2001 From: chandi Date: Sun, 31 May 2020 11:27:32 +0200 Subject: [PATCH 06/15] etherpad: add plugins (enables closed captions) --- docker-compose.yml | 6 +----- mod/etherpad/Dockerfile | 21 +++++++++++++++++++++ mod/{pad => etherpad}/entrypoint.sh | 1 + mod/{pad => etherpad}/settings.json | 0 4 files changed, 23 insertions(+), 5 deletions(-) create mode 100644 mod/etherpad/Dockerfile rename mod/{pad => etherpad}/entrypoint.sh (99%) rename mod/{pad => etherpad}/settings.json (100%) diff --git a/docker-compose.yml b/docker-compose.yml index 9920cc0..8ceddb8 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -57,16 +57,12 @@ services: - "host.docker.internal:10.7.7.1" etherpad: - image: etherpad/etherpad:1.8.4 + build: mod/etherpad restart: unless-stopped depends_on: - redis environment: ETHERPAD_API_KEY: ${ETHERPAD_API_KEY} - volumes: - - ./mod/pad/settings.json:/opt/etherpad-lite/settings.json - - ./mod/pad/entrypoint.sh:/entrypoint.sh - entrypoint: /entrypoint.sh networks: bbb-net: ipv4_address: 10.7.7.4 diff --git a/mod/etherpad/Dockerfile b/mod/etherpad/Dockerfile new file mode 100644 index 0000000..92f3577 --- /dev/null +++ b/mod/etherpad/Dockerfile @@ -0,0 +1,21 @@ +FROM etherpad/etherpad:1.8.4 + +USER root + +# install etherpad plugins +# - ep_delete_after_delay_lite +# - ep_redis_publisher +RUN apt-get update \ + && apt-get install -y git \ + && npm install ep_delete_after_delay_lite git+https://git@github.com/pedrobmarin/ep_redis_publisher.git + +# apply "Including more data at pad update event" +# https://github.com/mconf/etherpad-lite/commit/5bc37fc92714e82165386dc0a5dd467609169a87 +# this is a necessary patch for the closed captions +RUN sed -i "s|hooks\.callAll(\"padUpdate\".*)|hooks\.callAll(\"padUpdate\", {'pad':this, 'author': author, 'revs': newRev, 'changeset': aChangeset});|" /opt/etherpad-lite/src/node/db/Pad.js + +COPY settings.json /opt/etherpad-lite/settings.json +COPY entrypoint.sh /entrypoint.sh + +USER etherpad +ENTRYPOINT ["/entrypoint.sh"] \ No newline at end of file diff --git a/mod/pad/entrypoint.sh b/mod/etherpad/entrypoint.sh similarity index 99% rename from mod/pad/entrypoint.sh rename to mod/etherpad/entrypoint.sh index 21012d4..7586f6c 100755 --- a/mod/pad/entrypoint.sh +++ b/mod/etherpad/entrypoint.sh @@ -1,4 +1,5 @@ #!/bin/bash echo $ETHERPAD_API_KEY > /tmp/apikey export NODE_ENV=production + node /opt/etherpad-lite/node_modules/ep_etherpad-lite/node/server.js --apikey /tmp/apikey \ No newline at end of file diff --git a/mod/pad/settings.json b/mod/etherpad/settings.json similarity index 100% rename from mod/pad/settings.json rename to mod/etherpad/settings.json From c0b05c5bf6cdffa2e0152b3d2164079a64fa87a8 Mon Sep 17 00:00:00 2001 From: chandi Date: Sun, 31 May 2020 11:49:57 +0200 Subject: [PATCH 07/15] webrtc-sfu: fix broken ip detection due to base image switch --- mod/webrtc-sfu/Dockerfile | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/mod/webrtc-sfu/Dockerfile b/mod/webrtc-sfu/Dockerfile index e8138e8..5c5c7b1 100644 --- a/mod/webrtc-sfu/Dockerfile +++ b/mod/webrtc-sfu/Dockerfile @@ -19,5 +19,10 @@ RUN cp config/default.example.yml config/production.yml \ EXPOSE 3008 +# remove automatic IP detection (broken in alpine) +# and use sh instead of bash +RUN sed -i 's/CONTAINER_IP=.*/CONTAINER_IP=10.7.7.10/' /app/docker-entrypoint.sh \ + && sed -i 's/bash/sh/' /app/docker-entrypoint.sh + ENTRYPOINT [ "./docker-entrypoint.sh" ] CMD [ "npm", "start" ] From c5b1c601795bf96f05d15b8354ea59e214322b80 Mon Sep 17 00:00:00 2001 From: chandi Date: Mon, 1 Jun 2020 17:35:37 +0200 Subject: [PATCH 08/15] html5: revert to node 8, since source is not ready for node 12 --- mod/html5/Dockerfile | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/mod/html5/Dockerfile b/mod/html5/Dockerfile index e722e49..2d8cc50 100644 --- a/mod/html5/Dockerfile +++ b/mod/html5/Dockerfile @@ -1,4 +1,4 @@ -FROM node:12-buster-slim AS builder +FROM node:8-buster-slim AS builder RUN apt-get update && apt-get install -y wget curl subversion python2 python3 build-essential RUN groupadd -g 2000 meteor && useradd -m -u 2001 -g meteor meteor @@ -11,10 +11,10 @@ RUN wget https://github.com/jwilder/dockerize/releases/download/$DOCKERIZE_VERSI && rm dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz USER meteor -ENV METEOR_VERSION 1.9 +ENV METEOR_VERSION 1.8.1 RUN curl -sL https://install.meteor.com?release=$METEOR_VERSION | sed s/--progress-bar/-sL/g | /bin/sh -ENV TAG v2.2.14 +ENV TAG v2.2.15 RUN cd ~ \ && svn checkout https://github.com/bigbluebutton/bigbluebutton/tags/$TAG/bigbluebutton-html5 \ && mv ~/bigbluebutton-html5 ~/source \ @@ -25,13 +25,12 @@ RUN cd ~ \ # - set meteor release to 1.9 # - install newer fibers version (4.0.3) which supports node v12 -RUN sed -i -r 's/import (memwatch|heapdump).*//g' ~/source/imports/startup/server/index.js \ - && sed -i -r 's/.*(memwatch|heapdump).*//g' ~/source/package.json \ - && echo "METEOR@$METEOR_VERSION" > ~/source/.meteor/release \ - && cat ~/source/.meteor/release +# RUN sed -i -r 's/import (memwatch|heapdump).*//g' ~/source/imports/startup/server/index.js \ +# && sed -i -r 's/.*(memwatch|heapdump).*//g' ~/source/package.json \ +# && echo "METEOR@$METEOR_VERSION" > ~/source/.meteor/release \ +# && cat ~/source/.meteor/release RUN cd ~/source \ - && npm install fibers@4.0.3 --production --save \ && ~/.meteor/meteor npm install --production \ && ~/.meteor/meteor build --directory ~/app \ && rm -r ~/source @@ -41,7 +40,7 @@ RUN cd ~/app/bundle/programs/server \ # ------------------------------ -FROM node:12-alpine +FROM node:8-alpine RUN addgroup -g 2000 meteor && adduser -D -u 2001 -G meteor meteor COPY --from=builder /usr/local/bin/dockerize /usr/local/bin/dockerize From 7148ae733cf5584f1918e3c0ede84e0d1b242323 Mon Sep 17 00:00:00 2001 From: chandi Date: Sat, 6 Jun 2020 12:24:46 +0200 Subject: [PATCH 09/15] update kurento --- docker-compose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-compose.yml b/docker-compose.yml index 8ceddb8..ddfb96b 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -83,7 +83,7 @@ services: ipv4_address: 10.7.7.6 kurento: - image: kurento/kurento-media-server:6.13 + image: kurento/kurento-media-server:6.13.2 restart: unless-stopped environment: KMS_STUN_IP: ${STUN_IP} From 55d35d20ca3ab039f3ba2e628269c2f633873790 Mon Sep 17 00:00:00 2001 From: chandi Date: Sat, 6 Jun 2020 14:39:31 +0200 Subject: [PATCH 10/15] scripts: 'compose' and some minor fixes --- docker-compose.greenlight.yml | 2 +- docker-compose.yml | 4 ++-- scripts/compose | 22 ++++++++++++++++++++++ scripts/print-versions | 3 ++- scripts/upgrade | 17 +++++------------ 5 files changed, 32 insertions(+), 16 deletions(-) create mode 100755 scripts/compose diff --git a/docker-compose.greenlight.yml b/docker-compose.greenlight.yml index 8deee44..f1485cc 100644 --- a/docker-compose.greenlight.yml +++ b/docker-compose.greenlight.yml @@ -2,7 +2,7 @@ version: '3.6' services: greenlight: - container_name: greenlight-v2 + container_name: greenlight image: bigbluebutton/greenlight:v2 env_file: .env environment: diff --git a/docker-compose.yml b/docker-compose.yml index ddfb96b..9c0bd7a 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -11,8 +11,8 @@ services: SHARED_SECRET: ${SHARED_SECRET} WELCOME_FOOTER: ${WELCOME_FOOTER} STUN_SERVER: stun:${STUN_IP}:${STUN_PORT} - TURN_SERVER: ${TURN_SERVER} - TURN_SECRET: ${TURN_SECRET} + TURN_SERVER: ${TURN_SERVER:-} + TURN_SECRET: ${TURN_SECRET:-} volumes: - bigbluebutton:/var/bigbluebutton networks: diff --git a/scripts/compose b/scripts/compose new file mode 100755 index 0000000..2b41314 --- /dev/null +++ b/scripts/compose @@ -0,0 +1,22 @@ +#!/bin/bash +set -e + +cd $(dirname $0)/.. + +# load .env +if [ -f .env ] +then + # exclude WELCOME_FOOTER because it may contain invalid characters + export $(cat .env | sed 's/#.*//g' | grep -v "WELCOME_FOOTER" | xargs) +fi + +# concatenate docker-compose file +COMPOSE_FILES="-f docker-compose.yml" +if [ "$ENABLE_HTTPS_PROXY" == true ]; then + COMPOSE_FILES="$COMPOSE_FILES -f docker-compose.https.yml" +fi +if [ "$ENABLE_GREENLIGHT" == true ]; then + COMPOSE_FILES="$COMPOSE_FILES -f docker-compose.greenlight.yml" +fi + +docker-compose $COMPOSE_FILES $@ diff --git a/scripts/print-versions b/scripts/print-versions index 44cc0cf..b11419c 100755 --- a/scripts/print-versions +++ b/scripts/print-versions @@ -5,6 +5,7 @@ CORE_IMAGE=$(docker-compose images -q core) FREESWITCH_IMAGE=$(docker-compose images -q freeswitch) HTML5_IMAGE=$(docker-compose images -q html5) KURENTO_IMAGE=$(docker-compose images -q kurento) +ETHERPAD_IMAGE=$(docker-compose images -q etherpad) MONGO_IMAGE=$(docker-compose images -q mongodb) REDIS_IMAGE=$(docker-compose images -q redis) @@ -30,7 +31,7 @@ docker run --rm --entrypoint /bin/sh $CORE_IMAGE -c "dpkg -l 'bbb-*' | grep ii | echo "" echo "etherpad" -ETHERPAD_VERSION=$(docker-compose images etherpad | grep etherpad | awk '{print $3}') +ETHERPAD_VERSION=$(docker run --rm --entrypoint cat $ETHERPAD_IMAGE /opt/etherpad-lite/src/package.json | grep version | awk -F'"' '{print $4}') echo " version: $ETHERPAD_VERSION" echo "" diff --git a/scripts/upgrade b/scripts/upgrade index 1c0ee17..eb73733 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -7,7 +7,7 @@ if [ -z $RESTARTED ] then echo "# pull newest bigblugbutton-docker.git" - #git pull + git pull # restart script, since it might have changed. RESTARTED=1 ./scripts/upgrade @@ -20,13 +20,11 @@ else echo "" echo "# pull newest images" - docker-compose pull - docker-compose -f docker-compose.greenlight.yml pull - docker-compose -f docker-compose.https.yml pull + ./scripts/compose pull echo "" echo "# rebuild images" - docker-compose build --pull --no-cache + ./scripts/compose build --pull --no-cache COMMIT_HASH=$(git rev-parse --short HEAD) @@ -37,12 +35,7 @@ else echo "images successfully rebuilt!" echo "we are on $COMMIT_HASH ($BRANCH_NAME)" echo "" - echo "use following commands for restarting:" - echo "BigBlueButton:" - echo " $ docker-compose up -d" - echo "HTTPS Proxy:" - echo " $ docker-compose -f docker-compose.https.yml up -d" - echo "Greenlight:" - echo " $ docker-compose -f docker-compose.greenlight.yml up -d" + echo "use following command for restarting:" + echo " $ ./scripts/compose up -d" echo "-------------------------------------" fi \ No newline at end of file From 8ab2bec71e591c652c2a1f26a1efb9333ec61066 Mon Sep 17 00:00:00 2001 From: chandi Date: Sat, 6 Jun 2020 14:39:54 +0200 Subject: [PATCH 11/15] setup script, readme update and .env rework --- README.md | 87 +++++++++++++++------------------------------------ sample.env | 60 ++++++++++++++++++++++++++++++----- scripts/setup | 76 ++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 154 insertions(+), 69 deletions(-) create mode 100755 scripts/setup diff --git a/README.md b/README.md index b57a4eb..4bf8daf 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,5 @@ # BigBlueButton Docker -## Please note -- Not well tested, can be still really buggy. Don't use for production! - ## Install 1. Install docker-ce & docker-compose 1. follow instructions @@ -18,31 +15,18 @@ $ git clone --recurse-submodules https://github.com/alangecker/bigbluebutton-docker.git bbb-docker $ cd bbb-docker ``` -6. Create `.env` with `$ cp sample.env .env` -7. Adjust the values in `.env` - - **Important:** don't forget to change `ETHERPAD_API_KEY`, `SHARED_SECRET` and `RAILS_SECRET` to any random values! For example generated with `pwgen 40 3` - - `DOMAIN` and `EXTERNAL_IP` are also required. For example, use `dig +short ` to get your external ip address. -8. Start container. either... - - **Most common setup**: BigBlueButton with automatic HTTPS certificate retrieval and Greenlight - ```bash - $ docker-compose \ - -f docker-compose.yml \ - -f docker-compose.https.yml \ - -f docker-compose.greenlight.yml \ - up --detach - ``` - - **Individual parts**: - - BigBlueButton `$ docker-compose up -d` - - HTTPS reverse proxy - - `$ docker-compose -f docker-compose.https.yml up -d` - - API demos - - `$ docker-compose -f docker-compose.demo.yml up -d` - - Access https://bbb.example.com/demo/ - - Greenlight - - `$ docker-compose -f docker-compose.greenlight.yml up -d` - - Create an administrator account \ - `$ docker exec greenlight-v2 bundle exec rake admin:create` - - Access https://bbb.example.com/b +6. Run setup: + ```bash + $ ./scripts/setup + ``` +7. Start containers: + ```bash + $ ./scripts/compose up -d + ``` +8. If you use greenlight, you can create an admin account with: + ```bash + $ ./scripts/compose exec greenlight bundle exec rake admin:create + ``` @@ -65,53 +49,32 @@ Also don't forget to forward all necassary ports listed in http://docs.bigbluebu ## Upgrading -### Upgrade BigBlueButton -```bash -cd bbb-docker - -# pull repo changes -git pull - -# update bbb-webrtc-sfu -git submodule update --remote - -# rebuild images -docker-compose build --pull --no-cache - -# recreate updated services -docker-compose up -d -``` - -### Upgrade Greenlight -**Important:** especially with a version before 2020-05-17 create a database backup first, otherwise the data will not be persistent between container recreations. ```bash cd bbb-docker +# if you use greenlight: # create a database backup docker exec -t docker_postgres_1 pg_dumpall -c -U postgres > /root/greenlight_`date +%d-%m-%Y"_"%H_%M_%S`.sql -# pull repo changes -git pull +# upgrade! +./scripts/upgrade -# pull image updates -docker-compose -f docker-compose.greenlight.yml pull - -# recreate & restart services if necessary -docker-compose -f docker-compose.greenlight.yml up -d +# restart updated services +./scripts/compose up -d ``` -### Upgrade HTTPS Proxy -[to be written] +If you're on an old version, you might get following error: \ +`no such file or directory: ./scripts/upgrade` \ +A simple `$ git pull` resolves that, by fetching a newer version which includes the upgrade script. ## Special thanks to - @dkrenn, whos dockerized version (bigbluebutton#8858)(https://github.com/bigbluebutton/bigbluebutton/pull/8858) helped me a lot in understand and some configs. ## Open Tasks - add support for recording -- further separate bbb-core into individual container +- add coturn +- add prometheus exporter +- further separate `bbb-core` into individual container - enable IPv6 support -- fix captions (they don't appear, `readOnlyPadId` is missing) -- switch to `node:12-buster-slim` for `html5` -- switch to `node:12-buster-slim` for `webrtc-sfu` -- drop root privileges in `webrtc-sfu` -- drop root privileges in `kurento` +- switch `html5` to node v12 +- drop root privileges in `webrtc-sfu` \ No newline at end of file diff --git a/sample.env b/sample.env index 8ba77cc..4764d2c 100644 --- a/sample.env +++ b/sample.env @@ -1,8 +1,31 @@ -# important! change these to random values -ETHERPAD_API_KEY=NEQKi2eFXSBce4kyGjwAzMn2jeF66peNYQmyFVRr +# ==================================== +# ADDITIONS to BigBlueButton +# ==================================== +# (place a '#' before to disable them) + +# HTTPS Proxy +# fully automated Lets Encrypt certificates +ENABLE_HTTPS_PROXY=true + +# Greenlight Frontend +# https://docs.bigbluebutton.org/greenlight/gl-overview.html +ENABLE_GREENLIGHT=true + + +# ==================================== +# SECRETS +# ==================================== +# important! change these to any random values SHARED_SECRET=w6y7nycPafjPhVz3gZdBpQhR4H4MvEQzcZzia5LT +ETHERPAD_API_KEY=NEQKi2eFXSBce4kyGjwAzMn2jeF66peNYQmyFVRr RAILS_SECRET=cdfbae48b197805a435ab7881da31c642ac1a7d4d5c006441efa8125ae63865ce7c915c651117e0f14358cd98f5287c431929e0f796f4100b2b1c3eb5baad1b0 + + +# ==================================== +# CONNECTION +# ==================================== + DOMAIN=bbb.example.com EXTERNAL_IP=144.76.97.10 @@ -20,6 +43,11 @@ STUN_PORT=3478 #TURN_SERVER=turns:turn.example.com:443?transport=tcp #TURN_SECRET= + +# ==================================== +# CUSTOMIZATION +# ==================================== + CLIENT_TITLE=BigBlueButton WELCOME_FOOTER=This server is running BigBlueButton. @@ -32,9 +60,9 @@ WELCOME_FOOTER=This server is running Date: Sat, 6 Jun 2020 14:51:14 +0200 Subject: [PATCH 12/15] html5: upgrade to v2.2.16 --- mod/html5/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mod/html5/Dockerfile b/mod/html5/Dockerfile index 2d8cc50..3276c5c 100644 --- a/mod/html5/Dockerfile +++ b/mod/html5/Dockerfile @@ -14,7 +14,7 @@ USER meteor ENV METEOR_VERSION 1.8.1 RUN curl -sL https://install.meteor.com?release=$METEOR_VERSION | sed s/--progress-bar/-sL/g | /bin/sh -ENV TAG v2.2.15 +ENV TAG v2.2.16 RUN cd ~ \ && svn checkout https://github.com/bigbluebutton/bigbluebutton/tags/$TAG/bigbluebutton-html5 \ && mv ~/bigbluebutton-html5 ~/source \ From 1e38fd51a5bf9850b24b8d07c05a0bdd969776d6 Mon Sep 17 00:00:00 2001 From: chandi Date: Sat, 6 Jun 2020 20:05:39 +0200 Subject: [PATCH 13/15] setup: remove pwgen dependency --- scripts/setup | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/scripts/setup b/scripts/setup index 457e0f3..9ae72b0 100755 --- a/scripts/setup +++ b/scripts/setup @@ -3,7 +3,12 @@ set -e cd $(dirname $0)/.. -EXTERNAL_IP=$(curl -s http://whatismyip.akamai.com) +if ! [ -x "$(command -v curl)" ]; then + echo "Error: curl is not installed, but the setup script relies on it." + echo "on debian based operating systems try following command:" + echo " $ sudo apt-get install curl" + exit 1 +fi # load .env if [ -f .env ] @@ -13,12 +18,15 @@ then exit 1 fi -greenlight="n" + +EXTERNAL_IP=$(curl -s http://whatismyip.akamai.com) + +greenlight="" while [[ ! $greenlight =~ ^(y|n)$ ]]; do read -p "Should greenlight be included? (y/n): " greenlight done -https_proxy="n" +https_proxy="" while [[ ! $https_proxy =~ ^(y|n)$ ]]; do read -p "Should an automatic HTTPS Proxy be included? (y/n): " https_proxy done @@ -59,9 +67,9 @@ then fi # change secrets -RANDOM_1=$(pwgen -v 40 1) -RANDOM_2=$(pwgen -v 40 1) -RANDOM_3=$(pwgen -v 120 1) +RANDOM_1=$(head /dev/urandom | tr -dc A-Za-z0-9 | head -c 40) +RANDOM_2=$(head /dev/urandom | tr -dc A-Za-z0-9 | head -c 40) +RANDOM_3=$(head /dev/urandom | tr -dc a-f0-9 | head -c 128) sed -i "s/SHARED_SECRET=.*/SHARED_SECRET=$RANDOM_1/" .env sed -i "s/ETHERPAD_API_KEY=.*/ETHERPAD_API_KEY=$RANDOM_2/" .env sed -i "s/RAILS_SECRET=.*/RAILS_SECRET=$RANDOM_3/" .env From 5129826bf429e5c0166966db709cd53225a471af Mon Sep 17 00:00:00 2001 From: chandi Date: Sat, 6 Jun 2020 20:06:28 +0200 Subject: [PATCH 14/15] added missing restart policies --- docker-compose.greenlight.yml | 2 ++ docker-compose.https.yml | 2 +- docker-compose.yml | 2 ++ 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/docker-compose.greenlight.yml b/docker-compose.greenlight.yml index f1485cc..018ca9c 100644 --- a/docker-compose.greenlight.yml +++ b/docker-compose.greenlight.yml @@ -4,6 +4,7 @@ services: greenlight: container_name: greenlight image: bigbluebutton/greenlight:v2 + restart: unless-stopped env_file: .env environment: DB_ADAPTER: postgresql @@ -18,6 +19,7 @@ services: - 10.7.7.1:5000:80 postgres: image: postgres:12 + restart: unless-stopped environment: POSTGRES_DB: greenlight POSTGRES_USER: postgres diff --git a/docker-compose.https.yml b/docker-compose.https.yml index e115f60..aa0bab2 100644 --- a/docker-compose.https.yml +++ b/docker-compose.https.yml @@ -2,7 +2,7 @@ version: '3.6' services: https_proxy: image: valian/docker-nginx-auto-ssl - restart: on-failure + restart: unless-stopped ports: - 80:80 - 443:443 diff --git a/docker-compose.yml b/docker-compose.yml index 9c0bd7a..ee97f2d 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -21,6 +21,7 @@ services: freeswitch: build: mod/freeswitch + restart: unless-stopped cap_add: - IPC_LOCK - NET_ADMIN @@ -78,6 +79,7 @@ services: mongodb: image: mongo:4.2 + restart: unless-stopped networks: bbb-net: ipv4_address: 10.7.7.6 From bd0d944403b244a9337fe81020dba1cb4cdb618a Mon Sep 17 00:00:00 2001 From: chandi Date: Sat, 6 Jun 2020 20:13:28 +0200 Subject: [PATCH 15/15] fix for broken presentations containing UTF-8 characters --- mod/core/entrypoint.sh | 1 + mod/html5/entrypoint.sh | 1 + 2 files changed, 2 insertions(+) diff --git a/mod/core/entrypoint.sh b/mod/core/entrypoint.sh index 71e67df..bb06ca8 100755 --- a/mod/core/entrypoint.sh +++ b/mod/core/entrypoint.sh @@ -1,5 +1,6 @@ #!/bin/bash +export LANG=en_US.UTF-8 # generate bbb folders mkdir -p /var/bigbluebutton/recording/raw diff --git a/mod/html5/entrypoint.sh b/mod/html5/entrypoint.sh index d8b175d..08be159 100755 --- a/mod/html5/entrypoint.sh +++ b/mod/html5/entrypoint.sh @@ -6,6 +6,7 @@ export MONGO_URL=mongodb://10.7.7.6/meteor export NODE_ENV=production export ENVIRONMENT_TYPE=production export PORT=3000 +export LANG=en_US.UTF-8 rm -f /app/programs/server/assets/app/config/settings.yml dockerize \