Fixes debconf questions for SSL.

This commit is contained in:
turint 2014-08-29 23:14:15 +03:00 committed by Damian Minkov
parent e994916b25
commit f0a237d537
2 changed files with 22 additions and 2 deletions

16
debian/jitsi-meet.config vendored Normal file
View File

@ -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

View File

@ -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