diff --git a/config/initializers/secret_token.rb b/config/initializers/secret_token.rb deleted file mode 100644 index 856a37a6..00000000 --- a/config/initializers/secret_token.rb +++ /dev/null @@ -1,12 +0,0 @@ -# Be sure to restart your server when you modify this file. - -# Your secret key is used 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. -# You can use `rake secret` to generate a secure secret key. - -# Make sure your secret_key_base is kept private -# if you're sharing your code publicly. -Rails.application.config.secret_key_base = SITE_CONFIG["secret_token"] || SecureRandom.hex(64) diff --git a/config/secrets.yml b/config/secrets.yml new file mode 100644 index 00000000..9aec537e --- /dev/null +++ b/config/secrets.yml @@ -0,0 +1,8 @@ +development: + secret_key_base: <%= SITE_CONFIG["secret_token"] || SecureRandom.hex(64) %> + +test: + secret_key_base: <%= SITE_CONFIG["secret_token"] || SecureRandom.hex(64) %> + +production: + secret_key_base: <%= SITE_CONFIG["secret_token"] || SecureRandom.hex(64) %> \ No newline at end of file diff --git a/config/site.yml.tmpl b/config/site.yml.tmpl index b024a885..9ef1677b 100644 --- a/config/site.yml.tmpl +++ b/config/site.yml.tmpl @@ -23,10 +23,10 @@ secure_cookies: false # Make sure the secret is at least 30 characters and all random, # no regular words or you'll be exposed to dictionary attacks. # -# if you want a nice random key, run this in rails console and copy-and-paste -# the result: +# if you want a nice random key, run this from the tracks directory and +# copy-and-paste the result: # -# SecureRandom.hex(64) +# rake secret # secret_token: "change-me"