나는 사용자가 등록 할 때 환영 이메일을 보내는 매우 간단한 Rails 앱을 가지고있다. 나는 메시지를 보내 내 Gmail 계정을 사용하고, 아래와 같이 나는 응용 프로그램에 저장 내 Gmail 계정에 대한 암호를 가지고 :git 저장소에서 비밀번호를 숨기는 방법은 무엇입니까?
application.rb
require File.expand_path('../boot', __FILE__)
require 'rails/all'
if defined?(Bundler)
# If you precompile assets before deploying to production, use this line
Bundler.require(*Rails.groups(:assets => %w(development test)))
# If you want your assets lazily compiled in production, use this line
# Bundler.require(:default, :assets, Rails.env)
end
ENV.update YAML.load(File.read(File.expand_path('../application.yml', __FILE__)))
module TestMailApp
class Application < Rails::Application
config.action_mailer.smtp_settings = {
:address => "smtp.gmail.com",
:port => 587,
:domain => "my address",
:user_name => "my_gmail_name",
:password => ENV["MAIL_PASSWORD"],
:authentication => :plain,
:enable_starttls_auto => true
}
config.action_mailer.default_url_options = {
:host => "my address"
}
application.yml
MAIL_PASSWORD: "my_password"
내 git 저장소의 application.yml 파일에 저장된 비밀번호를 숨기고 싶습니다. 내 gitignore 파일에 application.yml을 추가하려고했지만 내 응용 프로그램이 충돌합니다.
내 앱이 여전히 작동하고 개인용 저장소에 앱을 넣지 않아도되도록이 비밀번호를 내 git 저장소에서 숨기려면 어떻게해야하나요?
duplicate of duplicates =] http://stackoverflow.com/questions/3605866/hide-password-when-checking-config-file-in-git (또한, off of stackoverflow : http://ejohn.org/) 블로그/유지 - 패스워드 - 소스 제어 /) –
[this] (http://stackoverflow.com/questions/15978253/rails-how-to-store-passwords-for-other-services) –
'application.yml'을 추가하는 것은 저에게 당신이해야 할 일처럼 보입니다. 그 앱이 어떻게 깨지나요? 나는 그 앱이 git repo에 완전히 불가 지론이라고 생각했을 것이다 ... –