substrakt / letsencrypt-heroku

Make any Heroku application secure in just a couple of minutes.
https://substrakt.com/heroku-ssl-me-weve-come-a-long-way/
MIT License
524 stars 19 forks source link

Instruction clarifications #8

Closed markcerqueira closed 8 years ago

markcerqueira commented 8 years ago

Thanks for setting this up. Really excited to get this up and running. I'm running into some snags following your instructions and was hoping you could clarify a bit.

  1. The setup instructions ask for a Heroku OAuth key. Is this the API Key found in settings on Heroku? I'm guessing not.
  2. auth_token is the value of ENV['AUTH_TOKEN'] - Perhaps clarify that is is set on the new project that one sets up during the setup process. I (foolishly) thought it meant I needed to add this to the project I wanted to add SSL to.
  3. Hitting the endpoint per instructions gives me a 404. The URL I hit is: http://chuckpad-social-letsencrypt.herokuapps.com/certificate_generation/new/chuckpad.io?subdomains=www&debug=0&app_name=chuckpad-social&auth_token={AUTH_TOKEN_REMOVED}

Thank you!

maxehmookau commented 8 years ago

Hi there!

Bear in mind that we're still in alpha but I think all of these issues can be sorted :)

$ heroku plugins:install heroku-cli-oauth
$ heroku authorizations:create -d "letsencrypt-oauth-token"

This should then generate a code for you to use for that value. You can revoke these tokens at any time if they're compromised. Bear in mind that these tokens are valid for any project that your current user has access to so it may be desirable to create an OAuth token for a special 'robot' user. I'll leave this up to you.

Let me know if you've got any more questions and thanks for the feedback!

markcerqueira commented 8 years ago

Totally understandable on alpha and thank you for the lightning fast reply. I'll give it another try (tomorrow as it's getting late here) and I'll report back!

Thanks again! :)

maxehmookau commented 8 years ago

👍 Looking forward to it

maxehmookau commented 8 years ago

Hey @markcerqueiram, Was wondering if you managed to get this up and running for you?

markcerqueira commented 8 years ago

HI @maxehmookau! Thanks for following up and apologies for not getting to this sooner.

Got a little farther: getting the status URL when I hit the endpoint, but when I check that status page it says I'm not authenticated.

Any ideas what I could be doing wrong?

lustrousgorilla commented 8 years ago

@maxehmookau: I'm extraordinarily appreciative for your work on this, but I'm experiencing the exact same thing as @markcerqueira.

Also, if you really want to make these instructions idiot-proof, it might be worth adding a line with the curl command to generate the specified HTTP request.

markcerqueira commented 8 years ago

@lustrousgorilla - once I get it working I'm planning on opening a PR with some changes to the README to help out idiots like myself! :)

maxehmookau commented 8 years ago

Thanks @markcerqueira, that would be really helpful.

I agree with both of you, I could do with making the README much more clear. If @markcerqueira can open a PR with a few changes I'd be happy to merge that in to make it easier for others to use.

jwsloan commented 8 years ago

@maxehmookau Thank you for making this! Unfortunately I'm getting the same error as @markcerqueira when I hit the status page. Any ideas on what would cause that?

maxehmookau commented 8 years ago

hi @jwsloan.

Judging by this thread, I think I'm going to have to rewrite the README 😂

So if you're getting an unauthorized error, you need to make sure the auth_token query parameter is set. It should be equal to whatever the AUTH_TOKEN environment variable is.

If you used the 'deploy to heroku' button, this code is generated automatically and randomly. If you didn't use the deploy to Heroku button, you just need to define an AUTH_TOKEN variable which should just be some sort of secret key. (Obviously in production, the longer and more complex, the better!)

On heroku, you can grab that value by using heroku config:get AUTH_TOKEN.

Does that help at all?

maxehmookau commented 8 years ago

I've updated the README this afternoon with a few bits and bobs. Hopefully that should make things clearer. Feel free to open a new issue if not though.