2021-08-13 18:53:18 +08:00
|
|
|
#!/bin/bash -e
|
|
|
|
|
|
|
|
set +x
|
|
|
|
|
2022-06-16 19:54:31 +08:00
|
|
|
removeOldOverride() {
|
|
|
|
service_name=$1
|
|
|
|
# check if override file has been modified. If not it can be safely removed
|
|
|
|
if [ -f "/etc/systemd/system/${service_name}.service.d/override.conf" ] ; then
|
|
|
|
if echo "d32a00b9a2669b3fe757b8de3470e358 /etc/systemd/system/${service_name}.service.d/override.conf" | md5sum -c --quiet 2>/dev/null >/dev/null ; then
|
|
|
|
rm -f "/etc/systemd/system/${service_name}.service.d/override.conf"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
if [ -d "/etc/systemd/system/${service_name}.service.d" ]; then
|
|
|
|
if [ $(ls "/etc/systemd/system/${service_name}.service.d" |wc -l) = 0 ]; then
|
|
|
|
rmdir "/etc/systemd/system/${service_name}.service.d"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2021-08-13 18:53:18 +08:00
|
|
|
BIGBLUEBUTTON_USER=bigbluebutton
|
|
|
|
|
|
|
|
if ! id freeswitch >/dev/null 2>&1; then
|
|
|
|
echo "Error: FreeSWITCH not installed"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
if lsb_release -d | grep -q CentOS; then
|
|
|
|
DISTRO=centos
|
|
|
|
FREESWITCH=freeswitch
|
|
|
|
FREESWITCH_GROUP=daemon
|
|
|
|
else
|
|
|
|
DISTRO=ubuntu
|
|
|
|
FREESWITCH=freeswitch
|
|
|
|
FREESWITCH_GROUP=freeswitch
|
|
|
|
fi
|
|
|
|
|
|
|
|
#
|
2023-08-10 21:30:00 +08:00
|
|
|
# Set the permissions to /var/bigbluebutton so services can write
|
2021-08-13 18:53:18 +08:00
|
|
|
#
|
|
|
|
if [ -d /var/bigbluebutton ]; then
|
|
|
|
echo -n "."
|
|
|
|
chown -R $BIGBLUEBUTTON_USER:$BIGBLUEBUTTON_USER /var/bigbluebutton
|
|
|
|
echo -n "."
|
|
|
|
|
|
|
|
chmod o+rx /var/bigbluebutton
|
|
|
|
|
|
|
|
#
|
|
|
|
# Setup for recordings XXX
|
|
|
|
#
|
|
|
|
mkdir -p /var/bigbluebutton/recording
|
|
|
|
mkdir -p /var/bigbluebutton/recording/raw
|
|
|
|
mkdir -p /var/bigbluebutton/recording/process
|
|
|
|
mkdir -p /var/bigbluebutton/recording/publish
|
|
|
|
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
|
|
|
|
echo -n "."
|
|
|
|
chown -R $BIGBLUEBUTTON_USER:$BIGBLUEBUTTON_USER /var/bigbluebutton/recording
|
|
|
|
|
|
|
|
mkdir -p /var/bigbluebutton/published
|
|
|
|
echo -n "."
|
|
|
|
chown -R $BIGBLUEBUTTON_USER:$BIGBLUEBUTTON_USER /var/bigbluebutton/published
|
|
|
|
|
|
|
|
mkdir -p /var/bigbluebutton/deleted
|
|
|
|
echo -n "."
|
|
|
|
chown -R $BIGBLUEBUTTON_USER:$BIGBLUEBUTTON_USER /var/bigbluebutton/deleted
|
|
|
|
|
|
|
|
mkdir -p /var/bigbluebutton/unpublished
|
|
|
|
echo -n "."
|
|
|
|
chown -R $BIGBLUEBUTTON_USER:$BIGBLUEBUTTON_USER /var/bigbluebutton/unpublished
|
|
|
|
echo
|
|
|
|
else
|
|
|
|
echo "Warning: BigBlueButton not installed"
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ -f /usr/share/bbb-apps-akka/conf/application.conf ]; then
|
|
|
|
if [ "$(cat /usr/share/bbb-apps-akka/conf/application.conf | sed -n '/sharedSecret.*/{s/[^"]*"//;s/".*//;p}')" == "changeme" ]; then
|
|
|
|
SECRET=$(cat $SERVLET_DIR/WEB-INF/classes/bigbluebutton.properties | grep -v '#' | tr -d '\r' | sed -n '/securitySalt/{s/.*=//;p}')
|
|
|
|
sed -i "s/sharedSecret[ ]*=[ ]*\"[^\"]*\"/sharedSecret=\"$SECRET\"/g" \
|
|
|
|
/usr/share/bbb-apps-akka/conf/application.conf
|
|
|
|
|
|
|
|
HOST=$(cat $SERVLET_DIR/WEB-INF/classes/bigbluebutton.properties | grep -v '#' | sed -n '/^bigbluebutton.web.serverURL/{s/.*\///;p}')
|
|
|
|
sed -i "s/bbbWebAPI[ ]*=[ ]*\"[^\"]*\"/bbbWebAPI=\"http:\/\/$HOST\/bigbluebutton\/api\"/g" \
|
|
|
|
/usr/share/bbb-apps-akka/conf/application.conf
|
|
|
|
sed -i "s/bbbWebHost[ ]*=[ ]*\"[^\"]*\"/bbbWebHost=\"$HOST\"/g" \
|
|
|
|
/usr/share/bbb-apps-akka/conf/application.conf
|
|
|
|
sed -i "s/deskshareip[ ]*=[ ]*\"[^\"]*\"/deskshareip=\"$HOST\"/g" \
|
|
|
|
/usr/share/bbb-apps-akka/conf/application.conf
|
|
|
|
sed -i "s/defaultPresentationURL[ ]*=[ ]*\"[^\"]*\"/defaultPresentationURL=\"http:\/\/$HOST\/default.pdf\"/g" \
|
|
|
|
/usr/share/bbb-apps-akka/conf/application.conf
|
|
|
|
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
#
|
|
|
|
# Added to enable bbb-record-core to move files #8901
|
|
|
|
#
|
|
|
|
usermod bigbluebutton -a -G freeswitch
|
|
|
|
chmod 0775 /var/freeswitch/meetings
|
|
|
|
|
2021-10-05 03:14:42 +08:00
|
|
|
# Verify mediasoup raw media directories ownership and perms
|
|
|
|
if [ -d /var/mediasoup ]; then
|
|
|
|
chown bigbluebutton:bigbluebutton /var/mediasoup
|
|
|
|
chmod 0700 /var/mediasoup
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ -d /var/mediasoup/recordings ]; then
|
|
|
|
chmod 0700 /var/mediasoup/recordings
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ -d /var/mediasoup/screenshare ]; then
|
|
|
|
chmod 0700 /var/mediasoup/screenshare
|
|
|
|
fi
|
|
|
|
|
2024-06-21 03:41:47 +08:00
|
|
|
sed -i 's/worker_connections 768/worker_connections 10000/g' /etc/nginx/nginx.conf
|
2023-02-22 02:15:42 +08:00
|
|
|
|
2022-03-27 21:09:52 +08:00
|
|
|
if grep -q "worker_rlimit_nofile" /etc/nginx/nginx.conf; then
|
2021-09-21 20:24:52 +08:00
|
|
|
num=$(grep worker_rlimit_nofile /etc/nginx/nginx.conf | grep -o '[0-9]*')
|
|
|
|
if [[ "$num" -lt 10000 ]]; then
|
|
|
|
sed -i 's/worker_rlimit_nofile [0-9 ]*;/worker_rlimit_nofile 10000;/g' /etc/nginx/nginx.conf
|
|
|
|
fi
|
|
|
|
else
|
2021-08-13 18:53:18 +08:00
|
|
|
sed -i 's/events {/worker_rlimit_nofile 10000;\n\nevents {/g' /etc/nginx/nginx.conf
|
|
|
|
fi
|
|
|
|
|
2023-02-25 00:36:12 +08:00
|
|
|
mkdir -p /etc/bigbluebutton/nginx
|
|
|
|
|
2022-04-05 04:30:49 +08:00
|
|
|
# symlink default bbb nginx config from package if it does not exist
|
|
|
|
if [ ! -e /etc/bigbluebutton/nginx/include_default.nginx ] ; then
|
|
|
|
ln -s /usr/share/bigbluebutton/include_default.nginx /etc/bigbluebutton/nginx/include_default.nginx
|
|
|
|
fi
|
|
|
|
|
2022-05-13 21:50:20 +08:00
|
|
|
# set full BBB version in settings.yml so it can be displayed in the client
|
|
|
|
BBB_RELEASE_FILE=/etc/bigbluebutton/bigbluebutton-release
|
2024-09-26 00:39:04 +08:00
|
|
|
BBB_HTML5_SETTINGS_FILE=/usr/share/bigbluebutton/html5-client/private/config/settings.yml
|
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
|
2022-05-13 21:50:20 +08:00
|
|
|
fi
|
|
|
|
|
2022-02-20 09:45:45 +08:00
|
|
|
# Fix permissions for logging
|
|
|
|
chown bigbluebutton:bigbluebutton /var/log/bbb-fsesl-akka
|
|
|
|
|
2022-06-16 19:54:31 +08:00
|
|
|
# cleanup old overrides
|
|
|
|
|
|
|
|
removeOldOverride bbb-apps-akka
|
|
|
|
removeOldOverride bbb-fsesl-akka
|
|
|
|
removeOldOverride bbb-transcode-akka
|
|
|
|
|
|
|
|
|
2023-02-25 00:36:12 +08:00
|
|
|
# re-create the symlink for apply-lib.sh to ensure the latest version is present
|
2023-02-25 01:50:06 +08:00
|
|
|
if [ -f /etc/bigbluebutton/bbb-conf/apply-lib.sh ]; then
|
2023-02-25 00:36:12 +08:00
|
|
|
rm /etc/bigbluebutton/bbb-conf/apply-lib.sh
|
2023-02-25 01:50:06 +08:00
|
|
|
fi
|
|
|
|
if [ -f /usr/lib/bbb-conf/apply-lib.sh ]; then
|
2023-02-25 01:14:04 +08:00
|
|
|
ln -s /usr/lib/bbb-conf/apply-lib.sh /etc/bigbluebutton/bbb-conf/apply-lib.sh
|
2023-02-25 00:36:12 +08:00
|
|
|
fi
|
|
|
|
|
2021-08-13 18:53:18 +08:00
|
|
|
# Load the overrides
|
|
|
|
systemctl daemon-reload
|