Configures Jicofo when jitsi-meet-tokens package is installed

This commit is contained in:
paweldomas 2015-12-15 11:46:37 -06:00
parent d666fbb6a4
commit ac8e1ce388
2 changed files with 26 additions and 0 deletions

View File

@ -66,6 +66,18 @@ case "$1" in
sed -i "s/ --app_secret=example_app_secret/ app_secret=$APP_SECRET/g" $PROSODY_HOST_CONFIG sed -i "s/ --app_secret=example_app_secret/ app_secret=$APP_SECRET/g" $PROSODY_HOST_CONFIG
sed -i 's/ --modules_enabled = { "token_verification" }/ modules_enabled = { "token_verification" }/g' $PROSODY_HOST_CONFIG sed -i 's/ --modules_enabled = { "token_verification" }/ modules_enabled = { "token_verification" }/g' $PROSODY_HOST_CONFIG
# Configure Jicofo properties
JICOFO_CONFIG="/etc/jitsi/jicofo/sip-communicator.properties"
if ! grep -q "org.jitsi.jicofo.auth.jwt.APP_ID" $JICOFO_CONFIG && \
! grep -q "org.jitsi.jicofo.auth.jwt.APP_SECRET" $JICOFO_CONFIG; then
echo "org.jitsi.jicofo.auth.jwt.APP_ID=$APP_ID" >> $JICOFO_CONFIG
echo "org.jitsi.jicofo.auth.jwt.APP_SECRET=$APP_SECRET" >> $JICOFO_CONFIG
# Restart Jicofo
if [ -x "/etc/init.d/jicofo" ]; then
invoke-rc.d jicofo restart
fi
fi
if [ -x "/etc/init.d/prosody" ]; then if [ -x "/etc/init.d/prosody" ]; then
invoke-rc.d prosody reload invoke-rc.d prosody reload
fi fi

View File

@ -44,6 +44,20 @@ case "$1" in
sed -i "s/ app_secret=$APP_SECRET/ --app_secret=example_app_secret/g" $PROSODY_HOST_CONFIG sed -i "s/ app_secret=$APP_SECRET/ --app_secret=example_app_secret/g" $PROSODY_HOST_CONFIG
sed -i 's/ modules_enabled = { "token_verification" }/ --modules_enabled = { "token_verification" }/g' $PROSODY_HOST_CONFIG sed -i 's/ modules_enabled = { "token_verification" }/ --modules_enabled = { "token_verification" }/g' $PROSODY_HOST_CONFIG
JICOFO_CONFIG="/etc/jitsi/jicofo/sip-communicator.properties"
if [ -f "$JICOFO_CONFIG" ] ; then
if grep -q "org.jitsi.jicofo.auth.jwt.APP_ID" $JICOFO_CONFIG || \
grep -q "org.jitsi.jicofo.auth.jwt.APP_SECRET" $JICOFO_CONFIG; then
sed -i.old "/org.jitsi.jicofo.auth.jwt.APP_ID=$APP_ID/d" $JICOFO_CONFIG
sed -i.old "/org.jitsi.jicofo.auth.jwt.APP_SECRET=$APP_SECRET/d" $JICOFO_CONFIG
rm "$JICOFO_CONFIG.old"
# Restart Jicofo
if [ -x "/etc/init.d/jicofo" ]; then
invoke-rc.d jicofo restart
fi
fi
fi
if [ -x "/etc/init.d/prosody" ]; then if [ -x "/etc/init.d/prosody" ]; then
invoke-rc.d prosody reload invoke-rc.d prosody reload
fi fi