Browse Source

Configures Jicofo when jitsi-meet-tokens package is installed

master
paweldomas 9 years ago
parent
commit
9734da3083
2 changed files with 26 additions and 0 deletions
  1. 12
    0
      debian/jitsi-meet-tokens.postinst
  2. 14
    0
      debian/jitsi-meet-tokens.postrm

+ 12
- 0
debian/jitsi-meet-tokens.postinst View File

66
                 sed -i "s/ --app_secret=example_app_secret/ app_secret=$APP_SECRET/g" $PROSODY_HOST_CONFIG
66
                 sed -i "s/ --app_secret=example_app_secret/ app_secret=$APP_SECRET/g" $PROSODY_HOST_CONFIG
67
                 sed -i 's/ --modules_enabled = { "token_verification" }/ modules_enabled = { "token_verification" }/g' $PROSODY_HOST_CONFIG
67
                 sed -i 's/ --modules_enabled = { "token_verification" }/ modules_enabled = { "token_verification" }/g' $PROSODY_HOST_CONFIG
68
 
68
 
69
+                # Configure Jicofo properties
70
+                JICOFO_CONFIG="/etc/jitsi/jicofo/sip-communicator.properties"
71
+                if ! grep -q "org.jitsi.jicofo.auth.jwt.APP_ID" $JICOFO_CONFIG && \
72
+                   ! grep -q "org.jitsi.jicofo.auth.jwt.APP_SECRET" $JICOFO_CONFIG; then
73
+                   echo "org.jitsi.jicofo.auth.jwt.APP_ID=$APP_ID" >> $JICOFO_CONFIG
74
+                   echo "org.jitsi.jicofo.auth.jwt.APP_SECRET=$APP_SECRET" >> $JICOFO_CONFIG
75
+                   # Restart Jicofo
76
+                   if [ -x "/etc/init.d/jicofo" ]; then
77
+                       invoke-rc.d jicofo restart
78
+                   fi
79
+                fi
80
+
69
                 if [ -x "/etc/init.d/prosody" ]; then
81
                 if [ -x "/etc/init.d/prosody" ]; then
70
                     invoke-rc.d prosody reload
82
                     invoke-rc.d prosody reload
71
                 fi
83
                 fi

+ 14
- 0
debian/jitsi-meet-tokens.postrm View File

44
             sed -i "s/ app_secret=$APP_SECRET/ --app_secret=example_app_secret/g" $PROSODY_HOST_CONFIG
44
             sed -i "s/ app_secret=$APP_SECRET/ --app_secret=example_app_secret/g" $PROSODY_HOST_CONFIG
45
             sed -i 's/ modules_enabled = { "token_verification" }/ --modules_enabled = { "token_verification" }/g' $PROSODY_HOST_CONFIG
45
             sed -i 's/ modules_enabled = { "token_verification" }/ --modules_enabled = { "token_verification" }/g' $PROSODY_HOST_CONFIG
46
 
46
 
47
+            JICOFO_CONFIG="/etc/jitsi/jicofo/sip-communicator.properties"
48
+            if [ -f "$JICOFO_CONFIG" ] ; then
49
+                if grep -q "org.jitsi.jicofo.auth.jwt.APP_ID" $JICOFO_CONFIG || \
50
+                   grep -q "org.jitsi.jicofo.auth.jwt.APP_SECRET" $JICOFO_CONFIG; then
51
+                   sed -i.old "/org.jitsi.jicofo.auth.jwt.APP_ID=$APP_ID/d" $JICOFO_CONFIG
52
+                   sed -i.old "/org.jitsi.jicofo.auth.jwt.APP_SECRET=$APP_SECRET/d" $JICOFO_CONFIG
53
+                   rm "$JICOFO_CONFIG.old"
54
+                   # Restart Jicofo
55
+                   if [ -x "/etc/init.d/jicofo" ]; then
56
+                       invoke-rc.d jicofo restart
57
+                   fi
58
+                fi
59
+            fi
60
+
47
             if [ -x "/etc/init.d/prosody" ]; then
61
             if [ -x "/etc/init.d/prosody" ]; then
48
                 invoke-rc.d prosody reload
62
                 invoke-rc.d prosody reload
49
             fi
63
             fi

Loading…
Cancel
Save