Fixes debconf questions for SSL.
This commit is contained in:
parent
e994916b25
commit
f0a237d537
|
@ -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
|
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in New Issue