Browse Source

Fixes purging configuration.

master
Damian Minkov 11 years ago
parent
commit
8f9c6de0b6
4 changed files with 40 additions and 8 deletions
  1. 9
    6
      debian/jitsi-meet.postinst
  2. 11
    2
      debian/jitsi-meet.postrm
  3. 6
    0
      debian/jitsi-meet.templates
  4. 14
    0
      debian/po/templates.pot

+ 9
- 6
debian/jitsi-meet.postinst View File

22
 
22
 
23
         . /etc/default/jitsi-videobridge
23
         . /etc/default/jitsi-videobridge
24
 
24
 
25
+        # loading debconf
26
+        . /usr/share/debconf/confmodule
27
+
28
+        # stores the hostname so we will reuse it later, like in purge
29
+        db_set jitsi-meet/jvb-hostname $JVB_HOSTNAME
30
+
25
         # nginx conf
31
         # nginx conf
26
         if [ ! -f /etc/nginx/sites-available/$JVB_HOSTNAME.conf ]; then
32
         if [ ! -f /etc/nginx/sites-available/$JVB_HOSTNAME.conf ]; then
27
             cp /usr/share/doc/jitsi-meet/jitsi-meet.example /etc/nginx/sites-available/$JVB_HOSTNAME.conf
33
             cp /usr/share/doc/jitsi-meet/jitsi-meet.example /etc/nginx/sites-available/$JVB_HOSTNAME.conf
36
         fi
42
         fi
37
 
43
 
38
         if [ ! -f /etc/ssl/$JVB_HOSTNAME.key ] || [ ! -f /etc/ssl/$JVB_HOSTNAME.crt ]; then
44
         if [ ! -f /etc/ssl/$JVB_HOSTNAME.key ] || [ ! -f /etc/ssl/$JVB_HOSTNAME.crt ]; then
39
-            # loading debconf
40
-            . /usr/share/debconf/confmodule
41
-
42
             # SSL for nginx
45
             # SSL for nginx
43
             db_get jitsi-meet/cert-choice
46
             db_get jitsi-meet/cert-choice
44
             CERT_CHOICE="$RET"
47
             CERT_CHOICE="$RET"
63
                 sed -i "s/ssl_certificate\ \/var\/lib\/prosody\/.*crt/ssl_certificate\ $CERT_CRT_ESC/g" \
66
                 sed -i "s/ssl_certificate\ \/var\/lib\/prosody\/.*crt/ssl_certificate\ $CERT_CRT_ESC/g" \
64
                     /etc/nginx/sites-available/$JVB_HOSTNAME.conf
67
                     /etc/nginx/sites-available/$JVB_HOSTNAME.conf
65
             fi
68
             fi
66
-
67
-            # and we're done with debconf
68
-            db_stop
69
         fi
69
         fi
70
 
70
 
71
         # jitsi meet
71
         # jitsi meet
75
             sed -i "s/jitsi-meet.example.com/$JVB_HOSTNAME/g" $JITSI_MEET_CONFIG
75
             sed -i "s/jitsi-meet.example.com/$JVB_HOSTNAME/g" $JITSI_MEET_CONFIG
76
         fi
76
         fi
77
 
77
 
78
+        # and we're done with debconf
79
+        db_stop
80
+
78
         invoke-rc.d nginx reload
81
         invoke-rc.d nginx reload
79
     ;;
82
     ;;
80
 
83
 

+ 11
- 2
debian/jitsi-meet.postrm View File

28
             invoke-rc.d nginx reload
28
             invoke-rc.d nginx reload
29
         fi
29
         fi
30
     ;;
30
     ;;
31
-
32
-    purge|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)
31
+    purge)
32
+        db_get jitsi-meet/jvb-hostname
33
+        JVB_HOSTNAME=$RET
34
+        if [ -n "$RET" ]; then
35
+            #. /etc/default/jitsi-videobridge
36
+            rm -f /etc/jitsi/meet/$JVB_HOSTNAME-config.js
37
+            rm -f /etc/nginx/sites-available/$JVB_HOSTNAME.conf
38
+            rm -f /etc/nginx/sites-enabled/$JVB_HOSTNAME.conf
39
+        fi
40
+    ;;
41
+    upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)
33
     ;;
42
     ;;
34
 
43
 
35
     *)
44
     *)

+ 6
- 0
debian/jitsi-meet.templates View File

21
 _Description: Full local server path to the SSL certificate file:
21
 _Description: Full local server path to the SSL certificate file:
22
  The full path to the SSL certificate file on the server.
22
  The full path to the SSL certificate file on the server.
23
  If you haven't uploaded it, now is a good time to upload it in another console.
23
  If you haven't uploaded it, now is a good time to upload it in another console.
24
+
25
+Template: jitsi-meet/jvb-hostname
26
+Type: string
27
+Default: ${default-key}
28
+_Description: The hostname of the current installation:
29
+ The value for the hostname that is set in Jitsi Videobridge installation.

+ 14
- 0
debian/po/templates.pot View File

73
 "The full path to the SSL certificate file on the server. If you haven't "
73
 "The full path to the SSL certificate file on the server. If you haven't "
74
 "uploaded it, now is a good time to upload it in another console."
74
 "uploaded it, now is a good time to upload it in another console."
75
 msgstr ""
75
 msgstr ""
76
+
77
+
78
+#. Type: string
79
+#. Description
80
+#: ../jitsi-meet.templates:4001
81
+msgid "The hostname of the current installation:"
82
+msgstr ""
83
+
84
+#. Type: string
85
+#. Description
86
+#: ../jitsi-meet.templates:4001
87
+msgid ""
88
+"The value for the hostname that is set in Jitsi Videobridge installation."
89
+msgstr ""

Loading…
Cancel
Save