mirror of
https://github.com/dehydrated-io/dehydrated.git
synced 2026-03-19 15:54:01 +01:00
prepared future migration to new acmev2 endpoint
This commit is contained in:
14
dehydrated
14
dehydrated
@@ -111,6 +111,7 @@ load_config() {
|
||||
|
||||
# Default values
|
||||
CA="https://acme-v01.api.letsencrypt.org/directory"
|
||||
OLDCA=
|
||||
CERTDIR=
|
||||
ACCOUNTDIR=
|
||||
CHALLENGETYPE="http-01"
|
||||
@@ -209,9 +210,20 @@ load_config() {
|
||||
# Check BASEDIR and set default variables
|
||||
[[ -d "${BASEDIR}" ]] || _exiterr "BASEDIR does not exist: ${BASEDIR}"
|
||||
|
||||
# Create new account directory or symlink to account directory from old CA
|
||||
CAHASH="$(echo "${CA}" | urlbase64)"
|
||||
[[ -z "${ACCOUNTDIR}" ]] && ACCOUNTDIR="${BASEDIR}/accounts"
|
||||
mkdir -p "${ACCOUNTDIR}/${CAHASH}"
|
||||
if [[ ! -e "${ACCOUNTDIR}/${CAHASH}" ]]; then
|
||||
OLDCAHASH="$(echo "${OLDCA}" | urlbase64)"
|
||||
mkdir -p "${ACCOUNTDIR}"
|
||||
if [[ -n "${OLDCA}" ]] && [[ -e "${ACCOUNTDIR}/${OLDCAHASH}" ]]; then
|
||||
echo "! Reusing account from ${OLDCA}"
|
||||
ln -s "${OLDCAHASH}" "${ACCOUNTDIR}/${CAHASH}"
|
||||
else
|
||||
mkdir "${ACCOUNTDIR}/${CAHASH}"
|
||||
fi
|
||||
fi
|
||||
|
||||
[[ -f "${ACCOUNTDIR}/${CAHASH}/config" ]] && . "${ACCOUNTDIR}/${CAHASH}/config"
|
||||
ACCOUNT_KEY="${ACCOUNTDIR}/${CAHASH}/account_key.pem"
|
||||
ACCOUNT_KEY_JSON="${ACCOUNTDIR}/${CAHASH}/registration_info.json"
|
||||
|
||||
@@ -24,6 +24,13 @@
|
||||
# Path to certificate authority (default: https://acme-v01.api.letsencrypt.org/directory)
|
||||
#CA="https://acme-v01.api.letsencrypt.org/directory"
|
||||
|
||||
# Path to old certificate authority
|
||||
# Set this value to your old CA value when upgrading from ACMEv1 to ACMEv2 under a different endpoint.
|
||||
# If dehydrated detects an account-key for the old CA it will automatically reuse that key
|
||||
# instead of registering a new one.
|
||||
# default: <unset>
|
||||
#OLDCA=
|
||||
|
||||
# Which challenge should be used? Currently http-01 and dns-01 are supported
|
||||
#CHALLENGETYPE="http-01"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user