mirror of
https://github.com/dehydrated-io/dehydrated.git
synced 2026-07-09 14:42:47 +02:00
Make location of domains.txt configurable (#204)
This is implemented by defining ${DOMAINS_TXT} in config.sh. If not
set in config.sh, it defaults to the previously (hard-coded) location,
which is ${BASEDIR}/domains.txt.
This commit is contained in:
committed by
Lukas Schauer
parent
2b50c72b75
commit
a3e5ed361b
@@ -30,6 +30,9 @@
|
|||||||
# Base directory for account key, generated certificates and list of domains (default: $SCRIPTDIR -- uses config directory if undefined)
|
# Base directory for account key, generated certificates and list of domains (default: $SCRIPTDIR -- uses config directory if undefined)
|
||||||
#BASEDIR=$SCRIPTDIR
|
#BASEDIR=$SCRIPTDIR
|
||||||
|
|
||||||
|
# File containing the list of domains to request certificates for (default: $BASEDIR/domains.txt)
|
||||||
|
#DOMAINS_TXT="${BASEDIR}/domains.txt"
|
||||||
|
|
||||||
# Output directory for challenge-tokens to be served by webserver or deployed in HOOK (default: $BASEDIR/.acme-challenges)
|
# Output directory for challenge-tokens to be served by webserver or deployed in HOOK (default: $BASEDIR/.acme-challenges)
|
||||||
#WELLKNOWN="${BASEDIR}/.acme-challenges"
|
#WELLKNOWN="${BASEDIR}/.acme-challenges"
|
||||||
|
|
||||||
|
|||||||
+7
-3
@@ -64,6 +64,7 @@ load_config() {
|
|||||||
LICENSE="https://letsencrypt.org/documents/LE-SA-v1.0.1-July-27-2015.pdf"
|
LICENSE="https://letsencrypt.org/documents/LE-SA-v1.0.1-July-27-2015.pdf"
|
||||||
CHALLENGETYPE="http-01"
|
CHALLENGETYPE="http-01"
|
||||||
CONFIG_D=
|
CONFIG_D=
|
||||||
|
DOMAINS_TXT=
|
||||||
HOOK=
|
HOOK=
|
||||||
HOOK_CHAIN="no"
|
HOOK_CHAIN="no"
|
||||||
RENEW_DAYS="30"
|
RENEW_DAYS="30"
|
||||||
@@ -117,6 +118,7 @@ load_config() {
|
|||||||
|
|
||||||
[[ -z "${ACCOUNT_KEY}" ]] && ACCOUNT_KEY="${BASEDIR}/private_key.pem"
|
[[ -z "${ACCOUNT_KEY}" ]] && ACCOUNT_KEY="${BASEDIR}/private_key.pem"
|
||||||
[[ -z "${ACCOUNT_KEY_JSON}" ]] && ACCOUNT_KEY_JSON="${BASEDIR}/private_key.json"
|
[[ -z "${ACCOUNT_KEY_JSON}" ]] && ACCOUNT_KEY_JSON="${BASEDIR}/private_key.json"
|
||||||
|
[[ -z "${DOMAINS_TXT}" ]] && DOMAINS_TXT="${BASEDIR}/domains.txt"
|
||||||
[[ -z "${WELLKNOWN}" ]] && WELLKNOWN="${BASEDIR}/.acme-challenges"
|
[[ -z "${WELLKNOWN}" ]] && WELLKNOWN="${BASEDIR}/.acme-challenges"
|
||||||
[[ -z "${LOCKFILE}" ]] && LOCKFILE="${BASEDIR}/lock"
|
[[ -z "${LOCKFILE}" ]] && LOCKFILE="${BASEDIR}/lock"
|
||||||
|
|
||||||
@@ -570,8 +572,10 @@ command_sign_domains() {
|
|||||||
if [[ -n "${PARAM_DOMAIN:-}" ]]; then
|
if [[ -n "${PARAM_DOMAIN:-}" ]]; then
|
||||||
DOMAINS_TXT="$(_mktemp)"
|
DOMAINS_TXT="$(_mktemp)"
|
||||||
printf -- "${PARAM_DOMAIN}" > "${DOMAINS_TXT}"
|
printf -- "${PARAM_DOMAIN}" > "${DOMAINS_TXT}"
|
||||||
elif [[ -e "${BASEDIR}/domains.txt" ]]; then
|
elif [[ -e "${DOMAINS_TXT}" ]]; then
|
||||||
DOMAINS_TXT="${BASEDIR}/domains.txt"
|
if [[ ! -r "${DOMAINS_TXT}" ]]; then
|
||||||
|
_exiterr "domains.txt found but not readable"
|
||||||
|
fi
|
||||||
else
|
else
|
||||||
_exiterr "domains.txt not found and --domain not given"
|
_exiterr "domains.txt not found and --domain not given"
|
||||||
fi
|
fi
|
||||||
@@ -771,7 +775,7 @@ command_help() {
|
|||||||
command_env() {
|
command_env() {
|
||||||
echo "# letsencrypt.sh configuration"
|
echo "# letsencrypt.sh configuration"
|
||||||
load_config
|
load_config
|
||||||
typeset -p CA LICENSE CHALLENGETYPE HOOK HOOK_CHAIN RENEW_DAYS ACCOUNT_KEY ACCOUNT_KEY_JSON KEYSIZE WELLKNOWN PRIVATE_KEY_RENEW OPENSSL_CNF CONTACT_EMAIL LOCKFILE
|
typeset -p CA LICENSE CHALLENGETYPE DOMAINS_TXT HOOK HOOK_CHAIN RENEW_DAYS ACCOUNT_KEY ACCOUNT_KEY_JSON KEYSIZE WELLKNOWN PRIVATE_KEY_RENEW OPENSSL_CNF CONTACT_EMAIL LOCKFILE
|
||||||
}
|
}
|
||||||
|
|
||||||
# Main method (parses script arguments and calls command_* methods)
|
# Main method (parses script arguments and calls command_* methods)
|
||||||
|
|||||||
Reference in New Issue
Block a user