fix: Fixes jaas and cert choice when package configure is reordered. (#12234)

* fix: Fixes jaas and cert choice when package configure is reordered.

* squash: Checks for jaas-choice before asking.
This commit is contained in:
Дамян Минков 2022-09-24 08:24:18 -05:00 committed by GitHub
parent 32b8c62ec9
commit 1b4bbcba3d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 26 additions and 10 deletions

View File

@ -83,17 +83,28 @@ case "$1" in
TURN_SECRET="$RET" TURN_SECRET="$RET"
fi fi
db_get jitsi-meet/jaas-choice
JAAS_INPUT="$RET"
# In the case of updating from an older version the configure of -prosody package may happen before the -config # In the case of updating from an older version the configure of -prosody package may happen before the -config
# one, so if JAAS_INPUT is empty (the question is not asked), let's ask it now. # one, so if JAAS_INPUT is empty (the question is not asked), let's ask it now.
if [ -z "$JAAS_INPUT" ] ; then db_get jitsi-meet/cert-choice
db_subst jitsi-meet/jaas-choice domain "${JVB_HOSTNAME}" CERT_CHOICE="$RET"
db_set jitsi-meet/jaas-choice false if [ -z "$CERT_CHOICE" ] ; then
db_input critical jitsi-meet/jaas-choice || true db_input critical jitsi-meet/cert-choice || true
db_go db_go
db_get jitsi-meet/cert-choice
CERT_CHOICE="$RET"
fi
SELF_SIGNED_CHOICE="Generate a new self-signed certificate"
if [ "$CERT_CHOICE" != "$SELF_SIGNED_CHOICE" ]; then
db_get jitsi-meet/jaas-choice db_get jitsi-meet/jaas-choice
JAAS_INPUT="$RET" JAAS_INPUT="$RET"
if [ -z "$JAAS_INPUT" ] ; then
db_subst jitsi-meet/jaas-choice domain "${JVB_HOSTNAME}"
db_set jitsi-meet/jaas-choice false
db_input critical jitsi-meet/jaas-choice || true
db_go
db_get jitsi-meet/jaas-choice
JAAS_INPUT="$RET"
fi
fi fi
# and we're done with debconf # and we're done with debconf

View File

@ -137,12 +137,17 @@ case "$1" in
fi fi
if [ "$CERT_CHOICE" = "$LE_CERT_CHOICE" ] || [ "$CERT_CHOICE" = "$UPLOADED_CERT_CHOICE" ]; then if [ "$CERT_CHOICE" = "$LE_CERT_CHOICE" ] || [ "$CERT_CHOICE" = "$UPLOADED_CERT_CHOICE" ]; then
db_subst jitsi-meet/jaas-choice domain "${JVB_HOSTNAME}" # Make sure jaas-choice is not answered already
db_set jitsi-meet/jaas-choice false
db_input critical jitsi-meet/jaas-choice || true
db_go
db_get jitsi-meet/jaas-choice db_get jitsi-meet/jaas-choice
JAAS_INPUT="$RET" JAAS_INPUT="$RET"
if [ -z "$JAAS_INPUT" ] ; then
db_subst jitsi-meet/jaas-choice domain "${JVB_HOSTNAME}"
db_set jitsi-meet/jaas-choice false
db_input critical jitsi-meet/jaas-choice || true
db_go
db_get jitsi-meet/jaas-choice
JAAS_INPUT="$RET"
fi
fi fi
if [ "${JAAS_INPUT}" = "true" ] && ! grep -q "^var enableJaaS = true;$" $JITSI_MEET_CONFIG; then if [ "${JAAS_INPUT}" = "true" ] && ! grep -q "^var enableJaaS = true;$" $JITSI_MEET_CONFIG; then