From ac8e1ce3889feea1d94cbe19bdd277ba0d8a819e Mon Sep 17 00:00:00 2001 From: paweldomas Date: Tue, 15 Dec 2015 11:46:37 -0600 Subject: [PATCH] Configures Jicofo when jitsi-meet-tokens package is installed --- debian/jitsi-meet-tokens.postinst | 12 ++++++++++++ debian/jitsi-meet-tokens.postrm | 14 ++++++++++++++ 2 files changed, 26 insertions(+) diff --git a/debian/jitsi-meet-tokens.postinst b/debian/jitsi-meet-tokens.postinst index 4343e219a..ac194ff4b 100644 --- a/debian/jitsi-meet-tokens.postinst +++ b/debian/jitsi-meet-tokens.postinst @@ -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/ --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 invoke-rc.d prosody reload fi diff --git a/debian/jitsi-meet-tokens.postrm b/debian/jitsi-meet-tokens.postrm index 53a69f530..44582f20a 100644 --- a/debian/jitsi-meet-tokens.postrm +++ b/debian/jitsi-meet-tokens.postrm @@ -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/ 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 invoke-rc.d prosody reload fi