从GitHub隐藏我的敏感信息(如密码) [英] Hiding my sensitive information (e.g. password) from github

查看:1230
本文介绍了从GitHub隐藏我的敏感信息(如密码)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚成立设计(轨验证插件)在注册后发送一封确认邮件。这涉及到我的推杆下面进入我的environment.rb文件中:

I just set up Devise (rails authentication plugin) to send a confirmation email upon sign up. This involved my putting the following into my environment.rb file:

ActionMailer::Base.delivery_method = :smtp
ActionMailer::Base.smtp_settings = {
   :tls => true,
   :address => "smtp.gmail.com",
   :port => 587,
   :domain => "gmail.com",
   :authentication => :login,
   :user_name => "[my email]",
   :password => "[my pass]"
 }

我显然不希望推动这个了[我的通行证]只是坐在那里GitHub上。有没有一个标准的做法在这里?

I obviously don't want to push this up to github with [my pass] just sitting there. Is there a standard practice here?

推荐答案

该标准是把你的配置设置,其中不包括在你的回购1 YAML文件。

The standard is to put your configuration settings in one YAML file which isn't included in your repo.

然后您只要从它那里得到的数据。

Then you simply get the data from it.

检查Railscast#85 YAML配置文件看到它在行动

Check Railscast "#85 YAML Configuration File" to see it in action.

这篇关于从GitHub隐藏我的敏感信息(如密码)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆