Commit 355170ca authored by Praveen Arimbrathodiyil's avatar Praveen Arimbrathodiyil
Browse files

correctly disable ssl with variable

parent ac480ef8
......@@ -16,7 +16,7 @@ set -e
# Store values from config file into
# debconf db.
db_set diaspora-common/url "$SERVERNAME"
db_set diaspora-common/ssl "${diaspora_https:-true}"
db_set diaspora-common/ssl "${ENVIRONMENT_REQUIRE_SSL:-true}"
db_set diaspora-common/letsencrypt "${diaspora_letsencrypt:-false}"
if [ -n "$diaspora_letsencrypt_email" ]; then
db_set diaspora-common/letsencrypt_email "${diaspora_letsencrypt_email}"
......
......@@ -66,9 +66,9 @@ case "$1" in
db_get diaspora-common/url
SERVERNAME=${RET}
db_get diaspora-common/ssl
diaspora_https=$RET
ENVIRONMENT_REQUIRE_SSL=$RET
ENVIRONMENT_URL="https:\/\/$SERVERNAME"
if [ "$diaspora_https" = "false" ]; then
if [ "$ENVIRONMENT_REQUIRE_SSL" = "false" ]; then
ENVIRONMENT_URL="http:\/\/$SERVERNAME"
fi
db_get diaspora-common/letsencrypt
......@@ -82,15 +82,15 @@ case "$1" in
echo "SERVERNAME=" >> ${diaspora_conf_private}
test -z "$ENVIRONMENT_URL" || grep -Eq '^ *ENVIRONMENT_URL=' ${diaspora_conf_private} || \
echo "ENVIRONMENT_URL=" >> ${diaspora_conf_private}
test -z "$diaspora_https" || grep -Eq '^ *diaspora_https=' ${diaspora_conf_private} || \
echo "diaspora_https=" >> ${diaspora_conf_private}
test -z "$ENVIRONMENT_REQUIRE_SSL" || grep -Eq '^ *ENVIRONMENT_REQUIRE_SSL=' ${diaspora_conf_private} || \
echo "ENVIRONMENT_REQUIRE_SSL=" >> ${diaspora_conf_private}
test -z "$diaspora_letsencrypt" || grep -Eq '^ *diaspora_letsencrypt=' ${diaspora_conf_private} || \
echo "diaspora_letsencrypt=" >> ${diaspora_conf_private}
test -z "$diaspora_letsencrypt_email" || grep -Eq '^ *diaspora_letsencrypt_email=' ${diaspora_conf_private} || \
echo "diaspora_letsencrypt_email=" >> ${diaspora_conf_private}
sed -e "s/^ *SERVERNAME=.*/SERVERNAME=\"$SERVERNAME\"/" \
-e "s/^ *ENVIRONMENT_URL=.*/ENVIRONMENT_URL=\"$ENVIRONMENT_URL\"/" \
-e "s/^ *diaspora_https=.*/diaspora_https=\"$diaspora_https\"/" \
-e "s/^ *ENVIRONMENT_REQUIRE_SSL=.*/ENVIRONMENT_REQUIRE_SSL=\"$ENVIRONMENT_REQUIRE_SSL\"/" \
-e "s/^ *diaspora_letsencrypt=.*/diaspora_letsencrypt=\"$diaspora_letsencrypt\"/" \
-e "s/^ *diaspora_letsencrypt_email=.*/diaspora_letsencrypt_email=\"$diaspora_letsencrypt_email\"/" \
< ${diaspora_conf_private} > ${diaspora_conf_private}.tmp
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment