Pārlūkot izejas kodu

Configures Jicofo when jitsi-meet-tokens package is installed

j8
paweldomas 9 gadus atpakaļ
vecāks
revīzija
ac8e1ce388
2 mainītis faili ar 26 papildinājumiem un 0 dzēšanām
  1. 12
    0
      debian/jitsi-meet-tokens.postinst
  2. 14
    0
      debian/jitsi-meet-tokens.postrm

+ 12
- 0
debian/jitsi-meet-tokens.postinst Parādīt failu

@@ -66,6 +66,18 @@ case "$1" in
66 66
                 sed -i "s/ --app_secret=example_app_secret/ app_secret=$APP_SECRET/g" $PROSODY_HOST_CONFIG
67 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 81
                 if [ -x "/etc/init.d/prosody" ]; then
70 82
                     invoke-rc.d prosody reload
71 83
                 fi

+ 14
- 0
debian/jitsi-meet-tokens.postrm Parādīt failu

@@ -44,6 +44,20 @@ case "$1" in
44 44
             sed -i "s/ app_secret=$APP_SECRET/ --app_secret=example_app_secret/g" $PROSODY_HOST_CONFIG
45 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 61
             if [ -x "/etc/init.d/prosody" ]; then
48 62
                 invoke-rc.d prosody reload
49 63
             fi

Notiek ielāde…
Atcelt
Saglabāt