security - What tools do you use to avoid accidently pushing private information to a github repo on a rails project? -


are there tools use scrub project before pushing public github repo. how maintain private settings, while pushing source code public repo? best practice?

i don't keep database.yml in git. write in cap setup task. email addresses , other things, read them @ app initialize file in file-system. again, not under source code management , written shared directory during cap setup.

here's sample:

namespace :deploy   task :start ; end   task :stop ; end    task :setup     run <<-cmd       mkdir -p -m 775 #{release_path} #{shared_path}/system #{shared_path}/media &&       mkdir -p -m 777 #{shared_path}/log &&       mkdir -p -m 777 #{shared_path}/pids &&       mkdir -p #{deploy_to}/#{shared_dir}/config     cmd    end    require 'erb'    after deploy:setup     db_config = erb.new <<-eof production:   adapter: mysql2   database: my_fine_database   host: 127.0.0.1   username: database_user   password: database_password eof      email_config = erb.new <<-eof ---  :user_name: me@mydomain.com :password: verysecret :port: 25 :address: mydomain.com :domain: mydomain.com :authentication: :login eof      put db_config.result, "#{shared_path}/config/database.yml"     put email_config.result, "#{shared_path}/config/creds.yml"   end 

and in environment.rb, put:

credentials = file.join(rails.root, 'config/creds.yml')  actionmailer::base.smtp_settings = yaml.load(file.open(credentials)) if file.exists?(credentials) 

what other sensitive information might storing?


Comments

Popular posts from this blog

apache - Add omitted ? to URLs -

redirect - bbPress Forum - rewrite to wwww.mysite prohibits login -

php - How can I stop spam on my custom forum/blog? -