From 3876de9cf270f05885105d1d9ad7dd7215098d8a Mon Sep 17 00:00:00 2001 From: Michael Sofaer Date: Sat, 6 Nov 2010 13:57:06 -0700 Subject: [PATCH] Set the secret token --- chef/cookbooks/common/recipes/main.rb | 6 ++++++ chef/cookbooks/common/templates/default/secret_token.rb.erb | 1 + 2 files changed, 7 insertions(+) create mode 100644 chef/cookbooks/common/templates/default/secret_token.rb.erb diff --git a/chef/cookbooks/common/recipes/main.rb b/chef/cookbooks/common/recipes/main.rb index cf1322268..ec5654333 100644 --- a/chef/cookbooks/common/recipes/main.rb +++ b/chef/cookbooks/common/recipes/main.rb @@ -1,2 +1,8 @@ include_recipe "common::iptables" include_recipe "common::daemontools" + +require 'active_support' +template "/usr/local/app/diaspora/config/initializers/secret_token.rb" do + source "secret_token.rb.erb" + variables :secret_token => ActiveSupport::SecureRandom.hex(40) +end diff --git a/chef/cookbooks/common/templates/default/secret_token.rb.erb b/chef/cookbooks/common/templates/default/secret_token.rb.erb new file mode 100644 index 000000000..ef4543b33 --- /dev/null +++ b/chef/cookbooks/common/templates/default/secret_token.rb.erb @@ -0,0 +1 @@ +Rails.application.config.secret_token = '<%= @secret_token %>'