-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Switching to heroku due to openshift 2 shutdown #173
- Loading branch information
Showing
2 changed files
with
33 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#!/bin/bash | ||
|
||
# Deploy certs files per https://devcenter.heroku.com/articles/ssl | ||
# Requires `heroku` CLI, and being logged in. | ||
|
||
# (Alternative: paid dynos (including Hobby) can simply enable https://devcenter.heroku.com/articles/automated-certificate-management) | ||
|
||
set -e -u -o pipefail | ||
set -x | ||
|
||
cd "$(dirname "$0")" | ||
|
||
# TODO: command-line parameters like rhc-set-certs.sh ? | ||
|
||
# One cert for all 4 domains. | ||
main_domain='mathdown.net' | ||
alt_domains=('www.mathdown.net' 'www.mathdown.com' 'mathdown.com') | ||
domains=("$main_domain" "${alt_domains[@]}") | ||
|
||
app=mathdown | ||
cert=certs/mathdown.net/cert.pem | ||
privkey=certs/mathdown.net/privkey.pem | ||
if heroku certs:info --app "$app"; then | ||
heroku certs:update --app "$app" "$cert" "$privkey" | ||
else | ||
heroku certs:add --app "$app" "$cert" "$privkey" | ||
fi | ||
|
||
curl --head "https://$main_domain/" | ||
|
||
echo 'To analyze certs & security:' | ||
printf ' https://www.ssllabs.com/ssltest/analyze.html?d=%s&latest\n' "${domains[@]}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters