Change approach to customize interface_config.js

Also tune jitsi-updater and brandless mode
This commit is contained in:
Luis Guzmán 2020-09-09 03:17:07 -05:00
parent 174d41e123
commit a7cd183bb3
3 changed files with 64 additions and 34 deletions

View File

@ -32,6 +32,7 @@ if [ -f $JITSI_MEET_PROXY ];then
PREAD_PROXY=$(grep -nr "preread_server_name" $JITSI_MEET_PROXY | cut -d ":" -f1)
fi
INT_CONF="/usr/share/jitsi-meet/interface_config.js"
INT_CONF_ETC="/etc/jitsi/meet/$DOMAIN-interface_config.js"
jibri_packages="$(grep Package /var/lib/apt/lists/download.jitsi.org_*_Packages |sort -u|awk '{print $2}'|sed 's|jigasi||'|paste -s -d ' ')"
AVATAR="$(grep -r avatar /etc/nginx/sites-*/ 2>/dev/null)"
if [ -f $apt_repo/google-chrome.list ]; then
@ -131,6 +132,11 @@ fi
########################################################################
# User interface 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..."
printf "${Purple}========== Setting Static Avatar ==========${Color_Off}\n"
if [[ -z "$AVATAR" ]]; then
echo "Moving on..."
@ -157,6 +163,7 @@ fi
printf "${Purple}========== Disable Blur my background ==========${Color_Off}\n"
sed -i "s|'videobackgroundblur', ||" $INT_CONF
fi
if [ "$NC_DOMAIN" != "TBD" ]; then
printf "${Purple}========== Enable $NC_DOMAIN for sync client ==========${Color_Off}\n"

View File

@ -7,6 +7,7 @@
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"
BUNDLE_JS="/usr/share/jitsi-meet/libs/app.bundle.min.js"
#
JM_IMG_PATH="/usr/share/jitsi-meet/images"
@ -56,17 +57,20 @@ sed -i "s|.leftwatermark{|.leftwatermark{display:none;|" $CSS_FILE
fi
#Customize room title
sed -i "s|\([[:space:]]\)APP_NAME:.*| APP_NAME: \'$APP_NAME\',|" $INT_CONF
sed -i "s|Jitsi Meet|$APP_NAME|g" $TITLE_FILE
sed -i "s| powered by the Jitsi Videobridge||g" $TITLE_FILE
sed -i "21,32 s|Jitsi Meet|$APP_NAME|g" $INT_CONF
sed -i "/appNotInstalled/ s|{{app}}|$MOVILE_APP_NAME|" /usr/share/jitsi-meet/lang/*
#Custom UI changes
echo "
Please note that brandless mode will also overwrite support links.
"
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..."
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
fi

View File

@ -515,6 +515,7 @@ echo '
'
JibriBrewery=JibriBrewery
INT_CONF="/usr/share/jitsi-meet/interface_config.js"
INT_CONF_ETC="/etc/jitsi/meet/$DOMAIN-interface_config.js"
WAN_IP=$(dig +short myip.opendns.com @resolver1.opendns.com)
ssl_wa() {
@ -818,8 +819,26 @@ else
https://github.com/switnet-ltd/quick-jibri-installer/issues "
fi
# Disable "Blur my background" until new notice
echo "Disable \"Blur my background\" until new notice"
sed -i "s|'videobackgroundblur', ||" $INT_CONF
# Applying best practives for interface config.js
echo "> Setting up custom interface_config.js acording to best practices."
cp "$INT_CONF" "$INT_CONF_ETC"
#Tune webserver for interface_config.js
if [ -f $WS_CONF ]; then
sed -i "/external_api.js/i \\\n" $WS_CONF
sed -i "/external_api.js/i \ \ \ \ location = \/interface_config.js {" $WS_CONF
sed -i "/external_api.js/i \ \ \ \ \ \ \ \ alias \/etc\/jitsi\/meet\/$DOMAIN-interface_config.js;" $WS_CONF
sed -i "/external_api.js/i \ \ \ \ }" $WS_CONF
sed -i "/external_api.js/i \\\n" $WS_CONF
systemctl reload nginx
else
echo "No interface_config.js configuration done to server file, please report to:
-> https://github.com/switnet-ltd/quick-jibri-installer/issues"
fi
#================== Setup prosody conf file =================
#Setup secure rooms