From 1800ce0cf862c9973c74584acd42bda630f9c217 Mon Sep 17 00:00:00 2001 From: Sofyan Sugianto Date: Fri, 12 Jun 2020 06:44:04 +0700 Subject: [PATCH 01/27] add recording --- mod/core/Dockerfile | 8 ++-- .../presentation.yml | 20 +++++++++ mod/core/entrypoint.sh | 3 ++ mod/core/supervisord.conf | 43 +++++++++++++++++++ mod/core/web/bigbluebutton.properties | 10 ++--- mod/html5/settings.yml | 6 +-- 6 files changed, 79 insertions(+), 11 deletions(-) create mode 100644 mod/core/bbb-playback-presentation/presentation.yml diff --git a/mod/core/Dockerfile b/mod/core/Dockerfile index d755859..67b36ec 100644 --- a/mod/core/Dockerfile +++ b/mod/core/Dockerfile @@ -39,9 +39,10 @@ RUN equivs-control redis-server.control \ RUN apt-get update && apt-get install -y bbb-web \ bbb-fsesl-akka bbb-apps-akka bbb-transcode-akka bbb-apps \ - bbb-apps-video bbb-apps-screenshare bbb-apps-video-broadcast + bbb-apps-video bbb-apps-screenshare bbb-apps-video-broadcast \ + bbb-record-core bbb-playback-presentation -# -- avoid blocking java +# -- avoid blocking java # https://github.com/bigbluebutton/bigbluebutton/issues/8959 RUN sed -i 's|securerandom.source=file:/dev/random|securerandom.source=file:/dev/urandom|g' /usr/lib/jvm/java-8-openjdk-amd64/jre/lib/security/java.security @@ -65,6 +66,8 @@ COPY bbb-apps-akka/application.conf /usr/share/bbb-apps-akka/conf/application.co COPY bbb-fsesl-akka/application.conf /etc/bbb-fsesl-akka/application.conf COPY bbb-transcode-akka/application.conf /etc/bbb-transcode-akka/application.conf COPY web-run.sh /usr/share/bbb-web/run-prod.sh +COPY bbb-playback-presentation/presentation.yml /usr/local/bigbluebutton/core/scripts/ +RUN mkdir -p /usr/src/bbb-playback-presentation && cp -r /var/bigbluebutton/playback /usr/src/bbb-src-playback COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf COPY entrypoint.sh /entrypoint.sh @@ -74,4 +77,3 @@ RUN mkdir -p /var/log/supervisor ENTRYPOINT ["/entrypoint.sh"] CMD [] - diff --git a/mod/core/bbb-playback-presentation/presentation.yml b/mod/core/bbb-playback-presentation/presentation.yml new file mode 100644 index 0000000..19973ce --- /dev/null +++ b/mod/core/bbb-playback-presentation/presentation.yml @@ -0,0 +1,20 @@ +video_output_width: 640 +video_output_height: 480 +# Alternate output size to use when deskshare videos are present +# Set higher so that deskshare output is higher quality, but uses more space. +deskshare_output_width: 1280 +deskshare_output_height: 720 +# offset applied to audio in the output video file +# audio_offset = 1200 means that the audio will be delayed by 1200ms +audio_offset: 0 +include_deskshare: true + +# For PRODUCTION +publish_dir: /var/bigbluebutton/published/presentation +video_formats: +- webm +# - mp4 + +# For DEVELOPMENT +#publish_dir: /home/ubuntu/temp/published/presentation + diff --git a/mod/core/entrypoint.sh b/mod/core/entrypoint.sh index bb06ca8..0ac1b6f 100755 --- a/mod/core/entrypoint.sh +++ b/mod/core/entrypoint.sh @@ -17,6 +17,9 @@ mkdir -p /var/bigbluebutton/unpublished # -- fix directory permissions chown -R bigbluebutton:bigbluebutton /var/bigbluebutton +# add playback-presentation to /var/bigbluebutton volume +cp -r /usr/src/bbb-src-playback /var/bigbluebutton/playback + dockerize \ -template /usr/share/bbb-web/WEB-INF/classes/bigbluebutton.properties.tmpl:/usr/share/bbb-web/WEB-INF/classes/bigbluebutton.properties \ -template /usr/share/bbb-apps-akka/conf/application.conf.tmpl:/usr/share/bbb-apps-akka/conf/application.conf \ diff --git a/mod/core/supervisord.conf b/mod/core/supervisord.conf index 2a581a5..cc40b52 100644 --- a/mod/core/supervisord.conf +++ b/mod/core/supervisord.conf @@ -43,4 +43,47 @@ stdout_logfile_maxbytes=0 stderr_logfile=/dev/fd/2 stderr_logfile_maxbytes=0 +[program:rap-archive-worker] +command=/usr/local/bin/prefix-log /usr/local/bin/recorder-monitor.py --event archive +user=bigbluebutton +directory=/usr/local/bigbluebutton/core/scripts +stdout_logfile=/dev/fd/1 +stdout_logfile_maxbytes=0 +stderr_logfile=/dev/fd/2 +stderr_logfile_maxbytes=0 +[program:rap-events-worker] +command=/usr/local/bin/prefix-log /usr/local/bin/recorder-monitor.py --event events +user=bigbluebutton +directory=/usr/local/bigbluebutton/core/scripts +stdout_logfile=/dev/fd/1 +stdout_logfile_maxbytes=0 +stderr_logfile=/dev/fd/2 +stderr_logfile_maxbytes=0 + +[program:rap-process-worker] +command=/usr/local/bin/prefix-log /usr/local/bin/recorder-monitor.py --event process +user=bigbluebutton +directory=/usr/local/bigbluebutton/core/scripts +stdout_logfile=/dev/fd/1 +stdout_logfile_maxbytes=0 +stderr_logfile=/dev/fd/2 +stderr_logfile_maxbytes=0 + +[program:rap-publish-worker] +command=/usr/local/bin/prefix-log /usr/local/bin/recorder-monitor.py --event publish +user=bigbluebutton +directory=/usr/local/bigbluebutton/core/scripts +stdout_logfile=/dev/fd/1 +stdout_logfile_maxbytes=0 +stderr_logfile=/dev/fd/2 +stderr_logfile_maxbytes=0 + +[program:rap-sanity-worker] +command=/usr/local/bin/prefix-log /usr/local/bin/recorder-monitor.py --event sanity +user=bigbluebutton +directory=/usr/local/bigbluebutton/core/scripts +stdout_logfile=/dev/fd/1 +stdout_logfile_maxbytes=0 +stderr_logfile=/dev/fd/2 +stderr_logfile_maxbytes=0 diff --git a/mod/core/web/bigbluebutton.properties b/mod/core/web/bigbluebutton.properties index 03b2575..d7893b8 100644 --- a/mod/core/web/bigbluebutton.properties +++ b/mod/core/web/bigbluebutton.properties @@ -19,7 +19,7 @@ # # These are the default properites for BigBlueButton Web application -# Default loglevel. +# Default loglevel. appLogLevel=DEBUG #---------------------------------------------------- @@ -189,18 +189,18 @@ userInactivityThresholdInMinutes=30 # warning before being logged out. userActivitySignResponseDelayInMinutes=5 -# Disable recording by default. +# Disable recording by default. # true - don't record even if record param in the api call is set to record # false - when record param is passed from api, override this default -disableRecordingDefault=true +disableRecordingDefault=false # Start recording when first user joins the meeting. # For backward compatibility with 0.81 where whole meeting -# is recorded. +# is recorded. autoStartRecording=false # Allow the user to start/stop recording. -allowStartStopRecording=false +allowStartStopRecording=true # Allow webcams streaming reception only to and from moderators webcamsOnlyForModerator=false diff --git a/mod/html5/settings.yml b/mod/html5/settings.yml index 6a4bda0..0b20696 100644 --- a/mod/html5/settings.yml +++ b/mod/html5/settings.yml @@ -105,11 +105,11 @@ public: cameraProfiles: - id: low name: Low quality - default: false + default: true bitrate: 100 - id: medium name: Medium quality - default: true + default: false bitrate: 200 - id: high name: High quality @@ -130,7 +130,7 @@ public: clearUsersInSeconds: 180 pongTimeInSeconds: 15 allowOutsideCommands: - toggleRecording: false + toggleRecording: true toggleSelfVoice: false poll: enabled: true From cad5652e65af96b84abcca3dc16810333e501764 Mon Sep 17 00:00:00 2001 From: Sofyan Sugianto Date: Fri, 12 Jun 2020 07:15:55 +0700 Subject: [PATCH 02/27] add missing monitor recording file --- mod/core/Dockerfile | 1 + .../recorder-monitor.py | 20 +++++++++++++++++++ 2 files changed, 21 insertions(+) create mode 100644 mod/core/bbb-playback-presentation/recorder-monitor.py diff --git a/mod/core/Dockerfile b/mod/core/Dockerfile index 67b36ec..a7e9dde 100644 --- a/mod/core/Dockerfile +++ b/mod/core/Dockerfile @@ -67,6 +67,7 @@ COPY bbb-fsesl-akka/application.conf /etc/bbb-fsesl-akka/application.conf COPY bbb-transcode-akka/application.conf /etc/bbb-transcode-akka/application.conf COPY web-run.sh /usr/share/bbb-web/run-prod.sh COPY bbb-playback-presentation/presentation.yml /usr/local/bigbluebutton/core/scripts/ +COPY bbb-playback-presentation/recorder-monitor.py /usr/local/bin RUN mkdir -p /usr/src/bbb-playback-presentation && cp -r /var/bigbluebutton/playback /usr/src/bbb-src-playback COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf diff --git a/mod/core/bbb-playback-presentation/recorder-monitor.py b/mod/core/bbb-playback-presentation/recorder-monitor.py new file mode 100644 index 0000000..b778591 --- /dev/null +++ b/mod/core/bbb-playback-presentation/recorder-monitor.py @@ -0,0 +1,20 @@ +# /usr/bin/env python3 + +import os +import argparse +import subprocess +import glob + +PATH_MONITOR = "/var/bigbluebutton/recording/status/" + +def file_monitor(event_to_check): + done_files = glob.glob(PATH_MONITOR + event_to_check + "/*.done") # List + while len(done_files) == 0: + os.sleep(5) + subprocess.Popen("/usr/local/bigbluebutton/scripts/rap-"+event_to_check+"-worker.rb", cwd="/usr/local/bigbluebutton/core/scripts") + +if __name__ == "__main__": + parser = argparse.ArgumentParser() + parser.add_argument("--event", type=str, dest=event_to_check, help="Event to check (archive, events, process, publish, sanity)") + args = parser.parse_args() + file_monitor(args.event_to_check) From c0933e27ab34949e677de53a0ed8ce4b3b7d296a Mon Sep 17 00:00:00 2001 From: Sofyan Sugianto Date: Fri, 12 Jun 2020 07:44:26 +0700 Subject: [PATCH 03/27] fix file permission --- mod/core/Dockerfile | 4 +++- mod/core/entrypoint.sh | 7 ++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/mod/core/Dockerfile b/mod/core/Dockerfile index a7e9dde..649b715 100644 --- a/mod/core/Dockerfile +++ b/mod/core/Dockerfile @@ -68,7 +68,9 @@ COPY bbb-transcode-akka/application.conf /etc/bbb-transcode-akka/application.con COPY web-run.sh /usr/share/bbb-web/run-prod.sh COPY bbb-playback-presentation/presentation.yml /usr/local/bigbluebutton/core/scripts/ COPY bbb-playback-presentation/recorder-monitor.py /usr/local/bin -RUN mkdir -p /usr/src/bbb-playback-presentation && cp -r /var/bigbluebutton/playback /usr/src/bbb-src-playback +RUN chmod +x /usr/local/bin/recorder-monitor.py && \ +mkdir -p /usr/src/bbb-playback-presentation && \ +cp -r /var/bigbluebutton/playback/* /usr/src/bbb-src-playback COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf COPY entrypoint.sh /entrypoint.sh diff --git a/mod/core/entrypoint.sh b/mod/core/entrypoint.sh index 0ac1b6f..7db1033 100755 --- a/mod/core/entrypoint.sh +++ b/mod/core/entrypoint.sh @@ -13,13 +13,14 @@ mkdir -p /var/bigbluebutton/recording/status/sanity mkdir -p /var/bigbluebutton/published mkdir -p /var/bigbluebutton/deleted mkdir -p /var/bigbluebutton/unpublished +mkdir -p /var/bigbluebutton/playback + +# add playback-presentation to /var/bigbluebutton volume +cp -r /usr/src/bbb-src-playback/* /var/bigbluebutton/playback # -- fix directory permissions chown -R bigbluebutton:bigbluebutton /var/bigbluebutton -# add playback-presentation to /var/bigbluebutton volume -cp -r /usr/src/bbb-src-playback /var/bigbluebutton/playback - dockerize \ -template /usr/share/bbb-web/WEB-INF/classes/bigbluebutton.properties.tmpl:/usr/share/bbb-web/WEB-INF/classes/bigbluebutton.properties \ -template /usr/share/bbb-apps-akka/conf/application.conf.tmpl:/usr/share/bbb-apps-akka/conf/application.conf \ From 2dfbb33bd4b31e8cc63d11450c5a67daf853cc96 Mon Sep 17 00:00:00 2001 From: Sofyan Sugianto Date: Fri, 12 Jun 2020 07:49:13 +0700 Subject: [PATCH 04/27] fix typo --- mod/core/bbb-playback-presentation/recorder-monitor.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mod/core/bbb-playback-presentation/recorder-monitor.py b/mod/core/bbb-playback-presentation/recorder-monitor.py index b778591..70b8bd2 100644 --- a/mod/core/bbb-playback-presentation/recorder-monitor.py +++ b/mod/core/bbb-playback-presentation/recorder-monitor.py @@ -1,4 +1,4 @@ -# /usr/bin/env python3 +#!/usr/bin/env python3 import os import argparse From e304bebe9ccf78cb9ebbc58cabf88480e2f50262 Mon Sep 17 00:00:00 2001 From: Sofyan Sugianto Date: Fri, 12 Jun 2020 07:57:58 +0700 Subject: [PATCH 05/27] fix argparse error --- mod/core/bbb-playback-presentation/recorder-monitor.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mod/core/bbb-playback-presentation/recorder-monitor.py b/mod/core/bbb-playback-presentation/recorder-monitor.py index 70b8bd2..0a1175b 100644 --- a/mod/core/bbb-playback-presentation/recorder-monitor.py +++ b/mod/core/bbb-playback-presentation/recorder-monitor.py @@ -15,6 +15,6 @@ def file_monitor(event_to_check): if __name__ == "__main__": parser = argparse.ArgumentParser() - parser.add_argument("--event", type=str, dest=event_to_check, help="Event to check (archive, events, process, publish, sanity)") + parser.add_argument("--event", type=str, dest="event_to_check", help="Event to check (archive, events, process, publish, sanity)") args = parser.parse_args() file_monitor(args.event_to_check) From 78a38656bb4a0252f388ff64ec2578114fd379a2 Mon Sep 17 00:00:00 2001 From: Sofyan Sugianto Date: Fri, 12 Jun 2020 08:03:04 +0700 Subject: [PATCH 06/27] fix time sleep error --- mod/core/bbb-playback-presentation/recorder-monitor.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mod/core/bbb-playback-presentation/recorder-monitor.py b/mod/core/bbb-playback-presentation/recorder-monitor.py index 0a1175b..87c0788 100644 --- a/mod/core/bbb-playback-presentation/recorder-monitor.py +++ b/mod/core/bbb-playback-presentation/recorder-monitor.py @@ -1,6 +1,6 @@ #!/usr/bin/env python3 -import os +import time import argparse import subprocess import glob @@ -10,7 +10,7 @@ PATH_MONITOR = "/var/bigbluebutton/recording/status/" def file_monitor(event_to_check): done_files = glob.glob(PATH_MONITOR + event_to_check + "/*.done") # List while len(done_files) == 0: - os.sleep(5) + time.sleep(5) subprocess.Popen("/usr/local/bigbluebutton/scripts/rap-"+event_to_check+"-worker.rb", cwd="/usr/local/bigbluebutton/core/scripts") if __name__ == "__main__": From 0d082467df1460f3339baf93b3432b591da8f220 Mon Sep 17 00:00:00 2001 From: Sofyan Sugianto Date: Fri, 12 Jun 2020 08:14:05 +0700 Subject: [PATCH 07/27] fix infinite loop --- mod/core/bbb-playback-presentation/recorder-monitor.py | 1 + 1 file changed, 1 insertion(+) diff --git a/mod/core/bbb-playback-presentation/recorder-monitor.py b/mod/core/bbb-playback-presentation/recorder-monitor.py index 87c0788..1403b61 100644 --- a/mod/core/bbb-playback-presentation/recorder-monitor.py +++ b/mod/core/bbb-playback-presentation/recorder-monitor.py @@ -11,6 +11,7 @@ def file_monitor(event_to_check): done_files = glob.glob(PATH_MONITOR + event_to_check + "/*.done") # List while len(done_files) == 0: time.sleep(5) + done_files = glob.glob(PATH_MONITOR + event_to_check + "/*.done") # List subprocess.Popen("/usr/local/bigbluebutton/scripts/rap-"+event_to_check+"-worker.rb", cwd="/usr/local/bigbluebutton/core/scripts") if __name__ == "__main__": From 4ade61324b1ac4785b74f2bac0bfa9315cab7d75 Mon Sep 17 00:00:00 2001 From: Sofyan Sugianto Date: Fri, 12 Jun 2020 08:16:30 +0700 Subject: [PATCH 08/27] test the bbb-record --- mod/core/Dockerfile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/mod/core/Dockerfile b/mod/core/Dockerfile index 649b715..836538a 100644 --- a/mod/core/Dockerfile +++ b/mod/core/Dockerfile @@ -72,6 +72,9 @@ RUN chmod +x /usr/local/bin/recorder-monitor.py && \ mkdir -p /usr/src/bbb-playback-presentation && \ cp -r /var/bigbluebutton/playback/* /usr/src/bbb-src-playback +RUN wget -O /usr/local/bin/bbb-record https://raw.githubusercontent.com/bigbluebutton/bigbluebutton/develop/bigbluebutton-config/bin/bbb-record \ +&& chmod +x /usr/local/bin/bbb-record + COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf COPY entrypoint.sh /entrypoint.sh From 60c5b1890bbfc7be474f74f7a36a2d2de33971e9 Mon Sep 17 00:00:00 2001 From: Sofyan Sugianto Date: Tue, 16 Jun 2020 04:47:40 +0700 Subject: [PATCH 09/27] use main recording scripts for supervisord --- mod/core/supervisord.conf | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/mod/core/supervisord.conf b/mod/core/supervisord.conf index cc40b52..7307b31 100644 --- a/mod/core/supervisord.conf +++ b/mod/core/supervisord.conf @@ -44,7 +44,7 @@ stderr_logfile=/dev/fd/2 stderr_logfile_maxbytes=0 [program:rap-archive-worker] -command=/usr/local/bin/prefix-log /usr/local/bin/recorder-monitor.py --event archive +command=/usr/local/bin/prefix-log /usr/bin/ruby /usr/local/bigbluebutton/scripts/rap-archive-worker.rb user=bigbluebutton directory=/usr/local/bigbluebutton/core/scripts stdout_logfile=/dev/fd/1 @@ -53,7 +53,7 @@ stderr_logfile=/dev/fd/2 stderr_logfile_maxbytes=0 [program:rap-events-worker] -command=/usr/local/bin/prefix-log /usr/local/bin/recorder-monitor.py --event events +command=/usr/local/bin/prefix-log /usr/bin/ruby /usr/local/bigbluebutton/scripts/rap-events-worker.rb user=bigbluebutton directory=/usr/local/bigbluebutton/core/scripts stdout_logfile=/dev/fd/1 @@ -62,7 +62,7 @@ stderr_logfile=/dev/fd/2 stderr_logfile_maxbytes=0 [program:rap-process-worker] -command=/usr/local/bin/prefix-log /usr/local/bin/recorder-monitor.py --event process +command=/usr/local/bin/prefix-log /usr/bin/ruby /usr/local/bigbluebutton/scripts/rap-process-worker.rb user=bigbluebutton directory=/usr/local/bigbluebutton/core/scripts stdout_logfile=/dev/fd/1 @@ -71,7 +71,7 @@ stderr_logfile=/dev/fd/2 stderr_logfile_maxbytes=0 [program:rap-publish-worker] -command=/usr/local/bin/prefix-log /usr/local/bin/recorder-monitor.py --event publish +command=/usr/local/bin/prefix-log /usr/bin/ruby /usr/local/bigbluebutton/scripts/rap-publish-worker.rb user=bigbluebutton directory=/usr/local/bigbluebutton/core/scripts stdout_logfile=/dev/fd/1 @@ -80,7 +80,7 @@ stderr_logfile=/dev/fd/2 stderr_logfile_maxbytes=0 [program:rap-sanity-worker] -command=/usr/local/bin/prefix-log /usr/local/bin/recorder-monitor.py --event sanity +command=/usr/local/bin/prefix-log /usr/bin/ruby /usr/local/bigbluebutton/scripts/rap-sanity-worker.rb user=bigbluebutton directory=/usr/local/bigbluebutton/core/scripts stdout_logfile=/dev/fd/1 From 9ce65a23f05a97cd4a00341f1d4e1820a77c08d5 Mon Sep 17 00:00:00 2001 From: Sofyan Sugianto Date: Thu, 18 Jun 2020 04:41:59 +0700 Subject: [PATCH 10/27] use bash to monitor files --- .../record-monitor.sh | 58 +++++++++++++++++++ .../recorder-monitor.py | 21 ------- 2 files changed, 58 insertions(+), 21 deletions(-) create mode 100755 mod/core/bbb-playback-presentation/record-monitor.sh delete mode 100644 mod/core/bbb-playback-presentation/recorder-monitor.py diff --git a/mod/core/bbb-playback-presentation/record-monitor.sh b/mod/core/bbb-playback-presentation/record-monitor.sh new file mode 100755 index 0000000..df7459a --- /dev/null +++ b/mod/core/bbb-playback-presentation/record-monitor.sh @@ -0,0 +1,58 @@ +#!/bin/bash + +# /var/bigbluebutton/recording/status/processed/*.done -> publish-worker.rb +# /var/bigbluebutton/recording/status/sanity/*.done -> process-worker +# /var/bigbluebutton/recording/status/ended/*.done -> events-worker +# /var/bigbluebutton/recording/status/recorded/*.done -> archive-worker +# /var/bigbluebutton/recording/status/archived/*.done -> sanity-worker + +FILES_TO_CHECK=$1 + +PATH_TO_CHECK="/var/bigbluebutton/recording/status" +CMD_DIR_PATH="/usr/local/bigbluebutton/core/scripts" + +function do_monitoring() { + check_done_files + while ! compgen -G "$PATH_TO_CHECK" > /dev/null; do + echo "$PATH_TO_CHECK returning 0 files, sleeping for 30s..." + sleep 30 + done + if [[ -d "$CMD_DIR_PATH" ]]; then + pushd $CMD_DIR_PATH > /dev/null + ruby $CMD_PATH + popd > /dev/null + fi + sleep 5 + echo "Re-monitoring files.." + do_monitoring +} + +function check_done_files() { + echo "$FILES_TO_CHECK" + if [[ ! -z $FILES_TO_CHECK ]]; then + if [[ $FILES_TO_CHECK == "processed" ]]; then + PATH_TO_CHECK="$PATH_TO_CHECK/processed/*.done" + CMD_PATH="/usr/local/bigbluebutton/core/scripts/rap-publish-worker.rb" + elif [[ $FILES_TO_CHECK == "sanity" ]]; then + PATH_TO_CHECK="$PATH_TO_CHECK/sanity/*.done" + CMD_PATH="/usr/local/bigbluebutton/core/scripts/rap-process-worker.rb" + elif [[ $FILES_TO_CHECK == "ended" ]]; then + PATH_TO_CHECK="$PATH_TO_CHECK/ended/*.done" + CMD_PATH="/usr/local/bigbluebutton/core/scripts/rap-events-worker.rb" + elif [[ $FILES_TO_CHECK == "recorded" ]]; then + PATH_TO_CHECK="$PATH_TO_CHECK/recorded/*.done" + CMD_PATH="/usr/local/bigbluebutton/core/scripts/rap-archive-worker.rb" + elif [[ $FILES_TO_CHECK == "archived" ]]; then + PATH_TO_CHECK="$PATH_TO_CHECK/archived/*.done" + CMD_PATH="/usr/local/bigbluebutton/core/scripts/rap-sanity-worker.rb" + else + echo "invalid argument, exiting..." + exit + fi + else + echo "invalid argument, exiting..." + exit + fi +} + +do_monitoring diff --git a/mod/core/bbb-playback-presentation/recorder-monitor.py b/mod/core/bbb-playback-presentation/recorder-monitor.py deleted file mode 100644 index 1403b61..0000000 --- a/mod/core/bbb-playback-presentation/recorder-monitor.py +++ /dev/null @@ -1,21 +0,0 @@ -#!/usr/bin/env python3 - -import time -import argparse -import subprocess -import glob - -PATH_MONITOR = "/var/bigbluebutton/recording/status/" - -def file_monitor(event_to_check): - done_files = glob.glob(PATH_MONITOR + event_to_check + "/*.done") # List - while len(done_files) == 0: - time.sleep(5) - done_files = glob.glob(PATH_MONITOR + event_to_check + "/*.done") # List - subprocess.Popen("/usr/local/bigbluebutton/scripts/rap-"+event_to_check+"-worker.rb", cwd="/usr/local/bigbluebutton/core/scripts") - -if __name__ == "__main__": - parser = argparse.ArgumentParser() - parser.add_argument("--event", type=str, dest="event_to_check", help="Event to check (archive, events, process, publish, sanity)") - args = parser.parse_args() - file_monitor(args.event_to_check) From befebed04fb012079e6368283c1965dc2abad4b4 Mon Sep 17 00:00:00 2001 From: Sofyan Sugianto Date: Thu, 18 Jun 2020 04:42:29 +0700 Subject: [PATCH 11/27] update supervisor to run record-monitor.sh --- mod/core/supervisord.conf | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/mod/core/supervisord.conf b/mod/core/supervisord.conf index 7307b31..9bae66b 100644 --- a/mod/core/supervisord.conf +++ b/mod/core/supervisord.conf @@ -44,45 +44,55 @@ stderr_logfile=/dev/fd/2 stderr_logfile_maxbytes=0 [program:rap-archive-worker] -command=/usr/local/bin/prefix-log /usr/bin/ruby /usr/local/bigbluebutton/scripts/rap-archive-worker.rb +command=/usr/local/bin/prefix-log /usr/local/bin/record-monitor.sh recorded user=bigbluebutton directory=/usr/local/bigbluebutton/core/scripts +autostart=true +autorestart=true stdout_logfile=/dev/fd/1 stdout_logfile_maxbytes=0 stderr_logfile=/dev/fd/2 stderr_logfile_maxbytes=0 [program:rap-events-worker] -command=/usr/local/bin/prefix-log /usr/bin/ruby /usr/local/bigbluebutton/scripts/rap-events-worker.rb +command=/usr/local/bin/prefix-log /usr/local/bin/record-monitor.sh ended user=bigbluebutton directory=/usr/local/bigbluebutton/core/scripts +autostart=true +autorestart=true stdout_logfile=/dev/fd/1 stdout_logfile_maxbytes=0 stderr_logfile=/dev/fd/2 stderr_logfile_maxbytes=0 [program:rap-process-worker] -command=/usr/local/bin/prefix-log /usr/bin/ruby /usr/local/bigbluebutton/scripts/rap-process-worker.rb +command=/usr/local/bin/prefix-log /usr/local/bin/record-monitor.sh sanity user=bigbluebutton directory=/usr/local/bigbluebutton/core/scripts +autostart=true +autorestart=true stdout_logfile=/dev/fd/1 stdout_logfile_maxbytes=0 stderr_logfile=/dev/fd/2 stderr_logfile_maxbytes=0 [program:rap-publish-worker] -command=/usr/local/bin/prefix-log /usr/bin/ruby /usr/local/bigbluebutton/scripts/rap-publish-worker.rb +command=/usr/local/bin/prefix-log /usr/local/bin/record-monitor.sh processed user=bigbluebutton directory=/usr/local/bigbluebutton/core/scripts +autostart=true +autorestart=true stdout_logfile=/dev/fd/1 stdout_logfile_maxbytes=0 stderr_logfile=/dev/fd/2 stderr_logfile_maxbytes=0 [program:rap-sanity-worker] -command=/usr/local/bin/prefix-log /usr/bin/ruby /usr/local/bigbluebutton/scripts/rap-sanity-worker.rb +command=/usr/local/bin/prefix-log /usr/local/bin/record-monitor.sh archived user=bigbluebutton directory=/usr/local/bigbluebutton/core/scripts +autostart=true +autorestart=true stdout_logfile=/dev/fd/1 stdout_logfile_maxbytes=0 stderr_logfile=/dev/fd/2 From 0ebfe4d0bd939968adf9c6410fefe03ca7a6f149 Mon Sep 17 00:00:00 2001 From: Sofyan Sugianto Date: Thu, 18 Jun 2020 04:42:54 +0700 Subject: [PATCH 12/27] update Dockerfile --- mod/core/Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mod/core/Dockerfile b/mod/core/Dockerfile index 836538a..da6f6b5 100644 --- a/mod/core/Dockerfile +++ b/mod/core/Dockerfile @@ -67,8 +67,8 @@ COPY bbb-fsesl-akka/application.conf /etc/bbb-fsesl-akka/application.conf COPY bbb-transcode-akka/application.conf /etc/bbb-transcode-akka/application.conf COPY web-run.sh /usr/share/bbb-web/run-prod.sh COPY bbb-playback-presentation/presentation.yml /usr/local/bigbluebutton/core/scripts/ -COPY bbb-playback-presentation/recorder-monitor.py /usr/local/bin -RUN chmod +x /usr/local/bin/recorder-monitor.py && \ +COPY bbb-playback-presentation/record-monitor.sh /usr/local/bin +RUN chmod +x /usr/local/bin/record-monitor.sh && \ mkdir -p /usr/src/bbb-playback-presentation && \ cp -r /var/bigbluebutton/playback/* /usr/src/bbb-src-playback From 88fb25c9e6a081da1b9807eab8469f87b2c75129 Mon Sep 17 00:00:00 2001 From: Sofyan Sugianto Date: Thu, 18 Jun 2020 05:47:46 +0700 Subject: [PATCH 13/27] fix override path variables --- mod/core/bbb-playback-presentation/record-monitor.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/mod/core/bbb-playback-presentation/record-monitor.sh b/mod/core/bbb-playback-presentation/record-monitor.sh index df7459a..61ede81 100755 --- a/mod/core/bbb-playback-presentation/record-monitor.sh +++ b/mod/core/bbb-playback-presentation/record-monitor.sh @@ -12,7 +12,6 @@ PATH_TO_CHECK="/var/bigbluebutton/recording/status" CMD_DIR_PATH="/usr/local/bigbluebutton/core/scripts" function do_monitoring() { - check_done_files while ! compgen -G "$PATH_TO_CHECK" > /dev/null; do echo "$PATH_TO_CHECK returning 0 files, sleeping for 30s..." sleep 30 @@ -27,7 +26,7 @@ function do_monitoring() { do_monitoring } -function check_done_files() { +function initialize_variables() { echo "$FILES_TO_CHECK" if [[ ! -z $FILES_TO_CHECK ]]; then if [[ $FILES_TO_CHECK == "processed" ]]; then @@ -55,4 +54,7 @@ function check_done_files() { fi } +# first check variables +initialize_variables +# main execution do_monitoring From ff2f590c9407f33adf7e5ef7a3652ba47fc829a1 Mon Sep 17 00:00:00 2001 From: Sofyan Sugianto Date: Thu, 18 Jun 2020 06:03:47 +0700 Subject: [PATCH 14/27] fix playback url not using env.Domain --- mod/core/Dockerfile | 2 +- mod/core/bigbluebutton.yml | 2 +- mod/core/entrypoint.sh | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/mod/core/Dockerfile b/mod/core/Dockerfile index da6f6b5..e0f42b4 100644 --- a/mod/core/Dockerfile +++ b/mod/core/Dockerfile @@ -57,7 +57,7 @@ COPY red5-webapps/screenshare/application.conf /usr/share/red5/webapps/screensha COPY red5-webapps/video/bigbluebutton-video.properties /usr/share/red5/webapps/video/WEB-INF/bigbluebutton-video.properties COPY red5-webapps/video-broadcast/video-broadcast.properties /usr/share/red5/webapps/video-broadcast/WEB-INF/video-broadcast.properties -COPY bigbluebutton.yml /usr/local/bigbluebutton/core/scripts/bigbluebutton.yml +COPY bigbluebutton.yml /usr/local/bigbluebutton/core/scripts/bigbluebutton.yml.tmpl COPY web/bigbluebutton.properties /usr/share/bbb-web/WEB-INF/classes/bigbluebutton.properties.tmpl COPY web/turn-stun-servers.xml /usr/share/bbb-web/WEB-INF/classes/spring/turn-stun-servers.xml.tmpl diff --git a/mod/core/bigbluebutton.yml b/mod/core/bigbluebutton.yml index b6ade01..b899051 100644 --- a/mod/core/bigbluebutton.yml +++ b/mod/core/bigbluebutton.yml @@ -25,7 +25,7 @@ events_dir: /var/bigbluebutton/events recording_dir: /var/bigbluebutton/recording published_dir: /var/bigbluebutton/published captions_dir: /var/bigbluebutton/captions -playback_host: meet.livingutopia.org +playback_host: {{ .Env.DOMAIN }} playback_protocol: https # For DEVELOPMENT diff --git a/mod/core/entrypoint.sh b/mod/core/entrypoint.sh index 7db1033..a17f38b 100755 --- a/mod/core/entrypoint.sh +++ b/mod/core/entrypoint.sh @@ -22,6 +22,7 @@ cp -r /usr/src/bbb-src-playback/* /var/bigbluebutton/playback chown -R bigbluebutton:bigbluebutton /var/bigbluebutton dockerize \ + -template /usr/local/bigbluebutton/core/scripts/bigbluebutton.yml.tmpl:/usr/local/bigbluebutton/core/scripts/bigbluebutton.yml \ -template /usr/share/bbb-web/WEB-INF/classes/bigbluebutton.properties.tmpl:/usr/share/bbb-web/WEB-INF/classes/bigbluebutton.properties \ -template /usr/share/bbb-apps-akka/conf/application.conf.tmpl:/usr/share/bbb-apps-akka/conf/application.conf \ -template /usr/share/bbb-web/WEB-INF/classes/spring/turn-stun-servers.xml.tmpl:/usr/share/bbb-web/WEB-INF/classes/spring/turn-stun-servers.xml \ From fe17745096519f02efc9afc8862f1c0042eb67ad Mon Sep 17 00:00:00 2001 From: Sofyan Sugianto Date: Sat, 15 Aug 2020 08:26:33 +0700 Subject: [PATCH 15/27] re-commit recordings from upstream for testing only --- docker-compose.recordings.yml | 13 +++ docker-compose.yml | 18 ++-- mod/core/Dockerfile | 16 +--- .../presentation.yml | 20 ----- .../record-monitor.sh | 60 ------------- mod/core/entrypoint.sh | 7 ++ mod/core/supervisord.conf | 57 +------------ mod/core/web/bigbluebutton.properties | 4 + mod/freeswitch/Dockerfile | 10 +++ mod/freeswitch/entrypoint.sh | 3 + mod/nginx/Dockerfile | 14 ++++ mod/nginx/bbb/presentation.nginx | 12 +-- mod/recordings/Dockerfile | 84 +++++++++++++++++++ mod/{core => recordings}/bigbluebutton.yml | 4 +- mod/recordings/entrypoint.sh | 18 ++++ mod/recordings/log-collector.py | 45 ++++++++++ sample.env | 8 ++ scripts/bbb-record | 20 +++++ scripts/compose | 4 + 19 files changed, 250 insertions(+), 167 deletions(-) create mode 100644 docker-compose.recordings.yml delete mode 100644 mod/core/bbb-playback-presentation/presentation.yml delete mode 100755 mod/core/bbb-playback-presentation/record-monitor.sh create mode 100644 mod/nginx/Dockerfile create mode 100644 mod/recordings/Dockerfile rename mod/{core => recordings}/bigbluebutton.yml (95%) create mode 100644 mod/recordings/entrypoint.sh create mode 100644 mod/recordings/log-collector.py create mode 100755 scripts/bbb-record diff --git a/docker-compose.recordings.yml b/docker-compose.recordings.yml new file mode 100644 index 0000000..1d2b155 --- /dev/null +++ b/docker-compose.recordings.yml @@ -0,0 +1,13 @@ +version: '3.6' +services: + recordings-process: + build: mod/recordings-process + environment: + DOMAIN: ${DOMAIN} + volumes: + - /var/bigbluebutton:/var/bigbluebutton + - vol-freeswitch:/var/freeswitch/meetings + - vol-kurento:/var/kurento + networks: + bbb-net: + ipv4_address: 10.7.7.16 \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index c124ac7..0358fa1 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -9,6 +9,7 @@ services: environment: DEV_MODE: ${DEV_MODE:-} DOMAIN: ${DOMAIN} + ENABLE_RECORDING: ${ENABLE_RECORDING:-false} SHARED_SECRET: ${SHARED_SECRET} WELCOME_MESSAGE: ${WELCOME_MESSAGE:-} WELCOME_FOOTER: ${WELCOME_FOOTER} @@ -16,7 +17,9 @@ services: TURN_SERVER: ${TURN_SERVER:-} TURN_SECRET: ${TURN_SECRET:-} volumes: - - bigbluebutton:/var/bigbluebutton + - /var/bigbluebutton:/var/bigbluebutton + - vol-freeswitch:/var/freeswitch/meetings + - vol-kurento:/var/kurento networks: bbb-net: ipv4_address: 10.7.7.2 @@ -41,10 +44,11 @@ services: volumes: - ./conf/sip_profiles:/etc/freeswitch/sip_profiles/external - ./conf/dialplan_public:/etc/freeswitch/dialplan/public_docker + - vol-freeswitch:/var/freeswitch/meetings network_mode: host nginx: - image: nginx:1.19-alpine + build: mod/nginx restart: unless-stopped depends_on: - etherpad @@ -53,9 +57,7 @@ services: ports: - "8080:80" volumes: - - bigbluebutton:/var/bigbluebutton - - ./mod/nginx/bbb:/etc/nginx/bbb - - ./mod/nginx/bigbluebutton:/etc/nginx/conf.d/default.conf + - /var/bigbluebutton:/var/bigbluebutton - ${DEFAULT_PRESENTATION:-/dev/null}:/etc/nginx/html/default.pdf network_mode: host extra_hosts: @@ -103,6 +105,8 @@ services: KMS_TURN_URL: KMS_NETWORK_INTERFACES: ${NETWORK_INTERFACE:-} network_mode: host + volumes: + - vol-kurento:/var/kurento webrtc-sfu: build: @@ -160,13 +164,15 @@ services: - mongodb volumes: - /var/run/docker.sock:/var/run/docker.sock - - bigbluebutton:/var/bigbluebutton + - /var/bigbluebutton:/var/bigbluebutton networks: bbb-net: ipv4_address: 10.7.7.12 volumes: bigbluebutton: + vol-freeswitch: + vol-kurento: networks: bbb-net: diff --git a/mod/core/Dockerfile b/mod/core/Dockerfile index 4c7291a..c53d192 100644 --- a/mod/core/Dockerfile +++ b/mod/core/Dockerfile @@ -4,7 +4,6 @@ MAINTAINER ffdixon@bigbluebutton.org # TODO: # - separate bbb-apps into an own container # - separate bbb-web -# - remove systemd ENV DEBIAN_FRONTEND noninteractive ENV container docker @@ -43,8 +42,7 @@ ENV VERSION v2.2.22 RUN apt-get update && apt-get install -y bbb-web \ bbb-fsesl-akka bbb-apps-akka bbb-transcode-akka bbb-apps \ - bbb-apps-video bbb-apps-screenshare bbb-apps-video-broadcast \ - bbb-record-core bbb-playback-presentation + bbb-apps-video bbb-apps-screenshare bbb-apps-video-broadcast # -- avoid blocking java # https://github.com/bigbluebutton/bigbluebutton/issues/8959 @@ -61,8 +59,6 @@ COPY red5-webapps/screenshare/application.conf /usr/share/red5/webapps/screensha COPY red5-webapps/video/bigbluebutton-video.properties /usr/share/red5/webapps/video/WEB-INF/bigbluebutton-video.properties COPY red5-webapps/video-broadcast/video-broadcast.properties /usr/share/red5/webapps/video-broadcast/WEB-INF/video-broadcast.properties -COPY bigbluebutton.yml /usr/local/bigbluebutton/core/scripts/bigbluebutton.yml.tmpl - COPY web/bigbluebutton.properties /usr/share/bbb-web/WEB-INF/classes/bigbluebutton.properties.tmpl COPY web/turn-stun-servers.xml /usr/share/bbb-web/WEB-INF/classes/spring/turn-stun-servers.xml.tmpl @@ -70,14 +66,10 @@ COPY bbb-apps-akka/application.conf /usr/share/bbb-apps-akka/conf/application.co COPY bbb-fsesl-akka/application.conf /etc/bbb-fsesl-akka/application.conf COPY bbb-transcode-akka/application.conf /etc/bbb-transcode-akka/application.conf COPY web-run.sh /usr/share/bbb-web/run-prod.sh -COPY bbb-playback-presentation/presentation.yml /usr/local/bigbluebutton/core/scripts/ -COPY bbb-playback-presentation/record-monitor.sh /usr/local/bin -RUN chmod +x /usr/local/bin/record-monitor.sh && \ -mkdir -p /usr/src/bbb-playback-presentation && \ -cp -r /var/bigbluebutton/playback/* /usr/src/bbb-src-playback -RUN wget -O /usr/local/bin/bbb-record https://raw.githubusercontent.com/bigbluebutton/bigbluebutton/develop/bigbluebutton-config/bin/bbb-record \ -&& chmod +x /usr/local/bin/bbb-record +# add default presentation thumbnail +RUN mkdir -p /usr/share/bigbluebutton/blank \ + && wget -O /usr/share/bigbluebutton/blank/blank-thumb.png https://raw.githubusercontent.com/bigbluebutton/bigbluebutton/v2.2.20/bigbluebutton-config/slides/blank-thumb.png COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf COPY entrypoint.sh /entrypoint.sh diff --git a/mod/core/bbb-playback-presentation/presentation.yml b/mod/core/bbb-playback-presentation/presentation.yml deleted file mode 100644 index 19973ce..0000000 --- a/mod/core/bbb-playback-presentation/presentation.yml +++ /dev/null @@ -1,20 +0,0 @@ -video_output_width: 640 -video_output_height: 480 -# Alternate output size to use when deskshare videos are present -# Set higher so that deskshare output is higher quality, but uses more space. -deskshare_output_width: 1280 -deskshare_output_height: 720 -# offset applied to audio in the output video file -# audio_offset = 1200 means that the audio will be delayed by 1200ms -audio_offset: 0 -include_deskshare: true - -# For PRODUCTION -publish_dir: /var/bigbluebutton/published/presentation -video_formats: -- webm -# - mp4 - -# For DEVELOPMENT -#publish_dir: /home/ubuntu/temp/published/presentation - diff --git a/mod/core/bbb-playback-presentation/record-monitor.sh b/mod/core/bbb-playback-presentation/record-monitor.sh deleted file mode 100755 index 61ede81..0000000 --- a/mod/core/bbb-playback-presentation/record-monitor.sh +++ /dev/null @@ -1,60 +0,0 @@ -#!/bin/bash - -# /var/bigbluebutton/recording/status/processed/*.done -> publish-worker.rb -# /var/bigbluebutton/recording/status/sanity/*.done -> process-worker -# /var/bigbluebutton/recording/status/ended/*.done -> events-worker -# /var/bigbluebutton/recording/status/recorded/*.done -> archive-worker -# /var/bigbluebutton/recording/status/archived/*.done -> sanity-worker - -FILES_TO_CHECK=$1 - -PATH_TO_CHECK="/var/bigbluebutton/recording/status" -CMD_DIR_PATH="/usr/local/bigbluebutton/core/scripts" - -function do_monitoring() { - while ! compgen -G "$PATH_TO_CHECK" > /dev/null; do - echo "$PATH_TO_CHECK returning 0 files, sleeping for 30s..." - sleep 30 - done - if [[ -d "$CMD_DIR_PATH" ]]; then - pushd $CMD_DIR_PATH > /dev/null - ruby $CMD_PATH - popd > /dev/null - fi - sleep 5 - echo "Re-monitoring files.." - do_monitoring -} - -function initialize_variables() { - echo "$FILES_TO_CHECK" - if [[ ! -z $FILES_TO_CHECK ]]; then - if [[ $FILES_TO_CHECK == "processed" ]]; then - PATH_TO_CHECK="$PATH_TO_CHECK/processed/*.done" - CMD_PATH="/usr/local/bigbluebutton/core/scripts/rap-publish-worker.rb" - elif [[ $FILES_TO_CHECK == "sanity" ]]; then - PATH_TO_CHECK="$PATH_TO_CHECK/sanity/*.done" - CMD_PATH="/usr/local/bigbluebutton/core/scripts/rap-process-worker.rb" - elif [[ $FILES_TO_CHECK == "ended" ]]; then - PATH_TO_CHECK="$PATH_TO_CHECK/ended/*.done" - CMD_PATH="/usr/local/bigbluebutton/core/scripts/rap-events-worker.rb" - elif [[ $FILES_TO_CHECK == "recorded" ]]; then - PATH_TO_CHECK="$PATH_TO_CHECK/recorded/*.done" - CMD_PATH="/usr/local/bigbluebutton/core/scripts/rap-archive-worker.rb" - elif [[ $FILES_TO_CHECK == "archived" ]]; then - PATH_TO_CHECK="$PATH_TO_CHECK/archived/*.done" - CMD_PATH="/usr/local/bigbluebutton/core/scripts/rap-sanity-worker.rb" - else - echo "invalid argument, exiting..." - exit - fi - else - echo "invalid argument, exiting..." - exit - fi -} - -# first check variables -initialize_variables -# main execution -do_monitoring diff --git a/mod/core/entrypoint.sh b/mod/core/entrypoint.sh index a17f38b..5eb5206 100755 --- a/mod/core/entrypoint.sh +++ b/mod/core/entrypoint.sh @@ -3,14 +3,21 @@ export LANG=en_US.UTF-8 # generate bbb folders +mkdir -p /var/bigbluebutton/events +mkdir -p /var/bigbluebutton/captions +mkdir -p /var/bigbluebutton/captions/inbox +mkdir -p /var/bigbluebutton/basic_stats mkdir -p /var/bigbluebutton/recording/raw mkdir -p /var/bigbluebutton/recording/process mkdir -p /var/bigbluebutton/recording/publish +mkdir -p /var/bigbluebutton/recording/publish/presentation +mkdir -p /var/bigbluebutton/recording/status mkdir -p /var/bigbluebutton/recording/status/recorded mkdir -p /var/bigbluebutton/recording/status/archived mkdir -p /var/bigbluebutton/recording/status/processed mkdir -p /var/bigbluebutton/recording/status/sanity mkdir -p /var/bigbluebutton/published +mkdir -p /var/bigbluebutton/published/presentation mkdir -p /var/bigbluebutton/deleted mkdir -p /var/bigbluebutton/unpublished mkdir -p /var/bigbluebutton/playback diff --git a/mod/core/supervisord.conf b/mod/core/supervisord.conf index 9bae66b..44d39f7 100644 --- a/mod/core/supervisord.conf +++ b/mod/core/supervisord.conf @@ -41,59 +41,4 @@ directory=/usr/share/bbb-transcode-akka stdout_logfile=/dev/fd/1 stdout_logfile_maxbytes=0 stderr_logfile=/dev/fd/2 -stderr_logfile_maxbytes=0 - -[program:rap-archive-worker] -command=/usr/local/bin/prefix-log /usr/local/bin/record-monitor.sh recorded -user=bigbluebutton -directory=/usr/local/bigbluebutton/core/scripts -autostart=true -autorestart=true -stdout_logfile=/dev/fd/1 -stdout_logfile_maxbytes=0 -stderr_logfile=/dev/fd/2 -stderr_logfile_maxbytes=0 - -[program:rap-events-worker] -command=/usr/local/bin/prefix-log /usr/local/bin/record-monitor.sh ended -user=bigbluebutton -directory=/usr/local/bigbluebutton/core/scripts -autostart=true -autorestart=true -stdout_logfile=/dev/fd/1 -stdout_logfile_maxbytes=0 -stderr_logfile=/dev/fd/2 -stderr_logfile_maxbytes=0 - -[program:rap-process-worker] -command=/usr/local/bin/prefix-log /usr/local/bin/record-monitor.sh sanity -user=bigbluebutton -directory=/usr/local/bigbluebutton/core/scripts -autostart=true -autorestart=true -stdout_logfile=/dev/fd/1 -stdout_logfile_maxbytes=0 -stderr_logfile=/dev/fd/2 -stderr_logfile_maxbytes=0 - -[program:rap-publish-worker] -command=/usr/local/bin/prefix-log /usr/local/bin/record-monitor.sh processed -user=bigbluebutton -directory=/usr/local/bigbluebutton/core/scripts -autostart=true -autorestart=true -stdout_logfile=/dev/fd/1 -stdout_logfile_maxbytes=0 -stderr_logfile=/dev/fd/2 -stderr_logfile_maxbytes=0 - -[program:rap-sanity-worker] -command=/usr/local/bin/prefix-log /usr/local/bin/record-monitor.sh archived -user=bigbluebutton -directory=/usr/local/bigbluebutton/core/scripts -autostart=true -autorestart=true -stdout_logfile=/dev/fd/1 -stdout_logfile_maxbytes=0 -stderr_logfile=/dev/fd/2 -stderr_logfile_maxbytes=0 +stderr_logfile_maxbytes=0 \ No newline at end of file diff --git a/mod/core/web/bigbluebutton.properties b/mod/core/web/bigbluebutton.properties index b1f4064..3f499c9 100644 --- a/mod/core/web/bigbluebutton.properties +++ b/mod/core/web/bigbluebutton.properties @@ -192,7 +192,11 @@ userActivitySignResponseDelayInMinutes=5 # Disable recording by default. # true - don't record even if record param in the api call is set to record # false - when record param is passed from api, override this default +{{ if isTrue .Env.ENABLE_RECORDING }} disableRecordingDefault=false +{{ else }} +disableRecordingDefault=true +{{ end }} # Start recording when first user joins the meeting. # For backward compatibility with 0.81 where whole meeting diff --git a/mod/freeswitch/Dockerfile b/mod/freeswitch/Dockerfile index a15c4fc..5b0ce8a 100644 --- a/mod/freeswitch/Dockerfile +++ b/mod/freeswitch/Dockerfile @@ -75,6 +75,16 @@ RUN cd /etc \ && svn checkout https://github.com/alangecker/bbb-packages/tags/$GIT_TAG/bbb-freeswitch-core/data/opt/freeswitch/etc/freeswitch \ && rm -rf /etc/freeswitch/.svn +# the current available freeswitch-mod-opusfile is broken, +# it can't write any .opus files. +# there is already a fix, but it is not included yet. +# https://github.com/signalwire/freeswitch/pull/719/files +# we rather switch to the binary built by bigbluebutton and add its dependencies +RUN wget -O /usr/lib/freeswitch/mod/mod_opusfile.so https://github.com/bbb-pkg/bbb-freeswitch-core/raw/43f3a47af1fcf5ea559e16bb28b900c925a7f2c3/opt/freeswitch/lib/freeswitch/mod/mod_opusfile.so \ + && wget -O /tmp/libopusenc0_0.2.1-1bbb1_amd64.deb https://launchpad.net/~bigbluebutton/+archive/ubuntu/support/+files/libopusenc0_0.2.1-1bbb1_amd64.deb \ + && dpkg -i /tmp/libopusenc0_0.2.1-1bbb1_amd64.deb \ + && rm /tmp/libopusenc0_0.2.1-1bbb1_amd64.deb + # add modifications COPY ./conf /etc/freeswitch/ diff --git a/mod/freeswitch/entrypoint.sh b/mod/freeswitch/entrypoint.sh index d252b27..072bcba 100755 --- a/mod/freeswitch/entrypoint.sh +++ b/mod/freeswitch/entrypoint.sh @@ -15,6 +15,9 @@ for IP in "${ADDR[@]}"; do iptables -I INPUT -p udp --dport 5060 -s $IP -j ACCEPT done +chown -R freeswitch:daemon /var/freeswitch/meetings +chmod 777 /var/freeswitch/meetings + dockerize \ -template /etc/freeswitch/vars.xml.tmpl:/etc/freeswitch/vars.xml \ -template /etc/freeswitch/autoload_configs/conference.conf.xml.tmpl:/etc/freeswitch/autoload_configs/conference.conf.xml \ diff --git a/mod/nginx/Dockerfile b/mod/nginx/Dockerfile new file mode 100644 index 0000000..97a0877 --- /dev/null +++ b/mod/nginx/Dockerfile @@ -0,0 +1,14 @@ +FROM nginx:1.19-alpine + +RUN apk add subversion + +ENV TAG v2.2.20 + +# get bbb-playback-presentation web files +RUN mkdir /www \ + && cd /www \ + && svn checkout https://github.com/bigbluebutton/bigbluebutton/tags/$TAG/record-and-playback/presentation/playback/presentation/ \ + && rm -rf /www/presentation/.svn /www/presentation/0.* + +COPY ./bbb /etc/nginx/bbb +COPY ./bigbluebutton /etc/nginx/conf.d/default.conf \ No newline at end of file diff --git a/mod/nginx/bbb/presentation.nginx b/mod/nginx/bbb/presentation.nginx index 20ed5b4..6f8abca 100644 --- a/mod/nginx/bbb/presentation.nginx +++ b/mod/nginx/bbb/presentation.nginx @@ -16,18 +16,8 @@ # with BigBlueButton; if not, see . # - location /playback/presentation/playback.html { - return 301 /playback/presentation/0.81/playback.html?$query_string; - # If you have recordings from 0.9.0 beta versions and are sure - # that you will never want to play recordings made with - # BigBlueButton 0.81, comment the line above and uncomment the - # following line: - #return 301 /playback/presentation/0.9.0/playback.html?$query_string; - } - location /playback/presentation { - root /var/bigbluebutton; - index index.html index.htm; + alias /www/presentation; } location /presentation { diff --git a/mod/recordings/Dockerfile b/mod/recordings/Dockerfile new file mode 100644 index 0000000..7a903e4 --- /dev/null +++ b/mod/recordings/Dockerfile @@ -0,0 +1,84 @@ + +FROM ruby:2.4-slim-buster + +# install apt dependencies +RUN apt-get update && apt-get install -y \ + wget \ + subversion \ + rsync \ + build-essential \ + libsystemd-dev \ + python3 \ + python3-pyinotify \ + python3-lxml \ + python3-icu \ + ffmpeg \ + poppler-utils \ + imagemagick + +# compile and install mkclean +RUN cd /tmp \ + && wget https://netcologne.dl.sourceforge.net/project/matroska/mkclean/mkclean-0.8.10.tar.bz2 \ + && tar -xf /tmp/mkclean-0.8.10.tar.bz2 \ + && cd /tmp/mkclean-0.8.10 \ + && sed -i 's/\r//g' ./mkclean/configure.compiled \ + && ./mkclean/configure.compiled \ + && make -C mkclean \ + && cp ./release/gcc_linux_x64/mkclean /usr/bin/mkclean \ + && rm -r /tmp/mkclean-0.8.10 + +# add dockerize +ENV DOCKERIZE_VERSION v0.6.1 +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 mkdir -p \ + /usr/local/bigbluebutton \ + /usr/local/bigbluebutton/core \ + /etc/bigbluebutton \ + /var/log/bigbluebutton \ + /var/log/bigbluebutton/presentation + +ENV TAG v2.2.22 + +# add bbb-record-core (lib, scripts and Gemfile) +RUN cd /usr/local/bigbluebutton/core \ + && svn checkout https://github.com/bigbluebutton/bigbluebutton/tags/$TAG/record-and-playback/core/lib \ + && svn checkout https://github.com/bigbluebutton/bigbluebutton/tags/$TAG/record-and-playback/core/scripts \ + && rm -rf /usr/local/bigbluebutton/core/*/.svn \ + && wget https://raw.githubusercontent.com/bigbluebutton/bigbluebutton/$TAG/record-and-playback/core/Gemfile.lock \ + && wget https://raw.githubusercontent.com/bigbluebutton/bigbluebutton/$TAG/record-and-playback/core/Gemfile + + +# add bbb-playback-presentation scripts +RUN cd /tmp \ + && svn checkout https://github.com/bigbluebutton/bigbluebutton/tags/$TAG/record-and-playback/presentation/scripts \ + && rsync -av /tmp/scripts/ /usr/local/bigbluebutton/core/scripts/ \ + && rm -rf /tmp/scripts + +# install ruby dependencies +RUN cd /usr/local/bigbluebutton/core \ + && gem install builder \ + && gem install bundler \ + && /usr/local/bin/bundle + +# add bbb-record with some adjustments so bbb-record works in this environment +RUN cd /usr/bin \ + && wget https://raw.githubusercontent.com/bigbluebutton/bigbluebutton/$TAG/bigbluebutton-config/bin/bbb-record \ + && chmod +x /usr/bin/bbb-record \ + && sed -i 's/^BBB_WEB.*/BBB_WEB=""/' /usr/bin/bbb-record \ + && sed -i 's/systemctl.*//' /usr/bin/bbb-record \ + && echo "BIGBLUEBUTTON_RELEASE=$TAG" > /etc/bigbluebutton/bigbluebutton-release \ + && touch /var/log/bigbluebutton/bbb-web.log + +# create user +# the ID should matcht the one creating the files in `core` +RUN groupadd -g 998 bigbluebutton && useradd -m -u 998 -g bigbluebutton bigbluebutton + +COPY bigbluebutton.yml /usr/local/bigbluebutton/core/scripts/bigbluebutton.yml.tmpl +COPY log-collector.py /log-collector.py +COPY entrypoint.sh /entrypoint.sh +ENTRYPOINT dockerize \ + -template /usr/local/bigbluebutton/core/scripts/bigbluebutton.yml.tmpl:/usr/local/bigbluebutton/core/scripts/bigbluebutton.yml \ + /entrypoint.sh \ No newline at end of file diff --git a/mod/core/bigbluebutton.yml b/mod/recordings/bigbluebutton.yml similarity index 95% rename from mod/core/bigbluebutton.yml rename to mod/recordings/bigbluebutton.yml index b899051..9a57183 100644 --- a/mod/core/bigbluebutton.yml +++ b/mod/recordings/bigbluebutton.yml @@ -1,4 +1,4 @@ -bbb_version: '2.1.0' +bbb_version: '2.2.22' raw_audio_src: /var/freeswitch/meetings raw_video_src: /usr/share/red5/webapps/video/streams kurento_video_src: /var/kurento/recordings @@ -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://localhost:9001/p +notes_endpoint: http://etherpad:9001/p # Specify the notes formats we archive # txt, doc and odt are also supported notes_formats: diff --git a/mod/recordings/entrypoint.sh b/mod/recordings/entrypoint.sh new file mode 100644 index 0000000..5f916d5 --- /dev/null +++ b/mod/recordings/entrypoint.sh @@ -0,0 +1,18 @@ +#!/bin/bash + +# print all logs to stdout +python3 -u /log-collector.py & + +cd /usr/local/bigbluebutton/core/scripts + +while true; do + echo "execute workers..." + bundle exec ruby rap-archive-worker.rb + bundle exec ruby rap-sanity-worker.rb + bundle exec ruby rap-process-worker.rb + bundle exec ruby rap-publish-worker.rb + + bundle exec ruby rap-caption-inbox.rb + bundle exec ruby rap-events-worker.rb + + sleep 30s \ No newline at end of file diff --git a/mod/recordings/log-collector.py b/mod/recordings/log-collector.py new file mode 100644 index 0000000..af683e6 --- /dev/null +++ b/mod/recordings/log-collector.py @@ -0,0 +1,45 @@ +# this script sends all entries from different logfiles +# to stdout, so that they appear in the docker logs + +import threading +import subprocess +import time +import pyinotify +import os +import re +import sys + +log_dir = '/var/log/bigbluebutton' + +def thread_function(name, filename): + f = subprocess.Popen(['tail','-F', '-n', '0', filename],\ + stdout=subprocess.PIPE,stderr=subprocess.PIPE) + while True: + line = f.stdout.readline().decode('utf-8').strip() + if len(line): + print(name.ljust(10)+' |', line) + sys.stdout.flush() + +def tail_file(name, filename): + x = threading.Thread(target=thread_function, args=(name, filename,)) + x.start() + + +tail_file('rap-worker', log_dir+'/bbb-rap-worker.log') +tail_file('sanity', log_dir+'/sanity.log') +tail_file('publish', log_dir+'/post_publish.log') + +class EventHandler(pyinotify.ProcessEvent): + def process_IN_CREATE(self, event): + filename = os.path.basename(event.pathname) + if re.match('^archive-.*\.log$', filename): + tail_file('archive', event.pathname) + elif re.match('^process-.*\.log$', filename): + tail_file('process', event.pathname) + + +wm = pyinotify.WatchManager() +handler = EventHandler() +notifier = pyinotify.Notifier(wm, handler) +wdd = wm.add_watch(log_dir, pyinotify.IN_CREATE, rec=True) +notifier.loop() \ No newline at end of file diff --git a/sample.env b/sample.env index 8782e2a..89da73b 100644 --- a/sample.env +++ b/sample.env @@ -24,6 +24,14 @@ ENABLE_GREENLIGHT=true # https://yourdomain/bbb-exporter #ENABLE_PROMETHEUS_EXPORTER=true +# Recording +# IMPORTANT: this is currently a big privacy issues, because it will +# record everything which happens in the conference, even when the button +# suggets, that it does not. +# https://github.com/bigbluebutton/bigbluebutton/issues/9202 +# make sure that you get peoples consent, before they join a room +#ENABLE_RECORDING=true + # ==================================== # SECRETS # ==================================== diff --git a/scripts/bbb-record b/scripts/bbb-record new file mode 100755 index 0000000..c69c6f5 --- /dev/null +++ b/scripts/bbb-record @@ -0,0 +1,20 @@ +#!/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 + +if [ ! "$ENABLE_RECORDING" == true ]; then + echo "Error: recording is disabled why can't use bbb-record" + echo "set ENABLE_RECORDING in .env if you want to use it" + exit 1 +fi + +./scripts/compose exec recordings-process bbb-record $@ +./scripts/compose logs --tail=15 recordings-process \ No newline at end of file diff --git a/scripts/compose b/scripts/compose index 7d9d785..8f81127 100755 --- a/scripts/compose +++ b/scripts/compose @@ -57,4 +57,8 @@ if [ "$ENABLE_PROMETHEUS_EXPORTER" == true ]; then COMPOSE_FILES="$COMPOSE_FILES -f docker-compose.prometheus.yml" fi +if [ "$ENABLE_RECORDING" == true ]; then + COMPOSE_FILES="$COMPOSE_FILES -f docker-compose.recording.yml" +fi + docker-compose $COMPOSE_FILES $@ From 25a345dd80342abb346e9b66b0d326551e7ac9d4 Mon Sep 17 00:00:00 2001 From: Sofyan Sugianto Date: Sat, 15 Aug 2020 08:42:43 +0700 Subject: [PATCH 16/27] add recording feature into setup scripts --- docker-compose.recordings.yml | 4 ++-- scripts/bbb-record | 4 ++-- scripts/setup | 10 ++++++++++ 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/docker-compose.recordings.yml b/docker-compose.recordings.yml index 1d2b155..787e39a 100644 --- a/docker-compose.recordings.yml +++ b/docker-compose.recordings.yml @@ -1,7 +1,7 @@ version: '3.6' services: - recordings-process: - build: mod/recordings-process + recordings: + build: mod/recordings environment: DOMAIN: ${DOMAIN} volumes: diff --git a/scripts/bbb-record b/scripts/bbb-record index c69c6f5..15fb849 100755 --- a/scripts/bbb-record +++ b/scripts/bbb-record @@ -16,5 +16,5 @@ if [ ! "$ENABLE_RECORDING" == true ]; then exit 1 fi -./scripts/compose exec recordings-process bbb-record $@ -./scripts/compose logs --tail=15 recordings-process \ No newline at end of file +./scripts/compose exec recordings bbb-record $@ +./scripts/compose logs --tail=15 recordings \ No newline at end of file diff --git a/scripts/setup b/scripts/setup index d04e93c..20c610a 100755 --- a/scripts/setup +++ b/scripts/setup @@ -45,6 +45,11 @@ while [[ -z "$DOMAIN" ]]; do read -p "Please enter the domain name: " DOMAIN done +recording="" +while [[ ! $recording =~ ^(y|n)$ ]]; do + read -p "Should recording feature be included? (y/n): " recording +done + ip_correct="" while [[ ! $ip_correct =~ ^(y|n)$ ]]; do read -p "Is $EXTERNAL_IPv4 your external IPv4 address? (y/n): " ip_correct @@ -92,6 +97,11 @@ then sed -i "s/ENABLE_HTTPS_PROXY.*/#ENABLE_HTTPS_PROXY=true/" .env fi +if [ ! "$recording" == "y" ] +then + sed -i "s/ENABLE_RECORDING.*/#ENABLE_RECORDING=true/" .env +fi + if [ "$coturn" == "y" ] then sed -i "s/.*TURN_SERVER=.*/TURN_SERVER=turns:$DOMAIN:465?transport=tcp/" .env From e056e52d198d7836adf7a31ebd6de65b2aa08de9 Mon Sep 17 00:00:00 2001 From: Sofyan Sugianto Date: Thu, 27 Aug 2020 15:44:45 +0700 Subject: [PATCH 17/27] use env file in greenlight database --- docker-compose.greenlight.yml | 14 ++++++++------ sample.env | 21 +++++++++++++++++++++ 2 files changed, 29 insertions(+), 6 deletions(-) diff --git a/docker-compose.greenlight.yml b/docker-compose.greenlight.yml index 0ca79fa..6b72930 100644 --- a/docker-compose.greenlight.yml +++ b/docker-compose.greenlight.yml @@ -9,20 +9,22 @@ services: environment: DB_ADAPTER: postgresql DB_HOST: postgres - DB_NAME: greenlight - DB_USERNAME: postgres - DB_PASSWORD: password + DB_NAME: ${POSTGRES_DB} + DB_USERNAME: ${POSTGRES_USER} + DB_PASSWORD: ${POSTGRES_PASSWORD} BIGBLUEBUTTON_ENDPOINT: ${GREENLIGHT_ENDPOINT} BIGBLUEBUTTON_SECRET: ${SHARED_SECRET} SECRET_KEY_BASE: ${RAILS_SECRET} + depends_on: + - redis ports: - 10.7.7.1:5000:80 postgres: image: postgres:12 restart: unless-stopped environment: - POSTGRES_DB: greenlight - POSTGRES_USER: postgres - POSTGRES_PASSWORD: password + POSTGRES_DB: ${POSTGRES_DB} + POSTGRES_USER: ${POSTGRES_USER} + POSTGRES_PASSWORD: ${POSTGRES_PASSWORD} volumes: - ./postgres-data:/var/lib/postgresql/data \ No newline at end of file diff --git a/sample.env b/sample.env index 89da73b..a1cfc43 100644 --- a/sample.env +++ b/sample.env @@ -168,6 +168,21 @@ LDAP_FILTER= # ALLOW_GREENLIGHT_ACCOUNTS=true +# To enable reCaptcha on the user sign up, define these 2 keys +# You can obtain these keys by registering your domain using the following url: +# +# https://www.google.com/recaptcha/admin +# +# RECAPTCHA_SITE_KEY= +# RECAPTCHA_SECRET_KEY= + +# To enable Google Analytics on your site, set this key to the Google Analytics Property Tracking ID +# +# https://analytics.google.com/analytics/web/ +# +# GOOGLE_ANALYTICS_TRACKING_ID= + + # Set this to true if you want GreenLight to send verification emails upon # the creation of a new account # @@ -295,3 +310,9 @@ HELP_URL=https://docs.bigbluebutton.org/greenlight/gl-overview.html # invite - For invite only registration # approval - For approve/decline registration DEFAULT_REGISTRATION=open + +# Specify database for Greenlight. +# please change POSTGRES_PASSWORD with your secure password +POSTGRES_DB=greenlight +POSTGRES_USER=postgres +POSTGRES_PASSWORD=verysecurepassword \ No newline at end of file From 4ada6986723983fc3658b4938cdb86b4c24a1067 Mon Sep 17 00:00:00 2001 From: Sofyan Sugianto Date: Thu, 27 Aug 2020 15:45:19 +0700 Subject: [PATCH 18/27] remove unused dockerize file --- mod/core/entrypoint.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/mod/core/entrypoint.sh b/mod/core/entrypoint.sh index 5eb5206..ac2585d 100755 --- a/mod/core/entrypoint.sh +++ b/mod/core/entrypoint.sh @@ -29,7 +29,6 @@ cp -r /usr/src/bbb-src-playback/* /var/bigbluebutton/playback chown -R bigbluebutton:bigbluebutton /var/bigbluebutton dockerize \ - -template /usr/local/bigbluebutton/core/scripts/bigbluebutton.yml.tmpl:/usr/local/bigbluebutton/core/scripts/bigbluebutton.yml \ -template /usr/share/bbb-web/WEB-INF/classes/bigbluebutton.properties.tmpl:/usr/share/bbb-web/WEB-INF/classes/bigbluebutton.properties \ -template /usr/share/bbb-apps-akka/conf/application.conf.tmpl:/usr/share/bbb-apps-akka/conf/application.conf \ -template /usr/share/bbb-web/WEB-INF/classes/spring/turn-stun-servers.xml.tmpl:/usr/share/bbb-web/WEB-INF/classes/spring/turn-stun-servers.xml \ From a575e2ceab9f94dd56a1d3b311f4c6c8a64cc0d6 Mon Sep 17 00:00:00 2001 From: Sofyan Sugianto Date: Thu, 27 Aug 2020 15:46:16 +0700 Subject: [PATCH 19/27] update volumes --- docker-compose.recordings.yml | 4 +++- docker-compose.webhooks.yml | 4 ++-- docker-compose.yml | 12 +++++++----- mod/nginx/bbb/bbb-exporter.nginx | 2 +- 4 files changed, 13 insertions(+), 9 deletions(-) diff --git a/docker-compose.recordings.yml b/docker-compose.recordings.yml index 787e39a..b6b188c 100644 --- a/docker-compose.recordings.yml +++ b/docker-compose.recordings.yml @@ -2,10 +2,12 @@ version: '3.6' services: recordings: build: mod/recordings + depends_on: + - redis environment: DOMAIN: ${DOMAIN} volumes: - - /var/bigbluebutton:/var/bigbluebutton + - bigbluebutton:/var/bigbluebutton - vol-freeswitch:/var/freeswitch/meetings - vol-kurento:/var/kurento networks: diff --git a/docker-compose.webhooks.yml b/docker-compose.webhooks.yml index b7ed70b..556afb2 100644 --- a/docker-compose.webhooks.yml +++ b/docker-compose.webhooks.yml @@ -6,8 +6,8 @@ services: environment: DOMAIN: ${DOMAIN} SHARED_SECRET: ${SHARED_SECRET} - extra_hosts: - - "redis:10.7.7.5" + depends_on: + - redis networks: bbb-net: ipv4_address: 10.7.7.15 \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index 0358fa1..d33d9ef 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -17,7 +17,7 @@ services: TURN_SERVER: ${TURN_SERVER:-} TURN_SECRET: ${TURN_SECRET:-} volumes: - - /var/bigbluebutton:/var/bigbluebutton + - bigbluebutton:/var/bigbluebutton - vol-freeswitch:/var/freeswitch/meetings - vol-kurento:/var/kurento networks: @@ -57,7 +57,7 @@ services: ports: - "8080:80" volumes: - - /var/bigbluebutton:/var/bigbluebutton + - bigbluebutton:/var/bigbluebutton - ${DEFAULT_PRESENTATION:-/dev/null}:/etc/nginx/html/default.pdf network_mode: host extra_hosts: @@ -81,8 +81,8 @@ services: redis: image: redis:6.0-alpine restart: unless-stopped - ports: - - "127.0.0.1:6379:6379" # TODO: remove as soon as we updated all redis host references + volumes: + - ./redis-data:/data networks: bbb-net: ipv4_address: 10.7.7.5 @@ -90,6 +90,8 @@ services: mongodb: image: mongo:4.2 restart: unless-stopped + volumes: + - ./mongo-data:/data/db networks: bbb-net: ipv4_address: 10.7.7.6 @@ -164,7 +166,7 @@ services: - mongodb volumes: - /var/run/docker.sock:/var/run/docker.sock - - /var/bigbluebutton:/var/bigbluebutton + - bigbluebutton:/var/bigbluebutton networks: bbb-net: ipv4_address: 10.7.7.12 diff --git a/mod/nginx/bbb/bbb-exporter.nginx b/mod/nginx/bbb/bbb-exporter.nginx index 2a2be48..9e49b08 100644 --- a/mod/nginx/bbb/bbb-exporter.nginx +++ b/mod/nginx/bbb/bbb-exporter.nginx @@ -1,4 +1,4 @@ -location /bbb-exporter { +location /metrics { proxy_pass http://10.7.7.33:9688; proxy_http_version 1.1; } \ No newline at end of file From 66d0541071ccc5f8a294811bb34f40b77414eee5 Mon Sep 17 00:00:00 2001 From: Sofyan Sugianto Date: Thu, 27 Aug 2020 15:47:33 +0700 Subject: [PATCH 20/27] update recording containner scripts --- mod/recordings/Dockerfile | 4 ++-- mod/recordings/entrypoint.sh | 19 ++++++++++++++----- scripts/bbb-record | 2 +- scripts/compose | 2 +- 4 files changed, 18 insertions(+), 9 deletions(-) diff --git a/mod/recordings/Dockerfile b/mod/recordings/Dockerfile index 7a903e4..630189d 100644 --- a/mod/recordings/Dockerfile +++ b/mod/recordings/Dockerfile @@ -77,8 +77,8 @@ RUN cd /usr/bin \ RUN groupadd -g 998 bigbluebutton && useradd -m -u 998 -g bigbluebutton bigbluebutton COPY bigbluebutton.yml /usr/local/bigbluebutton/core/scripts/bigbluebutton.yml.tmpl -COPY log-collector.py /log-collector.py -COPY entrypoint.sh /entrypoint.sh +ADD log-collector.py /log-collector.py +ADD entrypoint.sh /entrypoint.sh ENTRYPOINT dockerize \ -template /usr/local/bigbluebutton/core/scripts/bigbluebutton.yml.tmpl:/usr/local/bigbluebutton/core/scripts/bigbluebutton.yml \ /entrypoint.sh \ No newline at end of file diff --git a/mod/recordings/entrypoint.sh b/mod/recordings/entrypoint.sh index 5f916d5..0f0c55c 100644 --- a/mod/recordings/entrypoint.sh +++ b/mod/recordings/entrypoint.sh @@ -4,15 +4,24 @@ python3 -u /log-collector.py & cd /usr/local/bigbluebutton/core/scripts - +PATH_CHECK="/var/bigbluebutton/recording/status" while true; do echo "execute workers..." + if [[ compgen -G "$PATH_CHECK/recorded/*.done" ]];then bundle exec ruby rap-archive-worker.rb + fi + if [[ compgen -G "$PATH_CHECK/archived/*.done" ]];then bundle exec ruby rap-sanity-worker.rb + fi + if [[ compgen -G "$PATH_CHECK/sanity/*.done" ]];then bundle exec ruby rap-process-worker.rb + fi + if [[ compgen -G "$PATH_CHECK/processed/*.done" ]];then bundle exec ruby rap-publish-worker.rb - - bundle exec ruby rap-caption-inbox.rb + fi + #bundle exec ruby rap-caption-inbox.rb + if [[ compgen -G "$PATH_CHECK/ended/*.done" ]];then bundle exec ruby rap-events-worker.rb - - sleep 30s \ No newline at end of file + fi + sleep 30s +done diff --git a/scripts/bbb-record b/scripts/bbb-record index 15fb849..64ec423 100755 --- a/scripts/bbb-record +++ b/scripts/bbb-record @@ -7,7 +7,7 @@ cd $(dirname $0)/.. if [ -f .env ] then # exclude WELCOME_FOOTER because it may contain invalid characters - export $(cat .env | sed 's/#.*//g' | grep -v "WELCOME_FOOTER" | xargs) + export $(cat .env | sed 's/#.*//g' | grep -v "WELCOME_FOOTER" | grep -v "WELCOME_MESSAGE" | xargs) fi if [ ! "$ENABLE_RECORDING" == true ]; then diff --git a/scripts/compose b/scripts/compose index 8f81127..a560126 100755 --- a/scripts/compose +++ b/scripts/compose @@ -58,7 +58,7 @@ if [ "$ENABLE_PROMETHEUS_EXPORTER" == true ]; then fi if [ "$ENABLE_RECORDING" == true ]; then - COMPOSE_FILES="$COMPOSE_FILES -f docker-compose.recording.yml" + COMPOSE_FILES="$COMPOSE_FILES -f docker-compose.recordings.yml" fi docker-compose $COMPOSE_FILES $@ From 13044fb9975516515eb18ea9edf8294b93a5b7b5 Mon Sep 17 00:00:00 2001 From: Sofyan Sugianto Date: Thu, 27 Aug 2020 15:53:30 +0700 Subject: [PATCH 21/27] add node exporter --- docker-compose.exporter.yml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 docker-compose.exporter.yml diff --git a/docker-compose.exporter.yml b/docker-compose.exporter.yml new file mode 100644 index 0000000..99acedf --- /dev/null +++ b/docker-compose.exporter.yml @@ -0,0 +1,18 @@ +version: '3.2' +services: + node_exporter: + container_name: node_exporter + # Always check if there is a newer stable release: + # https://hub.docker.com/r/prom/node-exporter/tags + image: prom/node-exporter:v0.18.1 + command: + - "--path.rootfs=/host" + - "--web.listen-address=127.0.0.1:9100" + network_mode: "host" + pid: "host" + volumes: + - type: "bind" + source: "/" + target: "/host" + read_only: true + restart: unless-stopped \ No newline at end of file From ef32b623b3ca82a476ff2096f86f0ab41424d430 Mon Sep 17 00:00:00 2001 From: Sofyan Sugianto Date: Thu, 27 Aug 2020 16:09:42 +0700 Subject: [PATCH 22/27] generate random password by default on postgres password --- sample.env | 3 +-- scripts/setup | 2 ++ 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/sample.env b/sample.env index a1cfc43..03dfb84 100644 --- a/sample.env +++ b/sample.env @@ -311,8 +311,7 @@ HELP_URL=https://docs.bigbluebutton.org/greenlight/gl-overview.html # approval - For approve/decline registration DEFAULT_REGISTRATION=open -# Specify database for Greenlight. -# please change POSTGRES_PASSWORD with your secure password +# Specify postgresql database credentials to be used by Greenlight. POSTGRES_DB=greenlight POSTGRES_USER=postgres POSTGRES_PASSWORD=verysecurepassword \ No newline at end of file diff --git a/scripts/setup b/scripts/setup index 20c610a..d719195 100755 --- a/scripts/setup +++ b/scripts/setup @@ -116,9 +116,11 @@ fi 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) +RANDOM_4=$(head /dev/urandom | tr -dc A-Za-z0-9_@ | head -c 24) 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 +sed -i "s/POSTGRES_PASSWORD=.*/POSTGRES_PASSWORD=$RANDOM_3/" .env echo "--------------------------------------------------" echo "configuration file .env got successfully created!" From f7aa70753251feb43b0be105d114b5524482f51f Mon Sep 17 00:00:00 2001 From: Sofyan Sugianto Date: Sat, 29 Aug 2020 21:01:30 +0700 Subject: [PATCH 23/27] fix typo --- mod/recordings/Dockerfile | 5 +++-- scripts/setup | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/mod/recordings/Dockerfile b/mod/recordings/Dockerfile index 630189d..668b6d6 100644 --- a/mod/recordings/Dockerfile +++ b/mod/recordings/Dockerfile @@ -77,8 +77,9 @@ RUN cd /usr/bin \ RUN groupadd -g 998 bigbluebutton && useradd -m -u 998 -g bigbluebutton bigbluebutton COPY bigbluebutton.yml /usr/local/bigbluebutton/core/scripts/bigbluebutton.yml.tmpl -ADD log-collector.py /log-collector.py -ADD entrypoint.sh /entrypoint.sh +COPY log-collector.py /log-collector.py +COPY entrypoint.sh /entrypoint.sh +RUN chmod +x /log-collector.py /entrypoint.sh ENTRYPOINT dockerize \ -template /usr/local/bigbluebutton/core/scripts/bigbluebutton.yml.tmpl:/usr/local/bigbluebutton/core/scripts/bigbluebutton.yml \ /entrypoint.sh \ No newline at end of file diff --git a/scripts/setup b/scripts/setup index d719195..72a53cd 100755 --- a/scripts/setup +++ b/scripts/setup @@ -120,7 +120,7 @@ RANDOM_4=$(head /dev/urandom | tr -dc A-Za-z0-9_@ | head -c 24) 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 -sed -i "s/POSTGRES_PASSWORD=.*/POSTGRES_PASSWORD=$RANDOM_3/" .env +sed -i "s/POSTGRES_PASSWORD=.*/POSTGRES_PASSWORD=$RANDOM_4/" .env echo "--------------------------------------------------" echo "configuration file .env got successfully created!" From cd76d89387d5065a239cd71bbdda7679ea0fe051 Mon Sep 17 00:00:00 2001 From: Sofyan Sugianto Date: Sat, 29 Aug 2020 21:05:39 +0700 Subject: [PATCH 24/27] fix recording entrypoint error --- mod/recordings/entrypoint.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/mod/recordings/entrypoint.sh b/mod/recordings/entrypoint.sh index 0f0c55c..f4b8318 100644 --- a/mod/recordings/entrypoint.sh +++ b/mod/recordings/entrypoint.sh @@ -7,20 +7,20 @@ cd /usr/local/bigbluebutton/core/scripts PATH_CHECK="/var/bigbluebutton/recording/status" while true; do echo "execute workers..." - if [[ compgen -G "$PATH_CHECK/recorded/*.done" ]];then + if [[ $(compgen -G "$PATH_CHECK/recorded/*.done") ]];then bundle exec ruby rap-archive-worker.rb fi - if [[ compgen -G "$PATH_CHECK/archived/*.done" ]];then + if [[ $(compgen -G "$PATH_CHECK/archived/*.done") ]];then bundle exec ruby rap-sanity-worker.rb fi - if [[ compgen -G "$PATH_CHECK/sanity/*.done" ]];then + if [[ $(compgen -G "$PATH_CHECK/sanity/*.done") ]];then bundle exec ruby rap-process-worker.rb fi - if [[ compgen -G "$PATH_CHECK/processed/*.done" ]];then + if [[ $(compgen -G "$PATH_CHECK/processed/*.done") ]];then bundle exec ruby rap-publish-worker.rb fi #bundle exec ruby rap-caption-inbox.rb - if [[ compgen -G "$PATH_CHECK/ended/*.done" ]];then + if [[ $(compgen -G "$PATH_CHECK/ended/*.done") ]];then bundle exec ruby rap-events-worker.rb fi sleep 30s From 20dfb432735fc9423e428d18f4b5c0312d780161 Mon Sep 17 00:00:00 2001 From: Sofyan Sugianto Date: Sat, 29 Aug 2020 21:30:00 +0700 Subject: [PATCH 25/27] fix setup recording --- scripts/setup | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/setup b/scripts/setup index 72a53cd..60d4350 100755 --- a/scripts/setup +++ b/scripts/setup @@ -97,9 +97,9 @@ then sed -i "s/ENABLE_HTTPS_PROXY.*/#ENABLE_HTTPS_PROXY=true/" .env fi -if [ ! "$recording" == "y" ] +if [ "$recording" == "y" ] then - sed -i "s/ENABLE_RECORDING.*/#ENABLE_RECORDING=true/" .env + sed -i "s/#ENABLE_RECORDING.*/ENABLE_RECORDING=true/" .env fi if [ "$coturn" == "y" ] From 889cee230c12187a8593100815032d30316ce18b Mon Sep 17 00:00:00 2001 From: chandi Date: Sun, 6 Sep 2020 13:10:47 +0200 Subject: [PATCH 26/27] remove database mounts (contains only temporary data anyway) --- docker-compose.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index d33d9ef..8511856 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -81,8 +81,6 @@ services: redis: image: redis:6.0-alpine restart: unless-stopped - volumes: - - ./redis-data:/data networks: bbb-net: ipv4_address: 10.7.7.5 @@ -90,8 +88,6 @@ services: mongodb: image: mongo:4.2 restart: unless-stopped - volumes: - - ./mongo-data:/data/db networks: bbb-net: ipv4_address: 10.7.7.6 From d4374f6a00f33f8a84a371483cd29b2f1f93feb9 Mon Sep 17 00:00:00 2001 From: chandi Date: Sun, 6 Sep 2020 13:11:35 +0200 Subject: [PATCH 27/27] update versions and fix for wrong indentation with applied v2.2.23 changes --- mod/html5/settings.yml | 30 +++++++++++++++--------------- mod/recordings/Dockerfile | 2 +- mod/recordings/bigbluebutton.yml | 2 +- 3 files changed, 17 insertions(+), 17 deletions(-) diff --git a/mod/html5/settings.yml b/mod/html5/settings.yml index 6b5261c..789d06b 100644 --- a/mod/html5/settings.yml +++ b/mod/html5/settings.yml @@ -200,21 +200,21 @@ public: profile: low-u25 - threshold: 30 profile: low-u30 - pagination: - # whether to globally enable or disable pagination. - enabled: false - # how long (in ms) the negotiation will be debounced after a page change. - pageChangeDebounceTime: 2500 - # video page sizes for DESKTOP endpoints. It stands for the number of SUBSCRIBER streams. - # PUBLISHERS aren't accounted for . - # A page size of 0 (zero) means that the page size is unlimited (disabled). - desktopPageSizes: - moderator: 0 - viewer: 5 - # video page sizes for MOBILE endpoints - mobilePageSizes: - moderator: 2 - viewer: 2 + pagination: + # whether to globally enable or disable pagination. + enabled: false + # how long (in ms) the negotiation will be debounced after a page change. + pageChangeDebounceTime: 2500 + # video page sizes for DESKTOP endpoints. It stands for the number of SUBSCRIBER streams. + # PUBLISHERS aren't accounted for . + # A page size of 0 (zero) means that the page size is unlimited (disabled). + desktopPageSizes: + moderator: 0 + viewer: 5 + # video page sizes for MOBILE endpoints + mobilePageSizes: + moderator: 2 + viewer: 2 pingPong: clearUsersInSeconds: 180 pongTimeInSeconds: 15 diff --git a/mod/recordings/Dockerfile b/mod/recordings/Dockerfile index 668b6d6..b142af1 100644 --- a/mod/recordings/Dockerfile +++ b/mod/recordings/Dockerfile @@ -40,7 +40,7 @@ RUN mkdir -p \ /var/log/bigbluebutton \ /var/log/bigbluebutton/presentation -ENV TAG v2.2.22 +ENV TAG v2.2.23 # add bbb-record-core (lib, scripts and Gemfile) RUN cd /usr/local/bigbluebutton/core \ diff --git a/mod/recordings/bigbluebutton.yml b/mod/recordings/bigbluebutton.yml index 9a57183..c20328a 100644 --- a/mod/recordings/bigbluebutton.yml +++ b/mod/recordings/bigbluebutton.yml @@ -1,4 +1,4 @@ -bbb_version: '2.2.22' +bbb_version: '2.2.23' raw_audio_src: /var/freeswitch/meetings raw_video_src: /usr/share/red5/webapps/video/streams kurento_video_src: /var/kurento/recordings