bigbluebutton-Github/build/packages-template/bbb-web/after-install.sh
Tainan Felipe 4d6f4b3ded
Refactor: Make bundle using webpack (#20811)
* Refactor: Make bundle using webpack

* Fix: restore after install codes and a few settings

* Fix: build script folder permission

* Refactor: Remove support to async import on audio bridges

* Upgrade npm using nvm

* Avoid questions on npm ci execution

* Let npm ci install dev dependencies (as we need the build tools here)

* Fix: enconding

* Fix: old lock files

* Remove: bbb-config dependency to bbb-html5 service, bbb-html5 isn't a service anymore

* Fix: TS errors

* Fix: eslint

* Fix: chat styles

* npm install with "lockfileVersion": 3 (newer npm)

* build: allow nodejs 22

* node 22; drop meteor from CI and bbb-conf

* TEMP: use bbb-install without mongo but with node 22 and newer image

* build: relax nodejs condition to not trip 22.6

* build: ensure dir /usr/share/bigbluebutton/nginx exists

* init sites-available/bbb; drop disable-transparent-

* nginx complaining of missing file and ;

* TMP: print status of services

* WIP: tweak nginx location to debug

* Fix: webcam widgets alignments

* akka-apps -- update location of settings.yml

* build: add locales path for nginx

* docs and config changes for removal of meteor

* Fix: build encoding and locales enpoint folder path

* build: set wss url for media

* Add: Enable minimizer and modify to Terser

* Fix: TS errors

---------

Co-authored-by: Tiago Jacobs <tiago.jacobs@gmail.com>
Co-authored-by: Anton Georgiev <anto.georgiev@gmail.com>
Co-authored-by: Anton Georgiev <antobinary@users.noreply.github.com>
2024-08-09 13:58:44 -04:00

87 lines
2.6 KiB
Bash
Executable File

#!/bin/bash -e
escape_quotes() {
cat <<EOF | sed -e "s/'/\\\\'/g"
$1
EOF
}
bbb_new_properties() {
#
# Setup bigbluebutton.properties for bbb-web
#
sed -i "s/bigbluebutton.web.serverURL=http:\/\/.*/bigbluebutton.web.serverURL=http:\/\/$IP/g" \
$SERVLET_DIR/WEB-INF/classes/bigbluebutton.properties
sed -i "s/screenshareRtmpServer=.*/screenshareRtmpServer=$IP/g" \
$SERVLET_DIR/WEB-INF/classes/bigbluebutton.properties
}
bbb_config() {
bbb_new_properties
#
# Now update the API examples
#
SECRET=$(openssl rand -base64 32 | sed 's/=//g' | sed 's/+//g' | sed 's/\///g')
HOST=$(cat $SERVLET_DIR/WEB-INF/classes/bigbluebutton.properties | sed -n '/^bigbluebutton.web.serverURL/{s/.*\///;p}')
sed -i "s/securitySalt=.*/securitySalt=$SECRET/g" \
$SERVLET_DIR/WEB-INF/classes/bigbluebutton.properties
#
# Update the placementsThreshold and imageTagThreshold
sed -i 's/placementsThreshold=8000/placementsThreshold=800/g' $SERVLET_DIR/WEB-INF/classes/bigbluebutton.properties
sed -i 's/imageTagThreshold=8000/imageTagThreshold=800/g' $SERVLET_DIR/WEB-INF/classes/bigbluebutton.properties
#
# Fix links in welcome text
sed -i 's#<a href="event:http://www.bigbluebutton.org/html5">#<a href="https://www.bigbluebutton.org/html5" target="_blank">#g' \
$SERVLET_DIR/WEB-INF/classes/bigbluebutton.properties
sed -i 's#<a href="http://docs.bigbluebutton.org/" target="_blank">#<a href="https://docs.bigbluebutton.org/" target="_blank">#g' \
$SERVLET_DIR/WEB-INF/classes/bigbluebutton.properties
if [ ! -L /usr/share/bigbluebutton/nginx/web.nginx ]; then
ln -s /usr/share/bigbluebutton/nginx/web /usr/share/bigbluebutton/nginx/web.nginx
fi
if [[ ! -L /usr/share/bbb-web/logs && -d /usr/share/bbb-web/logs ]]; then # remove old directory (if exists)
rm -rf /usr/share/bbb-web/logs
fi
if [ ! -L /usr/share/bbb-web/logs ]; then # create symbolic link
ln -s /var/log/bigbluebutton /usr/share/bbb-web/logs
fi
chown bigbluebutton:bigbluebutton /var/log/bigbluebutton
touch /var/log/bigbluebutton/bbb-web.log
chown bigbluebutton:bigbluebutton /var/log/bigbluebutton/bbb-web.log
update-java-alternatives -s java-1.17.0-openjdk-amd64
# Restart bbb-web to deploy new
startService bbb-web.service || echo "bbb-web.service could not be registered or started"
}
case "$1" in
configure|upgrade|1|2)
bbb_config
;;
abort-upgrade|abort-remove|abort-deconfigure)
;;
*)
echo "## postinst called with unknown argument \`$1'" >&2
;;
esac
# dh_installdeb will replace this with shell code automatically
# generated by other debhelper scripts.
exit 0