From 43a2b720f67c9385dea9106224bb517f2b47be8d Mon Sep 17 00:00:00 2001 From: Valder Gallo Date: Wed, 27 Jun 2018 17:27:42 -0300 Subject: [PATCH] add staging url for develop --- scripts/util.sh | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/scripts/util.sh b/scripts/util.sh index d7b60e3..4585fa9 100644 --- a/scripts/util.sh +++ b/scripts/util.sh @@ -59,7 +59,18 @@ auto_enable_configs() { # EMAIL environment variable, to register the proper support email address. get_certificate() { echo "Getting certificate for domain $1 on behalf of user $2" + PRODUCTION_URL='https://acme-v01.api.letsencrypt.org/directory' + STAGING_URL='https://acme-staging.api.letsencrypt.org/directory' + + if [[ ! "${IS_STAGING}" = "1" ]]; then + LETSENCRYPT_URL=STAGING_URL + echo "Staging on" + else + LETSENCRYPT_URL=PRODUCTION_URL + echo "Production on" + fi + certbot certonly --agree-tos --keep -n --text --email $2 --server \ - https://acme-v01.api.letsencrypt.org/directory -d $1 --http-01-port 1337 \ + $LETSENCRYPT_URL -d $1 --http-01-port 1337 \ --standalone --standalone-supported-challenges http-01 --debug }