Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

moving session secret out of git repo

  • Loading branch information...
commit 1967a7e5cb3307b3ece68699a69f3627d7643d91 1 parent 6b12584
@ryanb authored
View
1  .gitignore
@@ -4,3 +4,4 @@ tmp/**/*
database.yml
app_config.yml
public/assets
+config/session_secret.txt
View
2  config/deploy.rb
@@ -28,6 +28,7 @@
task :symlink_extras do
run "ln -nfs #{shared_path}/config/database.yml #{release_path}/config/database.yml"
run "ln -nfs #{shared_path}/config/app_config.yml #{release_path}/config/app_config.yml"
+ run "ln -nfs #{shared_path}/config/session_secret.txt #{release_path}/config/session_secret.txt"
run "ln -nfs #{shared_path}/db/production.sqlite3 #{release_path}/db/production.sqlite3"
run "ln -nfs #{shared_path}/assets #{release_path}/public/assets"
end
@@ -40,6 +41,7 @@
run "mkdir #{shared_path}/db/sphinx"
put File.read("config/database.example.yml"), "#{shared_path}/config/database.yml"
put File.read("config/app_config.example.yml"), "#{shared_path}/config/app_config.yml"
+ put File.read("config/session_secret.example.txt"), "#{shared_path}/config/session_secret.txt"
puts "Now edit the config files and fill assets folder in #{shared_path}."
end
View
4 config/initializers/session_store.rb
@@ -5,8 +5,8 @@
# Make sure the secret is at least 30 characters and all random,
# no regular words or you'll be exposed to dictionary attacks.
ActionController::Base.session = {
- :key => '_dailystamp_session',
- :secret => 'eb56cbf5d5e3b0d7c8de4271c428534b2dd3ce59f13488cb60abab274eee8b5be08eeae2d0aedbc40d4da3985f91c56a0a1651775c0a98aa75f3f9a239f66df4'
+ :key => '_dailystamp_session2',
+ :secret => File.read(Rails.root.join("config", "session_secret.txt")).strip
}
# Use the database for sessions instead of the cookie-based default,
View
1  config/session_secret.example.txt
@@ -0,0 +1 @@
+eb56cbf5d5e3b0d7c8de4271c428534b2dd3ce59f13488cb60abab274eee8b5be08eeae2d0aedbc40d4da3985f91c56a0a1651775c0a98aa75f3f9a239f66df4
Please sign in to comment.
Something went wrong with that request. Please try again.