Thanks for all the suggestions. I ended up going with a modified
version of the "Heroku way", which seems to provide the most
flexibility when deploying.

Specifically, I'm using ENV variables for secrets, like this chunk in
environments/production.rb:

  ActionMailer::Base.smtp_settings = {
    :address => "smtp.sendgrid.net",
    :port => 25,
    :authentication => :plain,
    :user_name => ENV['SENDGRID_USER'],
    :domain    => ENV['SENDGRID_DOMAIN'],
    :password  => ENV['SENDGRID_PASSWORD'],
  }

I added a shim for cases (like nginx + Passenger) where passing ENV
variables is unwieldy. It's just another file included in
application.rb:

  secrets_file = File.expand_path('../too_many_secrets', __FILE__)
  require secrets_file if File.exists?(secrets_file + '.rb')

That way I can include a .template.rb file next door as a list of
secrets the app needs to know about.

Comments and refinements are welcome. Thanks again for the suggestions.

~chris

-- 
SD Ruby mailing list
[email protected]
http://groups.google.com/group/sdruby

Reply via email to