From c21da11d4e3f69e17ef643eb7ca1ff04c51796cc Mon Sep 17 00:00:00 2001 From: chandi Date: Fri, 10 Apr 2020 13:29:06 +0200 Subject: [PATCH] use dockerize templates for bbb-html5 --- docker-compose.yml | 16 +++++++++++----- mod/bbb-apps-akka/application.conf | 6 +++--- mod/html5/Dockerfile | 12 ++++++++++-- mod/html5/entrypoint.sh | 5 ++++- mod/html5/settings.yml | 12 ++++++------ 5 files changed, 34 insertions(+), 17 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 11a960a..e0ef22f 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -74,8 +74,8 @@ services: kurento: image: kurento/kurento-media-server:6.13 environment: - KMS_STUN_IP: 64.233.177.127 # google stun server - KMS_STUN_PORT: 19302 + KMS_STUN_IP: ${STUN_IP} + KMS_STUN_PORT: ${STUN_PORT} KMS_MIN_PORT: 24577 KMS_MAX_PORT: 32768 KMS_EXTERNAL_ADDRESS: @@ -93,10 +93,10 @@ services: KURENTO_NAME: kurento REDIS_HOST: redis FREESWITCH_IP: host.docker.internal - FREESWITCH_SIP_IP: 144.76.97.34 + FREESWITCH_SIP_IP: ${EXTERNAL_IP} ESL_IP: host.docker.internal LOG_LEVEL: debug - NODE_CONFIG: '{"kurento":[{"ip":"144.76.97.34","url":"ws://kurento:8888/kurento"}]}' + NODE_CONFIG: '{"kurento":[{"ip":"${EXTERNAL_IP}","url":"ws://kurento:8888/kurento"}]}' ports: - "127.0.0.1:3008:3008" extra_hosts: @@ -110,11 +110,17 @@ services: depends_on: - redis - etherpad + 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: - bluenet volumes: - ./mod/html5/entrypoint.sh:/entrypoint.sh - - ./mod/html5/settings.yml:/app/programs/server/assets/app/config/settings.yml + - ./mod/html5/settings.yml:/app/programs/server/assets/app/config/settings.yml.tmpl networks: bluenet: diff --git a/mod/bbb-apps-akka/application.conf b/mod/bbb-apps-akka/application.conf index c2d98de..d382847 100644 --- a/mod/bbb-apps-akka/application.conf +++ b/mod/bbb-apps-akka/application.conf @@ -43,12 +43,12 @@ expire { } services { - bbbWebAPI="https://meet.livingutopia.org/bigbluebutton/api" - sharedSecret="I8x5c5yzaXZktgXK00tEqSi3B17nQySH5ssDWzxwL4" + bbbWebAPI="https://{{ .Env.DOMAIN }}/bigbluebutton/api" + sharedSecret="{{ .Env.SHARED_SECRET }}" } red5 { - deskshareip="meet.livingutopia.org" + deskshareip="{{ .Env.DOMAIN }}" deskshareapp="video-broadcast" } diff --git a/mod/html5/Dockerfile b/mod/html5/Dockerfile index 044a35d..b491683 100644 --- a/mod/html5/Dockerfile +++ b/mod/html5/Dockerfile @@ -2,17 +2,25 @@ FROM node:8-stretch ENV NODE_ENV production +ENV DOCKERIZE_VERSION v0.6.1 -RUN apt-get update && apt-get install -y sudo wget binutils +# 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 -RUN wget https://ubuntu.bigbluebutton.org/xenial-220/pool/main/b/bbb-html5/bbb-html5_2.2.0-870_amd64.deb \ +# download & install bbb-html5 package manually +RUN PACKAGE_PATH=$(curl -s https://ubuntu.bigbluebutton.org/xenial-220/dists/bigbluebutton-xenial/main/binary-amd64/Packages | grep -E 'Filename.*html5' | awk '{print $2}') \ + && wget https://ubuntu.bigbluebutton.org/xenial-220/$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 diff --git a/mod/html5/entrypoint.sh b/mod/html5/entrypoint.sh index 228a6ca..6c5bc5e 100755 --- a/mod/html5/entrypoint.sh +++ b/mod/html5/entrypoint.sh @@ -7,4 +7,7 @@ export NODE_ENV=production export ENVIRONMENT_TYPE=production export PORT=3000 -node main.js +rm /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 diff --git a/mod/html5/settings.yml b/mod/html5/settings.yml index 4e1c8c0..7940b16 100644 --- a/mod/html5/settings.yml +++ b/mod/html5/settings.yml @@ -7,7 +7,7 @@ public: listenOnlyMode: true forceListenOnly: false skipCheck: false - clientTitle: BigBlueButton + clientTitle: {{ .Env.CLIENT_TITLE }} appName: BigBlueButton HTML5 Client bbbServerVersion: 2.2-dev copyright: "©2019 BigBlueButton Inc." @@ -85,9 +85,9 @@ public: enableNetworkMonitoring: false packetLostThreshold: 10 kurento: - wsUrl: wss://meet.livingutopia.org/bbb-webrtc-sfu - chromeDefaultExtensionKey: akgoaoikmbmhcopjgakkcepdgdgkjfbc - chromeDefaultExtensionLink: https://chrome.google.com/webstore/detail/bigbluebutton-screenshare/akgoaoikmbmhcopjgakkcepdgdgkjfbc + wsUrl: wss://{{ .Env.DOMAIN }}/bbb-webrtc-sfu + chromeDefaultExtensionKey: {{ .Env.SCREENSHARE_EXTENSION_KEY }} + chromeDefaultExtensionLink: {{ .Env.SCREENSHARE_EXTENSION_LINK }} chromeExtensionKey: KEY chromeExtensionLink: LINK chromeScreenshareSources: @@ -158,7 +158,7 @@ public: enabled: true note: enabled: true - url: https://meet.livingutopia.org/pad + url: https://{{ .Env.DOMAIN }}/pad config: showLineNumbers: false showChat: false @@ -313,7 +313,7 @@ private: pencilChunkLength: 100 loadSlidesFromHttpAlways: false etherpad: - apikey: 9xLdxQJ8XoTUy3q7W4ZgpvKYqX16yqirdESk9i54FVm6PiJ1paRd8JOI1MT4pywm + apikey: {{ .Env.ETHERPAD_API_KEY }} version: 1.2.13 host: etherpad port: 9001