quick-jibri-installer/jm-bm.sh

95 lines
3.0 KiB
Bash
Raw Normal View History

2020-04-11 10:03:16 +00:00
#!/bin/bash
# Jitsi Meet brandless mode
# for Debian/*buntu binaries.
2023-11-08 06:34:51 +00:00
# SwITNet Ltd © - 2023, https://switnet.net/
2020-04-11 10:03:16 +00:00
# GNU GPLv3 or later.
while getopts m: option
do
case "${option}"
in
m) MODE=${OPTARG};;
\?) echo "Usage: sudo bash ./$0 [-m debug]" && exit;;
esac
done
#DEBUG
if [ "$MODE" = "debug" ]; then
set -x
fi
DOMAIN="$(find /etc/prosody/conf.d/ -name \*.lua|awk -F'.cfg' '!/localhost/{print $1}'|xargs basename)"
2020-04-11 10:03:16 +00:00
CSS_FILE="/usr/share/jitsi-meet/css/all.css"
TITLE_FILE="/usr/share/jitsi-meet/title.html"
INT_CONF="/usr/share/jitsi-meet/interface_config.js"
INT_CONF_ETC="/etc/jitsi/meet/$DOMAIN-interface_config.js"
2020-04-12 16:13:25 +00:00
BUNDLE_JS="/usr/share/jitsi-meet/libs/app.bundle.min.js"
2020-04-11 10:03:16 +00:00
#
JM_IMG_PATH="/usr/share/jitsi-meet/images"
2020-04-11 10:03:16 +00:00
WTM2_PATH="$JM_IMG_PATH/watermark2.png"
FICON_PATH="$JM_IMG_PATH/favicon2.ico"
REC_ICON_PATH="$JM_IMG_PATH/gnome_record.png"
2020-04-11 10:03:16 +00:00
#
APP_NAME="Conferences"
2020-04-12 16:13:25 +00:00
MOVILE_APP_NAME="Jitsi Meet"
2020-04-11 10:03:16 +00:00
PART_USER="Participant"
2020-04-12 16:13:25 +00:00
LOCAL_USER="me"
2020-04-13 17:48:22 +00:00
#
#SEC_ROOM="TBD"
2020-04-11 10:03:16 +00:00
echo '
#--------------------------------------------------
# Applying Brandless mode
#--------------------------------------------------
'
#Watermark
2021-04-12 03:06:27 +00:00
if [ ! -f "$WTM2_PATH" ]; then
cp images/watermark2.png "$WTM2_PATH"
2020-04-11 10:03:16 +00:00
else
2021-04-12 03:06:27 +00:00
echo "watermark2 file exists, skipping copying..."
2020-04-11 10:03:16 +00:00
fi
#Favicon
2021-04-12 03:06:27 +00:00
if [ ! -f "$FICON_PATH" ]; then
cp images/favicon2.ico "$FICON_PATH"
2020-04-11 10:03:16 +00:00
else
2021-04-12 03:06:27 +00:00
echo "favicon2 file exists, skipping copying..."
2020-04-11 10:03:16 +00:00
fi
#Local recording icon
2021-04-12 03:06:27 +00:00
if [ ! -f "$REC_ICON_PATH" ];then
cp images/gnome_record.png "$REC_ICON_PATH"
else
echo "recording icon exists, skipping copying..."
fi
2020-04-11 10:03:16 +00:00
#Custom / Remove icons
2021-04-12 03:06:27 +00:00
sed -i "s|watermark.png|watermark2.png|g" "$CSS_FILE"
sed -i "s|favicon.ico|favicon2.ico|g" "$TITLE_FILE"
sed -i "s|jitsilogo.png|watermark2.png|g" "$TITLE_FILE"
sed -i "s|logo-deep-linking.png|watermark2.png|g" "$BUNDLE_JS"
2022-08-19 12:45:59 +00:00
sed -i "s|icon-cloud.png|gnome_record.png|g" "$BUNDLE_JS"
2020-04-11 10:03:16 +00:00
#Disable logo and url
if ! grep -q ".leftwatermark{display:none" "$CSS_FILE" ; then
sed -i "s|.leftwatermark{|.leftwatermark{display:none;|" "$CSS_FILE"
2020-04-30 19:43:37 +00:00
fi
2020-04-11 10:03:16 +00:00
#Customize room title
2021-04-12 03:06:27 +00:00
sed -i "s|Jitsi Meet|$APP_NAME|g" "$TITLE_FILE"
sed -i "s| powered by the Jitsi Videobridge||g" "$TITLE_FILE"
2023-02-22 09:53:04 +00:00
sed -i "/appNotInstalled/ s|{{app}}|$MOVILE_APP_NAME|g" /usr/share/jitsi-meet/lang/*
2020-04-11 10:03:16 +00:00
#Custom UI changes
if [ -f "$INT_CONF_ETC" ]; then
echo "Static interface_config.js exists, skipping modification..."
else
echo "This setup doesn't have a static interface_config.js, checking changes..."
2021-04-12 03:06:27 +00:00
echo -e "\nPlease note that brandless mode will also overwrite support links.\n"
sed -i "21,32 s|Jitsi Meet|$APP_NAME|g" "$INT_CONF"
sed -i "s|\([[:space:]]\)APP_NAME:.*| APP_NAME: \'$APP_NAME\',|" "$INT_CONF"
sed -i "s|Fellow Jitster|$PART_USER|g" "$INT_CONF"
sed -i "s|'me'|'$LOCAL_USER'|" "$INT_CONF"
sed -i "s|LIVE_STREAMING_HELP_LINK: .*|LIVE_STREAMING_HELP_LINK: '#',|g" "$INT_CONF"
sed -i "s|SUPPORT_URL: .*|SUPPORT_URL: '#',|g" "$INT_CONF"
#Logo 2
sed -i "s|watermark.png|watermark2.png|g" "$INT_CONF"
2021-04-23 11:58:41 +00:00
sed -i "s|watermark.svg|watermark2.png|g" "$INT_CONF"
fi