Commit 6b01ae23 authored by Aral Balkan's avatar Aral Balkan

Added -s commandline option to use the Let’s Encrypt staging server (default...

Added -s commandline option to use the Let’s Encrypt staging server (default is to use the live server). Closes #1.
parent f7ca9777
......@@ -62,9 +62,28 @@ echo -e "\n┌──────────────────────
echo -e "│ Better Builder Deployment Server Setup │"
echo -e "└────────────────────────────────────────┘\n"
# Check for commandline arguments.
# -s: Use Let’s Encrypt *staging server*. Useful when testing the
# deployment script so that we don’t hit the rate limits.
letsEncryptServer='default'
while getopts ":s" opt; do
case $opt in
f)
echo -e "Using Let’s Encrypt *staging* server.\n" >&2
letsEncryptServer='staging'
;;
\?)
echo "Invalid option: -$OPTARG" >&2
;;
esac
done
# Configuration options.
echo -e "1. Configuration options (for better.fyi, all of these have the correct defaults).\n"
#
#
# Prompt for configuration (With defaults set for better.fyi.)
# Note: defaults are Bash 3-compatible on purpose.
#
......@@ -199,6 +218,11 @@ sudo dokku plugin:install https://github.com/dokku/dokku-letsencrypt.git
# Set up SSL for our app.
dokku letsencrypt:email $builderDomain $letsEncryptEmailAddress
# Set the server to use: 'staging' (-s commandline argument) or 'default'
dokku letsencrypt:server $builderDomain $letsEncryptServer
# Get the TLS certificate.
dokku letsencrypt $builderDomain
# And, finally, set up automatic reneweals of the SSL certificate
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment