mirror of
https://github.com/dehydrated-io/dehydrated.git
synced 2026-04-19 23:11:22 +02:00
Merge pull request #172 from bzed/master
Keep registration information as json.
This commit is contained in:
@@ -60,6 +60,7 @@ load_config() {
|
||||
HOOK_CHAIN="no"
|
||||
RENEW_DAYS="30"
|
||||
PRIVATE_KEY=
|
||||
PRIVATE_KEY_JSON=
|
||||
KEYSIZE="4096"
|
||||
WELLKNOWN=
|
||||
PRIVATE_KEY_RENEW="no"
|
||||
@@ -107,6 +108,7 @@ load_config() {
|
||||
[[ -d "${BASEDIR}" ]] || _exiterr "BASEDIR does not exist: ${BASEDIR}"
|
||||
|
||||
[[ -z "${PRIVATE_KEY}" ]] && PRIVATE_KEY="${BASEDIR}/private_key.pem"
|
||||
[[ -z "${PRIVATE_KEY_JSON}" ]] && PRIVATE_KEY_JSON="${BASEDIR}/private_key.json"
|
||||
[[ -z "${WELLKNOWN}" ]] && WELLKNOWN="${BASEDIR}/.acme-challenges"
|
||||
[[ -z "${LOCKFILE}" ]] && LOCKFILE="${BASEDIR}/lock"
|
||||
|
||||
@@ -172,9 +174,9 @@ init_system() {
|
||||
[[ ! -z "${CA_NEW_REG}" ]] || _exiterr "Certificate authority doesn't allow registrations."
|
||||
# If an email for the contact has been provided then adding it to the registration request
|
||||
if [[ -n "${CONTACT_EMAIL}" ]]; then
|
||||
signed_request "${CA_NEW_REG}" '{"resource": "new-reg", "contact":["mailto:'"${CONTACT_EMAIL}"'"], "agreement": "'"$LICENSE"'"}' > /dev/null
|
||||
signed_request "${CA_NEW_REG}" '{"resource": "new-reg", "contact":["mailto:'"${CONTACT_EMAIL}"'"], "agreement": "'"$LICENSE"'"}' > "${PRIVATE_KEY_JSON}"
|
||||
else
|
||||
signed_request "${CA_NEW_REG}" '{"resource": "new-reg", "agreement": "'"$LICENSE"'"}' > /dev/null
|
||||
signed_request "${CA_NEW_REG}" '{"resource": "new-reg", "agreement": "'"$LICENSE"'"}' > "${PRIVATE_KEY_JSON}"
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
Reference in New Issue
Block a user