mirror of
https://github.com/dehydrated-io/dehydrated.git
synced 2026-07-03 11:41:41 +02:00
add CONTACT_EMAIL option on registration
This commit is contained in:
committed by
Lukas Schauer
parent
12c566b1d6
commit
ea5b70a3d9
@@ -17,3 +17,7 @@
|
|||||||
|
|
||||||
# create new private key for each csr (yes|no)
|
# create new private key for each csr (yes|no)
|
||||||
#PRIVATE_KEY_RENEW=no
|
#PRIVATE_KEY_RENEW=no
|
||||||
|
|
||||||
|
# email to use during the registration
|
||||||
|
#CONTACT_EMAIL=
|
||||||
|
|
||||||
|
|||||||
+7
-1
@@ -16,6 +16,7 @@ SCRIPTDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
|||||||
BASEDIR="${SCRIPTDIR}"
|
BASEDIR="${SCRIPTDIR}"
|
||||||
OPENSSL_CNF="$(openssl version -d | cut -d'"' -f2)/openssl.cnf"
|
OPENSSL_CNF="$(openssl version -d | cut -d'"' -f2)/openssl.cnf"
|
||||||
ROOTCERT="lets-encrypt-x1-cross-signed.pem"
|
ROOTCERT="lets-encrypt-x1-cross-signed.pem"
|
||||||
|
CONTACT_EMAIL=
|
||||||
|
|
||||||
# If exists load config from same directory as this script
|
# If exists load config from same directory as this script
|
||||||
if [[ -e "${BASEDIR}/config.sh" ]]; then
|
if [[ -e "${BASEDIR}/config.sh" ]]; then
|
||||||
@@ -250,7 +251,12 @@ thumbprint="$(printf '%s' "$(printf '%s' '{"e":"'"${pubExponent64}"'","kty":"RSA
|
|||||||
# If we generated a new private key in the step above we have to register it with the acme-server
|
# If we generated a new private key in the step above we have to register it with the acme-server
|
||||||
if [[ "${register}" = "1" ]]; then
|
if [[ "${register}" = "1" ]]; then
|
||||||
echo "+ Registering account key with letsencrypt..."
|
echo "+ Registering account key with letsencrypt..."
|
||||||
signed_request "${CA}/acme/new-reg" '{"resource": "new-reg", "agreement": "'"$LICENSE"'"}' > /dev/null
|
# if an email for the contact has been provided then adding it to the registration request
|
||||||
|
if [ -n "${CONTACT_EMAIL}" ]; then
|
||||||
|
signed_request "${CA}/acme/new-reg" '{"resource": "new-reg", "contact":["mailto:'"${CONTACT_EMAIL}"'"], "agreement": "'"$LICENSE"'"}' > /dev/null
|
||||||
|
else
|
||||||
|
signed_request "${CA}/acme/new-reg" '{"resource": "new-reg", "agreement": "'"$LICENSE"'"}' > /dev/null
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ -e "${BASEDIR}/domains.txt" ]]; then
|
if [[ -e "${BASEDIR}/domains.txt" ]]; then
|
||||||
|
|||||||
Reference in New Issue
Block a user