2021-08-13 18:53:18 +08:00
#!/bin/bash -e
2024-08-10 01:58:44 +08:00
BIGBLUEBUTTON_USER = bigbluebutton
BBB_HTML5_SETTINGS_FILE = /var/bigbluebutton/html5-client/private/config/settings.yml
BBB_RELEASE_FILE = /etc/bigbluebutton/bigbluebutton-release
HOST = $( grep -v '#' /etc/bigbluebutton/bbb-web.properties | sed -n '/^bigbluebutton.web.serverURL/{s/.*\///;p}' )
2021-08-13 18:53:18 +08:00
2024-08-10 01:58:44 +08:00
chown -R $BIGBLUEBUTTON_USER :$BIGBLUEBUTTON_USER /var/bigbluebutton/html5-client/
2021-08-13 18:53:18 +08:00
if [ ! -L /etc/nginx/sites-enabled/bigbluebutton ] ; then
2022-03-15 04:38:54 +08:00
mkdir -p /etc/nginx/sites-enabled
2021-08-13 18:53:18 +08:00
ln -s /etc/nginx/sites-available/bigbluebutton /etc/nginx/sites-enabled/bigbluebutton
fi
2024-08-10 01:58:44 +08:00
WSURL = $( grep -v '#' /etc/bigbluebutton/bbb-web.properties | sed -n '/^bigbluebutton.web.serverURL/{s/.*=//;p}' | sed 's/https/wss/g' | sed s'/http/ws/g' )
2021-08-13 18:53:18 +08:00
2024-08-10 01:58:44 +08:00
yq e -i " .public.kurento.wsUrl = \" $WSURL /bbb-webrtc-sfu\" " $BBB_HTML5_SETTINGS_FILE
2021-08-13 18:53:18 +08:00
2024-08-10 01:58:44 +08:00
yq e -i " .public.pads.url = \" $PROTOCOL :// $HOST /pad\" " $BBB_HTML5_SETTINGS_FILE
2021-08-13 18:53:18 +08:00
2024-08-10 01:58:44 +08:00
sed -i " s/proxy_pass .*/proxy_pass http:\/\/ $IP :5066;/g " /usr/share/bigbluebutton/nginx/sip.nginx
sed -i " s/server_name .*/server_name $IP ;/g " /etc/nginx/sites-available/bigbluebutton
2024-03-23 04:21:42 +08:00
2022-02-18 01:21:02 +08:00
# set full BBB version in settings.yml so it can be displayed in the client
2022-05-16 02:58:25 +08:00
if [ -f $BBB_RELEASE_FILE ] && [ -f $BBB_HTML5_SETTINGS_FILE ] ; then
BBB_FULL_VERSION = $( cat $BBB_RELEASE_FILE | sed -n '/^BIGBLUEBUTTON_RELEASE/{s/.*=//;p}' | tail -n 1)
echo " setting public.app.bbbServerVersion: $BBB_FULL_VERSION in $BBB_HTML5_SETTINGS_FILE "
2023-04-28 04:37:26 +08:00
yq e -i " .public.app.bbbServerVersion = \" $BBB_FULL_VERSION \" " $BBB_HTML5_SETTINGS_FILE
2024-08-10 01:58:44 +08:00
fi
2022-02-18 01:21:02 +08:00
2021-08-13 18:53:18 +08:00
# Remove old overrides
if [ -f /etc/systemd/system/mongod.service.d/override-mongo.conf ] \
|| [ -f /etc/systemd/system/mongod.service.d/override.conf ] \
|| [ -f /usr/lib/systemd/system/mongod.service.d/mongod-service-override.conf ] ; then
rm -f /etc/systemd/system/mongod.service.d/override-mongo.conf
rm -f /etc/systemd/system/mongod.service.d/override.conf
rm -f /usr/lib/systemd/system/mongod.service.d/mongod-service-override.conf
systemctl daemon-reload
fi
2022-09-01 19:56:35 +08:00
chown root:root /usr/lib/systemd/system
2021-08-13 18:53:18 +08:00
2024-08-10 01:58:44 +08:00
chmod go+r $BBB_HTML5_SETTINGS_FILE
#
# Restart nginx to take advantage of the updates to nginx configuration
#
reloadService nginx