Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Browse files

* secret_deploy Rake task

  • Loading branch information...
commit 0e12a2fb7b463098d562efe06385d0edeed2ec3b 1 parent ab4e790
@brandur authored
7 config/initializers/secret_token.rb.example
@@ -0,0 +1,7 @@
+# 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.
+Skine::Application.config.secret_token = '<secret token>'
9 lib/tasks/secret_deploy.rake
@@ -0,0 +1,9 @@
+desc 'Deploys a new secret token to config/initializers/secret_token.rb'
+task :secret_deploy do
+ secret = `rake secret`.strip
+ token_file = 'config/initializers/secret_token.rb'
+, 'w') do |file|
+ file.puts + ".example").gsub(/<secret token>/, secret)
+ end
+ puts "Wrote secret to #{token_file}"
Please sign in to comment.
Something went wrong with that request. Please try again.