substrakt / letsencrypt-heroku
- суббота, 23 июля 2016 г. в 03:12:28
Ruby
Make any Heroku application secure in just a couple of minutes.
Let's make everything secure.
With the advent of free SSL and Heroku finally offering free SSL endpoints, it's about time we made it ridiculously easy to get an SSL cert for any Heroku application and keep it up to date.
We wrote a blog post about it here
This is alpha software. It may work, or it may not. We use it in production at Substrakt but your milage may vary until 1.0.
Created by Substrakt.
As we're currently in alpha, there are some severe limitations.
http-sni
is not supported in private spaces, yet. This shouldn't be a problem for 99% of applications.http-sni
is beta. If it changes or is removed, this application will simply cease to work.GET certificate_generation/new/{domain_name}?subdomains={subdomains}&debug={0/1}&app_name={heroku_app_name}&auth_token={auth_token}
Parameters:
domain_name
is the domain name without subdomains. (e.g. google.com
== Good. www.google.com
== Bad.)subdomains
is a comma delimited list of subdomains to cover. Usually this is just www
, but could also be anything else such as www,dishwasher,git,purple
.debug
is 1
or 0
depending if this is a test or not. When debug is on, non-valid certificates are generated.heroku_app_name
is the name of the application on Heroku.auth_token
is the value of ENV['AUTH_TOKEN']
.This will start the process in the background and output something like this:
{
status_path: "http://localhost:5000/certificate_generation/3911dd66aade4cfdf9dd1d0e1cebde87"
}
That API URL will give you updates as to the certificate generation process. You should poll this to check how it's going. Redis is used as a store for status updates as well as the backend for Resque.
The output looks something like this:
{
token: "3911dd66aade4cfdf9dd1d0e1cebde87",
status: "success",
error: null,
domain: "substrakt.com",
subdomains: [
"www",
"www3"
],
message: "Done"
}
That's it.
Pull requests and issues are very much welcome at this early stage.