Commit 9baf3532 authored by Daniel Beyer's avatar Daniel Beyer

Respect configured BASEDIR for default values

If BASEDIR is set in config.sh, this does not modify the (default) values
of either PRIVATE_KEY, WELLKNOWN or LOCKFILE. One needs to manually specify
those three config variables in config.sh, if a different BASEDIR
should be used by letsencrypt.sh.

This commit makes letsencrypt.sh fully aware of a configured BASEDIR.
parent 23b0ef5a
......@@ -49,14 +49,14 @@ load_config() {
CHALLENGETYPE="http-01"
HOOK=
RENEW_DAYS="30"
PRIVATE_KEY="${BASEDIR}/private_key.pem"
PRIVATE_KEY=
KEYSIZE="4096"
WELLKNOWN="${BASEDIR}/.acme-challenges"
WELLKNOWN=
PRIVATE_KEY_RENEW="no"
KEY_ALGO=rsa
OPENSSL_CNF="$(openssl version -d | cut -d'"' -f2)/openssl.cnf"
CONTACT_EMAIL=
LOCKFILE="${BASEDIR}/lock"
LOCKFILE=
if [[ -z "${CONFIG:-}" ]]; then
echo "#" >&2
......@@ -77,6 +77,10 @@ load_config() {
# Check BASEDIR and set default variables
[[ -d "${BASEDIR}" ]] || _exiterr "BASEDIR does not exist: ${BASEDIR}"
[[ -z "${PRIVATE_KEY}" ]] && PRIVATE_KEY="${BASEDIR}/private_key.pem"
[[ -z "${WELLKNOWN}" ]] && WELLKNOWN="${BASEDIR}/.acme-challenges"
[[ -z "${LOCKFILE}" ]] && LOCKFILE="${BASEDIR}/lock"
[[ -n "${PARAM_HOOK:-}" ]] && HOOK="${PARAM_HOOK}"
[[ -n "${PARAM_CHALLENGETYPE:-}" ]] && CHALLENGETYPE="${PARAM_CHALLENGETYPE}"
[[ -n "${PARAM_KEY_ALGO:-}" ]] && KEY_ALGO="${PARAM_KEY_ALGO}"
......
Markdown is supported
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