Skip to content

Commit

Permalink
Remove default secret token.
Browse files Browse the repository at this point in the history
  • Loading branch information
xaviershay committed Jan 23, 2013
1 parent 923f751 commit 2d0d06c
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
1 change: 1 addition & 0 deletions README.textile
Expand Up @@ -18,6 +18,7 @@ h2. Quick Start
# On Debian-based systems: apt-get install libxml2-dev libxslt1-dev
# On Mac OS X: no action required

rake secret # Paste output into place in config/initializers/secret_token.rb
rake db:migrate
rake # Run tests
rails server # Start the server
Expand Down
18 changes: 13 additions & 5 deletions config/initializers/secret_token.rb
@@ -1,7 +1,15 @@
# Be sure to restart your server when you modify this file.

# Your secret key for verifying the integrity of signed cookies.
# If you change this key, all old signed cookies will become invalid!
# Make sure the secret is at least 30 characters and all random,
# no regular words or you'll be exposed to dictionary attacks.
Enki::Application.config.secret_token = '1481948abe0b49729e01200f00033b021cf2e7e1128d37da0cb637c1b661f99cf3bc163c5ba57f164c02254d9255591358c502ddeb1107fe2647af3c5bfa0c37'
if Rails.env.development? || Rails.env.test?
Enki::Application.config.secret_token = SecureRandom.hex(20)
else
# Your secret key for verifying the integrity of signed cookies.
# If you change this key, all old signed cookies will become invalid!
# Make sure the secret is at least 30 characters and all random,
# no regular words or you'll be exposed to dictionary attacks.
raise "Generate a secret with `rake secret` and paste it into `config/initializers/secret_token.rb`."

# If this is an open source project, DO NOT commit your secret to source
# control. Load it from ENV or a file that is git ignored (File.read)
Enki::Application.config.secret_token = 'paste your token here'
end

0 comments on commit 2d0d06c

Please sign in to comment.