From c5edb4b5a326a2c615f427c218eb06e4056c3b79 Mon Sep 17 00:00:00 2001 From: turint Date: Sat, 30 Aug 2014 00:17:18 +0300 Subject: [PATCH] Fixes SSL debconf questions. --- debian/jitsi-meet.config | 8 -------- debian/jitsi-meet.postinst | 12 ++++++++---- 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/debian/jitsi-meet.config b/debian/jitsi-meet.config index b43b7b3c3..4b5aa24e8 100644 --- a/debian/jitsi-meet.config +++ b/debian/jitsi-meet.config @@ -6,11 +6,3 @@ # certificate type choice db_input critical jitsi-meet/cert-choice || true db_go - -# ssl key file path -#db_input critical jitsi-meet/cert-path-key || true -#db_go - -# ssl cert file path -#db_input critical jitsi-meet/cert-path-crt || true -#db_go diff --git a/debian/jitsi-meet.postinst b/debian/jitsi-meet.postinst index d6a9fad5a..6e52668f1 100644 --- a/debian/jitsi-meet.postinst +++ b/debian/jitsi-meet.postinst @@ -44,20 +44,24 @@ case "$1" in # self-signed certificate is already in place for prosody : elif [ "$CERT_CHOICE" = 'I have a certificate and will upload the files on the server' ]; then - db_fset jitsi-meet/default-key "/etc/ssl/$JVB_HOSTNAME.key" + db_set jitsi-meet/cert-path-key "/etc/ssl/$JVB_HOSTNAME.key" db_input critical jitsi-meet/cert-path-key || true db_go db_get jitsi-meet/cert-path-key CERT_KEY="$RET" - db_fset jitsi-meet/default-crt "/etc/ssl/$JVB_HOSTNAME.crt" + db_set jitsi-meet/cert-path-crt "/etc/ssl/$JVB_HOSTNAME.crt" db_input critical jitsi-meet/cert-path-crt || true db_go db_get jitsi-meet/cert-path-crt CERT_CRT="$RET" # replace self-signed certificate paths with user provided ones - sed -i "s/ssl_certificate_key\ \/var\/lib\/prosody\/(.*)key/ssl_certificate_key\ $CERT_KEY/g" \ + CERT_KEY_ESC=$(echo $CERT_KEY | sed 's/\./\\\./g') + CERT_KEY_ESC=$(echo $CERT_KEY_ESC | sed 's/\//\\\//g') + sed -i "s/ssl_certificate_key\ \/var\/lib\/prosody\/.*key/ssl_certificate_key\ $CERT_KEY_ESC/g" \ /etc/nginx/sites-available/$JVB_HOSTNAME.conf - sed -i "s/ssl_certificate\ \/var\/lib\/prosody\/(.*)crt/ssl_certificate\ $CERT_CRT/g" \ + CERT_CRT_ESC=$(echo $CERT_CRT | sed 's/\./\\\./g') + CERT_CRT_ESC=$(echo $CERT_CRT_ESC | sed 's/\//\\\//g') + sed -i "s/ssl_certificate\ \/var\/lib\/prosody\/.*crt/ssl_certificate\ $CERT_CRT_ESC/g" \ /etc/nginx/sites-available/$JVB_HOSTNAME.conf fi