From f0a237d537883107e903531c2be12a8645b7910c Mon Sep 17 00:00:00 2001 From: turint Date: Fri, 29 Aug 2014 23:14:15 +0300 Subject: [PATCH] Fixes debconf questions for SSL. --- debian/jitsi-meet.config | 16 ++++++++++++++++ debian/jitsi-meet.postinst | 8 ++++++-- 2 files changed, 22 insertions(+), 2 deletions(-) create mode 100644 debian/jitsi-meet.config diff --git a/debian/jitsi-meet.config b/debian/jitsi-meet.config new file mode 100644 index 000000000..b43b7b3c3 --- /dev/null +++ b/debian/jitsi-meet.config @@ -0,0 +1,16 @@ +#!/bin/sh -e + +# Source debconf library. +. /usr/share/debconf/confmodule + +# 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 01ef3d869..d6a9fad5a 100644 --- a/debian/jitsi-meet.postinst +++ b/debian/jitsi-meet.postinst @@ -45,15 +45,19 @@ case "$1" in : 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_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_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" \ + sed -i "s/ssl_certificate_key\ \/var\/lib\/prosody\/(.*)key/ssl_certificate_key\ $CERT_KEY/g" \ /etc/nginx/sites-available/$JVB_HOSTNAME.conf - sed -i "s/ssl_certificate\ /var/lib/prosody/(.*)crt;/ssl_certificate\ $CERT_CRT;/g" \ + sed -i "s/ssl_certificate\ \/var\/lib\/prosody\/(.*)crt/ssl_certificate\ $CERT_CRT/g" \ /etc/nginx/sites-available/$JVB_HOSTNAME.conf fi