Merge branch 'promote-webhooks' into mconf-live0.6.3

This commit is contained in:
Felipe Cecagno 2015-05-18 13:00:52 -03:00
commit e8717d3fb2
23 changed files with 36 additions and 3 deletions

View File

@ -11,8 +11,8 @@ var bodyParser = require('body-parser');
// server configs
var port = 3006; // port in which to run this app
var shared_secret = "33e06642a13942004fd83b3ba6e4104a"; // shared secret of your server
var domain = "10.0.3.36"; // address of your server
var target_domain = "10.0.3.36:3005"; // address of the webhooks app
var domain = "127.0.0.1"; // address of your server
var target_domain = "127.0.0.1:3005"; // address of the webhooks app
var encodeForUrl = function(value) {
return encodeURIComponent(value)

View File

@ -549,6 +549,16 @@ fi
if [ $SALT ]; then
need_root
change_var_salt ${SERVLET_DIR}/bigbluebutton/WEB-INF/classes/bigbluebutton.properties securitySalt $SALT
if [ -f /usr/local/bigbluebutton/bbb-webhooks/config_local.coffee ]; then
sed -i "s|\(^[ \t]*config.bbb.sharedSecret[ =]*\).*|\1\"$SALT\"|g" /usr/local/bigbluebutton/bbb-webhooks/config_local.coffee
fi
if [ -f /usr/local/bigbluebutton/bbb-webhooks/extra/post_catcher.js ]; then
sed -i "s|\(^[ \t]*var shared_secret[ =]*\)[^;]*|\1\"$SALT\"|g" /usr/local/bigbluebutton/bbb-webhooks/extra/post_catcher.js
fi
change_var_salt ${SERVLET_DIR}/bigbluebutton/WEB-INF/classes/bigbluebutton.properties securitySalt $SALT
echo "Changed BigBlueButton's shared secret to $SALT"
echo
@ -731,6 +741,30 @@ check_configuration() {
fi
fi
BBB_SALT=$(cat ${SERVLET_DIR}/bigbluebutton/WEB-INF/classes/bigbluebutton.properties | tr -d '\r' | sed -n '/securitySalt/{s/.*=//;p}')
NGINX_IP=$(cat /etc/nginx/sites-available/bigbluebutton | sed -n '/server_name/{s/.*name[ ]*//;s/;//;p}')
if [ -f /usr/local/bigbluebutton/bbb-webhooks/config_local.coffee ]; then
WEBHOOKS_SALT=$(cat /usr/local/bigbluebutton/bbb-webhooks/config_local.coffee | grep '^[ \t]*config.bbb.sharedSecret[ =]*' | cut -d '"' -f2)
if [ "$BBB_SALT" != "$WEBHOOKS_SALT" ]; then
echo "# Warning: Webhooks API Salt mismatch: "
echo "# ${SERVLET_DIR}/bigbluebutton/WEB-INF/classes/bigbluebutton.properties = $BBB_SALT"
echo "# /usr/local/bigbluebutton/bbb-webhooks/config_local.coffee = $WEBHOOKS_SALT"
echo
fi
WEBHOOKS_PROXY_PORT=$(cat /etc/bigbluebutton/nginx/webhooks.nginx | grep '^[ \t]*proxy_pass[ \t]*' | sed 's|.*http[s]\?://[^:]*:\([^;]*\);.*|\1|g')
WEBHOOKS_APP_PORT=$(cat /usr/local/bigbluebutton/bbb-webhooks/config_local.coffee | grep '^[ \t]*config.server.port[ =]*' | cut -d '=' -f2 | xargs)
if [ "$WEBHOOKS_PROXY_PORT" != "$WEBHOOKS_APP_PORT" ]; then
echo "# Warning: Webhooks port mismatch: "
echo "# /etc/bigbluebutton/nginx/webhooks.nginx = $WEBHOOKS_PROXY_PORT"
echo "# /usr/local/bigbluebutton/bbb-webhooks/config_local.coffee = $WEBHOOKS_APP_PORT"
echo
fi
fi
if [ -f ${SERVLET_DIR}/lti/WEB-INF/classes/lti.properties ]; then
LTI_SALT=$(cat ${SERVLET_DIR}/lti/WEB-INF/classes/lti.properties | tr -d '\r' | sed -n '/^bigbluebuttonSalt/{s/.*=//;p}')
BBB_SALT=$(cat ${SERVLET_DIR}/bigbluebutton/WEB-INF/classes/bigbluebutton.properties | tr -d '\r' | sed -n '/securitySalt/{s/.*=//;p}')
@ -1574,4 +1608,3 @@ if [ $WATCH ]; then
need_root
watch -n 2 "top -n 1 -b | head -n 5; echo; bbb-conf --network; bbb-conf --debug"
fi