Merge pull request #9 from alangecker/develop

Multiple improvements: TURN support, updates, cleanup, kurento restart
This commit is contained in:
chandi 2020-05-24 12:04:07 +02:00 committed by GitHub
commit a4368f27cd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
14 changed files with 213 additions and 59 deletions

View File

@ -108,7 +108,6 @@ docker-compose -f docker-compose.greenlight.yml up -d
## Open Tasks
- add support for recording
- add coturn support
- further separate bbb-core into individual container
- enable IPv6 support
- fix captions (they don't appear, `readOnlyPadId` is missing)

3
conf/.gitignore vendored
View File

@ -1,3 +1,4 @@
*/*
!.gitkeep
!example.xml
!example.xml
*.pdf

View File

@ -10,6 +10,9 @@ services:
DOMAIN: ${DOMAIN}
SHARED_SECRET: ${SHARED_SECRET}
WELCOME_FOOTER: ${WELCOME_FOOTER}
STUN_SERVER: stun:${STUN_IP}:${STUN_PORT}
TURN_SERVER: ${TURN_SERVER}
TURN_SECRET: ${TURN_SECRET}
volumes:
- bigbluebutton:/var/bigbluebutton
networks:
@ -34,7 +37,7 @@ services:
network_mode: host
nginx:
image: nginx:1.17
image: nginx:1.18-alpine
restart: unless-stopped
depends_on:
- etherpad
@ -46,13 +49,14 @@ services:
- bigbluebutton:/var/bigbluebutton
- ./mod/nginx/bbb:/etc/nginx/bbb
- ./mod/nginx/bigbluebutton:/etc/nginx/conf.d/default.conf
- ${DEFAULT_PRESENTATION:-/dev/null}:/etc/nginx/html/default.pdf
networks:
- bbb-net
extra_hosts:
- "host.docker.internal:10.7.7.1"
etherpad:
image: etherpad/etherpad:1.8.0
image: etherpad/etherpad:1.8.4
restart: unless-stopped
depends_on:
- redis
@ -67,7 +71,7 @@ services:
ipv4_address: 10.7.7.4
redis:
image: redis:5.0-alpine
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
@ -135,6 +139,17 @@ services:
networks:
- bbb-net
periodic:
build: mod/periodic
restart: unless-stopped
depends_on:
- mongodb
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- bigbluebutton:/var/bigbluebutton
networks:
- bbb-net
volumes:
bigbluebutton:

View File

@ -59,6 +59,8 @@ COPY red5-webapps/video-broadcast/video-broadcast.properties /usr/share/red5/web
COPY bigbluebutton.yml /usr/local/bigbluebutton/core/scripts/bigbluebutton.yml
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
COPY bbb-apps-akka/application.conf /usr/share/bbb-apps-akka/conf/application.conf.tmpl
COPY bbb-fsesl-akka/application.conf /etc/bbb-fsesl-akka/application.conf
COPY bbb-transcode-akka/application.conf /etc/bbb-transcode-akka/application.conf

View File

@ -19,4 +19,5 @@ chown -R bigbluebutton:bigbluebutton /var/bigbluebutton
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 \
-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 \
/usr/bin/supervisord --nodaemon

View File

@ -0,0 +1,37 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">
<bean id="stun1" class="org.bigbluebutton.web.services.turn.StunServer">
<constructor-arg index="0" value="{{ .Env.STUN_SERVER }}"/>
</bean>
{{if .Env.TURN_SERVER }}
<bean id="turn0" class="org.bigbluebutton.web.services.turn.TurnServer">
<constructor-arg index="0" value="{{ .Env.TURN_SECRET }}"/>
<constructor-arg index="1" value="{{ .Env.TURN_SERVER }}"/>
<constructor-arg index="2" value="86400"/>
</bean>
{{end}}
<bean id="stunTurnService" class="org.bigbluebutton.web.services.turn.StunTurnService">
<property name="stunServers">
<set>
<ref bean="stun1" />
</set>
</property>
<property name="turnServers">
<set>
{{if .Env.TURN_SERVER }}
<ref bean="turn0" />
{{end}}
</set>
</property>
<property name="remoteIceCandidates">
<set>
</set>
</property>
</bean>
</beans>

View File

@ -9,9 +9,9 @@ public:
skipCheck: false
clientTitle: {{ .Env.CLIENT_TITLE }}
appName: BigBlueButton HTML5 Client
bbbServerVersion: 2.2-dev
bbbServerVersion: 2.2
copyright: "©2019 BigBlueButton Inc."
html5ClientBuild: 870
html5ClientBuild: 924
helpLink: https://bigbluebutton.org/html5/
lockOnJoin: true
cdn: ""
@ -68,17 +68,14 @@ public:
openActions:
accesskey: A
descId: openActions
openStatus:
accesskey: S
descId: openStatus
branding:
displayBrandingArea: false
connectionTimeout: 60000
showHelpButton: true
effectiveConnection:
- critical
- danger
- warning
- critical
- danger
- warning
externalVideoPlayer:
enabled: true
networkMonitoring:
@ -90,27 +87,38 @@ public:
chromeDefaultExtensionLink: {{ .Env.SCREENSHARE_EXTENSION_LINK }}
chromeExtensionKey: KEY
chromeExtensionLink: LINK
chromeScreenshareSources:
- window
- screen
firefoxScreenshareSource: window
screenshare:
constraints:
video:
frameRate:
ideal: 5
max: 10
width:
max: 2560
height:
max: 1600
audio: false
chromeScreenshareSources:
- window
- screen
firefoxScreenshareSource: window
cameraProfiles:
- id: low
name: Low quality
default: false
bitrate: 100
- id: medium
name: Medium quality
default: true
bitrate: 200
- id: high
name: High quality
default: false
bitrate: 500
- id: hd
name: High definition
default: false
bitrate: 800
- id: low
name: Low quality
default: false
bitrate: 100
- id: medium
name: Medium quality
default: true
bitrate: 200
- id: high
name: High quality
default: false
bitrate: 500
- id: hd
name: High definition
default: false
bitrate: 800
enableScreensharing: true
enableVideo: true
enableVideoStats: false
@ -170,6 +178,8 @@ public:
hidePresentation: false
media:
stunTurnServersFetchAddress: "/bigbluebutton/api/stuns"
cacheStunTurnServers: true
fallbackStunServer: ''
mediaTag: "#remote-media"
callTransferTimeout: 5000
callHangupTimeout: 2000
@ -215,6 +225,8 @@ public:
mime: application/vnd.oasis.opendocument.image
- extension: .jpg
mime: image/jpeg
- extension: .jpeg
mime: image/jpeg
- extension: .png
mime: image/png
user:
@ -301,10 +313,9 @@ public:
- pencil
- hand
clientLog:
server: {enabled: true, level: info}
console: {enabled: true, level: debug}
external: {enabled: false, level: info, url: 'https://LOG_HOST/html5Log', method: POST,
throttleInterval: 400, flushOnClose: true, logTag: ""}
server: { enabled: true, level: info }
console: { enabled: true, level: debug }
external: { enabled: false, level: info, url: https://LOG_HOST/html5Log, method: POST, throttleInterval: 400, flushOnClose: true, logTag: "" }
private:
app:
host: 0.0.0.0
@ -347,23 +358,23 @@ private:
heapdump:
enabled: false
minBrowserVersions:
- browser: chrome
version: 59
- browser: chromeMobileIOS
version: Infinity
- browser: firefox
version: 52
- browser: firefoxMobile
version: 52
- browser: edge
version: 17
- browser: ie
version: Infinity
- browser: safari
version: [11, 1]
- browser: mobileSafari
version: [11, 1]
- browser: opera
version: 46
- browser: electron
version: [0, 36]
- browser: chrome
version: 59
- browser: chromeMobileIOS
version: Infinity
- browser: firefox
version: 52
- browser: firefoxMobile
version: 52
- browser: edge
version: 17
- browser: ie
version: Infinity
- browser: safari
version: [11, 1]
- browser: mobileSafari
version: [11, 1]
- browser: opera
version: 46
- browser: electron
version: [0, 36]

View File

@ -47,7 +47,7 @@
}
location ~ "^/bigbluebutton/presentation/download\/[0-9a-f]+-[0-9]+/[0-9a-f]+-[0-9]+$" {
if ($arg_presFilename !~ "^[0-9a-zA-Z]+\.[0-9a-zA-Z]+$") {
if ($arg_presFilename !~ "^[0-9a-zA-Z]+-[0-9]+\.[0-9a-zA-Z]+$") {
return 404;
}
proxy_pass http://core:8090$uri$is_args$args;

BIN
mod/nginx/default.pdf Normal file

Binary file not shown.

15
mod/periodic/Dockerfile Normal file
View File

@ -0,0 +1,15 @@
FROM debian:buster-slim
# -- install mongo cli
RUN apt-get update \
&& apt-get install -y wget libcurl4 \
&& wget https://repo.mongodb.org/apt/debian/dists/buster/mongodb-org/4.2/main/binary-amd64/mongodb-org-shell_4.2.6_amd64.deb \
&& dpkg -i mongodb*.deb \
&& rm mongodb*.deb
# -- install docker cli
COPY --from=library/docker:latest /usr/local/bin/docker /usr/bin/docker
COPY bbb-restart-kms bbb-resync-freeswitch entrypoint.sh /
ENTRYPOINT ["/entrypoint.sh"]

40
mod/periodic/bbb-restart-kms Executable file
View File

@ -0,0 +1,40 @@
#!/bin/bash
# Source:
# https://github.com/alangecker/bbb-packages/blob/f83431c227be2c95025ea81083baeaa87667b170/bbb-webrtc-sfu/data/etc/cron.hourly/bbb-restart-kms
#
# Restart Kurento every 24+ hours
#
if [ ! -f /tmp/bbb-kms-last-restart.txt ]; then
date +%Y-%m-%d\ %H:%M:%S > /tmp/bbb-kms-last-restart.txt
exit
fi
users=$(mongo --quiet mongodb://10.7.7.6:27017/meteor --eval "db.users.count({connectionStatus: 'online'})")
echo "currently active users: $users"
if [ "$users" -eq 0 ]; then
# Make sure 24 hours have passed since last restart
# Seconds since epoch for last restart
dt1=$(cat /tmp/bbb-kms-last-restart.txt)
t1=`date --date="$dt1" +%s`
# Current seconds since epoch
dt2=`date +%Y-%m-%d\ %H:%M:%S`
t2=`date --date="$dt2" +%s`
# Hours since last restart
let "tDiff=$t2-$t1"
let "hDiff=$tDiff/3600"
if [ "$hDiff" -ge 24 ]; then
echo "scheduled restart of kurento after 24h"
CONTAINER_ID=$(docker ps | grep kurento | awk '{print $1}')
docker restart $CONTAINER_ID
date +%Y-%m-%d\ %H:%M:%S > /tmp/bbb-kms-last-restart.txt
fi
fi

View File

@ -0,0 +1,6 @@
#!/bin/bash
# https://github.com/bigbluebutton/bigbluebutton/pull/9597/files
CONTAINER_ID=$(docker ps | grep freeswitch | awk '{print $1}')
docker exec -it $CONTAINER_ID fs_cli -H 10.7.7.1 -P 8021 -x 'fsctl sync_clock_when_idle'

20
mod/periodic/entrypoint.sh Executable file
View File

@ -0,0 +1,20 @@
#!/bin/bash
#
# How N days back to keep files
#
history=5
while :
do
# restart kurento after 24h
/bbb-restart-kms
# resync freeswitch
/bbb-resync-freeswitch
# delete presentations older than N days
find /var/bigbluebutton/ -maxdepth 1 -type d -name "*-*" -mtime +$history -exec rm -rf '{}' +
sleep 30m
done

View File

@ -11,6 +11,11 @@ EXTERNAL_IP=144.76.97.10
STUN_IP=216.93.246.18
STUN_PORT=3478
# TURN SERVER
# uncomment and adjust following two lines to add an external TURN server
#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
@ -21,7 +26,9 @@ WELCOME_FOOTER=This server is running <a href="http://docs.bigbluebutton.org/" t
# use following line for an additional SIP dial-in message
#WELCOME_FOOTER=This server is running <a href="http://docs.bigbluebutton.org/" target="_blank"><u>BigBlueButton</u></a>. <br><br>To join this meeting by phone, dial:<br> INSERT_YOUR_PHONE_NUMBER_HERE<br>Then enter %%CONFNUM%% as the conference PIN number.
# for a different default presentation, place the pdf file in ./conf/ and
# adjust the following path
DEFAULT_PRESENTATION=./mod/nginx/default.pdf
# -------------------------------