Просмотр исходного кода

Fixes configuring certs if files already placed in /etc/ssl.

master
Damian Minkov 10 лет назад
Родитель
Сommit
13846b022c
1 измененных файлов: 23 добавлений и 25 удалений
  1. 23
    25
      debian/jitsi-meet.postinst

+ 23
- 25
debian/jitsi-meet.postinst Просмотреть файл

@@ -41,31 +41,29 @@ case "$1" in
41 41
             sed -i "s/#\ server_names_hash_bucket_size\ 64/\ server_names_hash_bucket_size\ 64/" /etc/nginx/nginx.conf
42 42
         fi
43 43
 
44
-        if [ ! -f /etc/ssl/$JVB_HOSTNAME.key ] || [ ! -f /etc/ssl/$JVB_HOSTNAME.crt ]; then
45
-            # SSL for nginx
46
-            db_get jitsi-meet/cert-choice
47
-            CERT_CHOICE="$RET"
48
-            if [ "$CERT_CHOICE" = 'A certificate is available and the files are uploaded on the server' ]; then
49
-                db_set jitsi-meet/cert-path-key "/etc/ssl/$JVB_HOSTNAME.key"
50
-                db_input critical jitsi-meet/cert-path-key || true
51
-                db_go
52
-                db_get jitsi-meet/cert-path-key
53
-                CERT_KEY="$RET"
54
-                db_set jitsi-meet/cert-path-crt "/etc/ssl/$JVB_HOSTNAME.crt"
55
-                db_input critical jitsi-meet/cert-path-crt || true
56
-                db_go
57
-                db_get jitsi-meet/cert-path-crt
58
-                CERT_CRT="$RET"
59
-                # replace self-signed certificate paths with user provided ones
60
-                CERT_KEY_ESC=$(echo $CERT_KEY | sed 's/\./\\\./g')
61
-                CERT_KEY_ESC=$(echo $CERT_KEY_ESC | sed 's/\//\\\//g')
62
-                sed -i "s/ssl_certificate_key\ \/var\/lib\/prosody\/.*key/ssl_certificate_key\ $CERT_KEY_ESC/g" \
63
-                    /etc/nginx/sites-available/$JVB_HOSTNAME.conf
64
-                CERT_CRT_ESC=$(echo $CERT_CRT | sed 's/\./\\\./g')
65
-                CERT_CRT_ESC=$(echo $CERT_CRT_ESC | sed 's/\//\\\//g')
66
-                sed -i "s/ssl_certificate\ \/var\/lib\/prosody\/.*crt/ssl_certificate\ $CERT_CRT_ESC/g" \
67
-                    /etc/nginx/sites-available/$JVB_HOSTNAME.conf
68
-            fi
44
+        # SSL for nginx
45
+        db_get jitsi-meet/cert-choice
46
+        CERT_CHOICE="$RET"
47
+        if [ "$CERT_CHOICE" = 'A certificate is available and the files are uploaded on the server' ]; then
48
+            db_set jitsi-meet/cert-path-key "/etc/ssl/$JVB_HOSTNAME.key"
49
+            db_input critical jitsi-meet/cert-path-key || true
50
+            db_go
51
+            db_get jitsi-meet/cert-path-key
52
+            CERT_KEY="$RET"
53
+            db_set jitsi-meet/cert-path-crt "/etc/ssl/$JVB_HOSTNAME.crt"
54
+            db_input critical jitsi-meet/cert-path-crt || true
55
+            db_go
56
+            db_get jitsi-meet/cert-path-crt
57
+            CERT_CRT="$RET"
58
+            # replace self-signed certificate paths with user provided ones
59
+            CERT_KEY_ESC=$(echo $CERT_KEY | sed 's/\./\\\./g')
60
+            CERT_KEY_ESC=$(echo $CERT_KEY_ESC | sed 's/\//\\\//g')
61
+            sed -i "s/ssl_certificate_key\ \/var\/lib\/prosody\/.*key/ssl_certificate_key\ $CERT_KEY_ESC/g" \
62
+                /etc/nginx/sites-available/$JVB_HOSTNAME.conf
63
+            CERT_CRT_ESC=$(echo $CERT_CRT | sed 's/\./\\\./g')
64
+            CERT_CRT_ESC=$(echo $CERT_CRT_ESC | sed 's/\//\\\//g')
65
+            sed -i "s/ssl_certificate\ \/var\/lib\/prosody\/.*crt/ssl_certificate\ $CERT_CRT_ESC/g" \
66
+                /etc/nginx/sites-available/$JVB_HOSTNAME.conf
69 67
         fi
70 68
 
71 69
         # jitsi meet

Загрузка…
Отмена
Сохранить