Add after-install-configurations to script 'bbb-post-install.sh'.

This commit is contained in:
Christoph 2020-03-29 15:17:46 +02:00
parent 0318fafd1c
commit a28d097cc1

View File

@ -215,4 +215,224 @@ $(cat "$log_file")
fi
# Configure FreeSWITCH for using SSL
if $terminal ; then
echo ""
echo -e " \033[1mConfigure FreeSWITCH for using SSL\033[m"
echo ""
fi
echononl "Replace 'http://' with https:// (/etc/bigbluebutton/nginx/sip.nginx).."
if $(grep -q -E "http://" /etc/bigbluebutton/nginx/sip.nginx 2> /dev/null) ; then
perl -i -n -p -e "s#http://#https://#" /etc/bigbluebutton/nginx/sip.nginx > "$log_file" 2>&1
if [[ $? -ne 0 ]]; then
echo_failed
error "$(cat "$log_file")"
else
echo_ok
fi
else
echo_skipped
fi
echononl "Replace port 5066 with 7443 (/etc/bigbluebutton/nginx/sip.nginx).."
if $(grep -q -E ":5066\s*;" /etc/bigbluebutton/nginx/sip.nginx 2> /dev/null) ; then
perl -i -n -p -e "s#:5066\s*;#:7443;#" /etc/bigbluebutton/nginx/sip.nginx > "$log_file" 2>&1
if [[ $? -ne 0 ]]; then
echo_failed
error "$(cat "$log_file")"
else
echo_ok
fi
else
echo_skipped
fi
blank_line
# Configure BigBlueButton to load session via HTTPS
if $terminal ; then
echo ""
echo -e " \033[1mConfigure BigBlueButton to load session via HTTPS\033[m"
echo ""
fi
echononl "Setup 'bigbluebutton.web.serverURL' (bigbluebutton.properties)"
if $(grep -q -E "^\s*bigbluebutton.web.serverURL\s*=\s*http:" /usr/share/bbb-web/WEB-INF/classes/bigbluebutton.properties 2> /dev/null) ; then
perl -i -n -p -e "s#^(\s*bigbluebutton.web.serverURL=.*)#\#\#!\1\nbigbluebutton.web.serverURL=https://${FQDN_HOSTNAME}#" \
/usr/share/bbb-web/WEB-INF/classes/bigbluebutton.properties > "$log_file" 2>&1
if [[ $? -ne 0 ]]; then
echo_failed
error "$(cat "$log_file")"
else
echo_ok
fi
else
echo_skipped
fi
echononl "Setup 'jnlpUrl' (screenshare.properties)"
if $(grep -q -E "^\s*jnlpUrl\s*=\s*http:" /usr/share/red5/webapps/screenshare/WEB-INF/screenshare.properties 2> /dev/null) ; then
perl -i -n -p -e "s#^(\s*jnlpUrl\s*=.*)#\#\#!\1\njnlpUrl=https://${FQDN_HOSTNAME}/screenshare#" \
/usr/share/red5/webapps/screenshare/WEB-INF/screenshare.properties > "$log_file" 2>&1
if [[ $? -ne 0 ]]; then
echo_failed
error "$(cat "$log_file")"
else
echo_ok
fi
else
echo_skipped
fi
echononl "Setup 'jnlpFile' (screenshare.properties)"
if $(grep -q -E "^\s*jnlpFile\s*=\s*http:" /usr/share/red5/webapps/screenshare/WEB-INF/screenshare.properties 2> /dev/null) ; then
perl -i -n -p -e "s#^(\s*jnlpFile\s*=.*)#\#\#!\1\njnlpFile=https://${FQDN_HOSTNAME}/screenshare/screenshare.jnlp#" \
/usr/share/red5/webapps/screenshare/WEB-INF/screenshare.properties > "$log_file" 2>&1
if [[ $? -ne 0 ]]; then
echo_failed
error "$(cat "$log_file")"
else
echo_ok
fi
else
echo_skipped
fi
echononl "Change all 'http://' to 'https:/' (/var/www/bigbluebutton/client/conf/config.xml).."
if $(grep -q -E "http://" /var/www/bigbluebutton/client/conf/config.xml 2> /dev/null) ; then
sed -e 's|http://|https://|g' -i /var/www/bigbluebutton/client/conf/config.xml > "$log_file" 2>&1
if [[ $? -ne 0 ]]; then
echo_failed
error "$(cat "$log_file")"
else
echo_ok
fi
else
echo_skipped
fi
blank_line
# Adjust /usr/share/meteor/bundle/programs/server/assets/app/config/settings.yml
#
if $terminal ; then
echo ""
echo -e " \033[1mAdjust file /usr/share/meteor/bundle/programs/server/assets/app/config/settings.yml\033[m"
echo ""
fi
echononl "Change 'wsUrl: ws://' to 'wsUrl: wss://'.."
if $(grep -q -E "wsUrl:\s*ws:" /usr/share/meteor/bundle/programs/server/assets/app/config/settings.yml 2> /dev/null) ; then
perl -i -n -p -e "s#wsUrl:\s*ws:#wsUrl: wss:#" \
/usr/share/meteor/bundle/programs/server/assets/app/config/settings.yml > "$log_file" 2>&1
if [[ $? -ne 0 ]]; then
echo_failed
error "$(cat "$log_file")"
else
echo_ok
fi
else
echo_skipped
fi
echononl "Change 'url: http://' to 'url: https://'.."
if $(grep -q -E "^\s*url: http:" /usr/share/meteor/bundle/programs/server/assets/app/config/settings.yml 2> /dev/null) ; then
perl -i -n -p -e "s#^(\s*url:\s*)http:#\1https:#" \
/usr/share/meteor/bundle/programs/server/assets/app/config/settings.yml > "$log_file" 2>&1
if [[ $? -ne 0 ]]; then
echo_failed
error "$(cat "$log_file")"
else
echo_ok
fi
else
echo_skipped
fi
blank_line
# Modify the creation of recordings so they are served via HTTPS
#
if $terminal ; then
echo ""
echo -e " \033[1mModify the creation of recordings so they are served via HTTPS\033[m"
echo ""
fi
echononl "Change 'playback_protocol' to use https.."
if $(grep -q -E "^\s*playback_protocol:\s*http\s*$" /usr/local/bigbluebutton/core/scripts/bigbluebutton.yml > "$log_file" 2>&1) ; then
perl -i -n -p -e "s#^(\s*playback_protocol:\s*http.*)#\#\#!\1\nplayback_protocol: https#" \
/usr/local/bigbluebutton/core/scripts/bigbluebutton.yml > "$log_file" 2>&1
if [[ $? -ne 0 ]]; then
echo_failed
error "$(cat "$log_file")"
else
echo_ok
fi
else
echo_skipped
fi
if [[ -f "/var/lib/tomcat7/webapps/demo/bbb_api_conf.jsp" ]] ; then
blank_line
# Also at 'API demo' Installation use SSL Protocol
#
if $terminal ; then
echo ""
echo -e " \033[1mUse SSL Protocoll for API demos\033[m"
echo ""
fi
echononl "Change 'BigBlueButtonURL' to use SSL Protocil.."
if $(grep -q -E "^\s*String\s+BigBlueButtonURL\s*=\s*\"http:" /var/lib/tomcat7/webapps/demo/bbb_api_conf.jsp 2> /dev/null) ; then
perl -i -n -p -e "s#^(\s*String\s+BigBlueButtonURL\s*=\s*\"http:.*)#//!\1\nString BigBlueButtonURL = \"https://${FQDN_HOSTNAME}/bigbluebutton/\";#" /var/lib/tomcat7/webapps/demo/bbb_api_conf.jsp > "$log_file" 2>&1
if [[ $? -ne 0 ]]; then
echo_failed
error "$(cat "$log_file")"
else
echo_ok
fi
else
echo_skipped
fi
fi
blank_line
# Restart BigBlueButton Service
#
if $terminal ; then
echo ""
echo -e " \033[1mRestart BigBlueButton Service\033[m"
echo ""
fi
echononl "Restart BigBlueButton Service - 'bbb-conf --restart'"
bbb-conf --restart > "$log_file" 2>&1
if [[ $? -ne 0 ]]; then
echo_failed
error "$(cat "$log_file")"
else
echo_ok
echo -e "
\033[32m----------\033[m
\033[1mOutput from restarting BigBlueButton Service was:\033[m
$(cat "$log_file")
\033[32m----------\033[m
"
fi
clean_up 0