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) PREAD_PROXY=$(grep -nr "preread_server_name" $JITSI_MEET_PROXY | cut -d ":" -f1)
fi fi
INT_CONF="/usr/share/jitsi-meet/interface_config.js" 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 ' ')" 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)" AVATAR="$(grep -r avatar /etc/nginx/sites-*/ 2>/dev/null)"
if [ -f $apt_repo/google-chrome.list ]; then if [ -f $apt_repo/google-chrome.list ]; then
@ -131,33 +132,39 @@ fi
######################################################################## ########################################################################
# User interface changes # # User interface changes #
######################################################################## ########################################################################
printf "${Purple}========== Setting Static Avatar ==========${Color_Off}\n"
if [[ -z "$AVATAR" ]]; then if [ -f "$INT_CONF_ETC" ]; then
echo "Moving on..." echo "Static interface_config.js exists, skipping modification..."
else else
echo "Setting Static Avatar" echo "This setup doesn't have a static interface_config.js, checking changes..."
sed -i "/RANDOM_AVATAR_URL_PREFIX/ s|false|\'http://$DOMAIN/avatar/\'|" $INT_CONF printf "${Purple}========== Setting Static Avatar ==========${Color_Off}\n"
sed -i "/RANDOM_AVATAR_URL_SUFFIX/ s|false|\'.png\'|" $INT_CONF if [[ -z "$AVATAR" ]]; then
echo "Moving on..."
else
echo "Setting Static Avatar"
sed -i "/RANDOM_AVATAR_URL_PREFIX/ s|false|\'http://$DOMAIN/avatar/\'|" $INT_CONF
sed -i "/RANDOM_AVATAR_URL_SUFFIX/ s|false|\'.png\'|" $INT_CONF
fi
printf "${Purple}========== Setting Support Link ==========${Color_Off}\n"
if [[ -z $support ]]; then
echo "Moving on..."
else
echo "Setting Support custom link"
sed -i "s|https://jitsi.org/live|$support|g" $INT_CONF
fi
printf "${Purple}========== Disable Localrecording ==========${Color_Off}\n"
if [ "$LOC_REC" != "on" ]; then
echo "Removing localrecording..."
sed -i "s|'localrecording',||" $INT_CONF
fi
printf "${Purple}========== Disable Blur my background ==========${Color_Off}\n"
sed -i "s|'videobackgroundblur', ||" $INT_CONF
fi fi
printf "${Purple}========== Setting Support Link ==========${Color_Off}\n"
if [[ -z $support ]]; then
echo "Moving on..."
else
echo "Setting Support custom link"
sed -i "s|https://jitsi.org/live|$support|g" $INT_CONF
fi
printf "${Purple}========== Disable Localrecording ==========${Color_Off}\n"
if [ "$LOC_REC" != "on" ]; then
echo "Removing localrecording..."
sed -i "s|'localrecording',||" $INT_CONF
fi
printf "${Purple}========== Disable Blur my background ==========${Color_Off}\n"
sed -i "s|'videobackgroundblur', ||" $INT_CONF
if [ "$NC_DOMAIN" != "TBD" ]; then if [ "$NC_DOMAIN" != "TBD" ]; then
printf "${Purple}========== Enable $NC_DOMAIN for sync client ==========${Color_Off}\n" printf "${Purple}========== Enable $NC_DOMAIN for sync client ==========${Color_Off}\n"
if [ -z "$PREAD_PROXY" ]; then if [ -z "$PREAD_PROXY" ]; then

View File

@ -7,6 +7,7 @@
CSS_FILE="/usr/share/jitsi-meet/css/all.css" CSS_FILE="/usr/share/jitsi-meet/css/all.css"
TITLE_FILE="/usr/share/jitsi-meet/title.html" TITLE_FILE="/usr/share/jitsi-meet/title.html"
INT_CONF="/usr/share/jitsi-meet/interface_config.js" 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" BUNDLE_JS="/usr/share/jitsi-meet/libs/app.bundle.min.js"
# #
JM_IMG_PATH="/usr/share/jitsi-meet/images" JM_IMG_PATH="/usr/share/jitsi-meet/images"
@ -56,17 +57,20 @@ sed -i "s|.leftwatermark{|.leftwatermark{display:none;|" $CSS_FILE
fi fi
#Customize room title #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|Jitsi Meet|$APP_NAME|g" $TITLE_FILE
sed -i "s| powered by the Jitsi Videobridge||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/* sed -i "/appNotInstalled/ s|{{app}}|$MOVILE_APP_NAME|" /usr/share/jitsi-meet/lang/*
#Custom UI changes #Custom UI changes
echo " if [ -f "$INT_CONF_ETC" ]; then
Please note that brandless mode will also overwrite support links. echo "Static interface_config.js exists, skipping modification..."
" else
sed -i "s|Fellow Jitster|$PART_USER|g" $INT_CONF echo "This setup doesn't have a static interface_config.js, checking changes..."
sed -i "s|'me'|'$LOCAL_USER'|" $INT_CONF echo -e "\nPlease note that brandless mode will also overwrite support links.\n"
sed -i "s|LIVE_STREAMING_HELP_LINK: .*|LIVE_STREAMING_HELP_LINK: '#',|g" $INT_CONF sed -i "21,32 s|Jitsi Meet|$APP_NAME|g" $INT_CONF
sed -i "s|SUPPORT_URL: .*|SUPPORT_URL: '#',|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 JibriBrewery=JibriBrewery
INT_CONF="/usr/share/jitsi-meet/interface_config.js" 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) WAN_IP=$(dig +short myip.opendns.com @resolver1.opendns.com)
ssl_wa() { ssl_wa() {
@ -818,8 +819,26 @@ else
https://github.com/switnet-ltd/quick-jibri-installer/issues " https://github.com/switnet-ltd/quick-jibri-installer/issues "
fi fi
# Disable "Blur my background" until new notice echo "Disable \"Blur my background\" until new notice"
sed -i "s|'videobackgroundblur', ||" $INT_CONF 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 prosody conf file =================
#Setup secure rooms #Setup secure rooms