2

I've been struggling with this question: how can I hide passwords from my source code, that everyone can see on github, for example:

ActionMailer::Base.smtp_settings = {
 :address              => "smtp.gmail.com",
 :port                 => 587,
 :user_name            => my_user_name,
 :password             => my_password,
 :authentication       => 'plain',
 :enable_starttls_auto => true,
 :domain               => 'gmail.com'  
}
Nikola
  • 817
  • 13
  • 19
Matheus Lima
  • 2,103
  • 3
  • 31
  • 49

1 Answers1

3

Use environment variables, for easy setup you could check out the Figaro gem:

https://github.com/laserlemon/figaro

Jakob W
  • 3,347
  • 19
  • 27