pixielabs / letsencrypt-rails-heroku

Automatic LetsEncrypt SSL certificates in your Rails app on Heroku.
MIT License
220 stars 33 forks source link

Block initializer for configs vars doesn't work? #53

Closed lasernite closed 6 years ago

lasernite commented 7 years ago

I ended up using environment variables which work fine, but I'm curious why configuring the variables in an initializer doesn't work.

The gem will throw an error, letsencrypt-rails-heroku is configured incorrectly. Are you missing an environment variable or other configuration? You should have a heroku_token, heroku_app and acme_email configured either via a `Letsencrypt.configure` block in an initializer or as environment variables.

But putting a block like below in an initializer doesn't seem to actually work?

Letsencrypt.configure do |config|
  config.acme_domain = "domain"
  config.acme_email = "email"
  config.heroku_token = "token"
  config.heroku_app = "app"
end

Perhaps this is a Rails 5 specific bug, or I'm doing something silly syntactically.

Thanks for the useful gem!

jalada commented 7 years ago

Thanks @lasernite! I must admit we don't check the initializer block too carefully to make sure it continues to work, we'll take a look :)

jalada commented 7 years ago

Hi @lasernite. I set up a fresh Rails 5 app, added an initializer, and it seemed to work OK...Could there be something different about your app set up?