Commit 72bb1d5e8005d9f0c87b78075cc6f072382910ff

Authored by Dan Croak
1 parent 20905d8c

reverting to CHANGE* + script/create_project approach for s3 buckets and session

config/initializers/session_store.rb
@@ -5,8 +5,8 @@ @@ -5,8 +5,8 @@
5 # Make sure the secret is at least 30 characters and all random, 5 # Make sure the secret is at least 30 characters and all random,
6 # no regular words or you'll be exposed to dictionary attacks. 6 # no regular words or you'll be exposed to dictionary attacks.
7 ActionController::Base.session = { 7 ActionController::Base.session = {
8 - :session_key => ENV['SESSION_KEY'] || "_development_session",  
9 - :secret => ENV['SESSION_SECRET'] || "acae512910d591e2ab92d82781abc8f52bc723a8cc2124225a89b9e2ed05de875d2ec49c10a585bfcf40f6bfc1385b22578d9cbc7213a2cf61a9a900eaf57cfc" 8 + :session_key => "_CHANGEME_session",
  9 + :secret => "CHANGESESSION"
10 } 10 }
11 11
12 # Use the database for sessions instead of the cookie-based default, 12 # Use the database for sessions instead of the cookie-based default,
@@ -13,11 +13,13 @@ @@ -13,11 +13,13 @@
13 development: &default 13 development: &default
14 access_key_id: <%= ENV['S3_KEY'] %> 14 access_key_id: <%= ENV['S3_KEY'] %>
15 secret_access_key: <%= ENV['S3_SECRET'] %> 15 secret_access_key: <%= ENV['S3_SECRET'] %>
16 - bucket: <%= ENV['S3_BUCKET'] %> 16 + bucket: CHANGME_development
17 17
18 test: 18 test:
19 <<: *default 19 <<: *default
  20 + bucket: CHANGME_test
20 21
21 production: 22 production:
22 <<: *default 23 <<: *default
  24 + bucket: CHANGME_production
23 25
lib/tasks/heroku.rake
@@ -14,9 +14,8 @@ namespace :heroku do @@ -14,9 +14,8 @@ namespace :heroku do
14 vars = {} 14 vars = {}
15 15
16 if ask_yn("Use Amazon S3 for Paperclip uploads?") 16 if ask_yn("Use Amazon S3 for Paperclip uploads?")
17 - vars[:S3_KEY] = ask_value('S3 key') 17 + vars[:S3_KEY] = ask_value('S3 key')
18 vars[:S3_SECRET] = ask_value('S3 secret key') 18 vars[:S3_SECRET] = ask_value('S3 secret key')
19 - vars[:S3_BUCKET] = ask_value('Name of S3 bucket to store assets in')  
20 end 19 end
21 20
22 if ask_yn("Use Google Analytics to track web traffic?") 21 if ask_yn("Use Google Analytics to track web traffic?")
@@ -28,14 +27,10 @@ namespace :heroku do @@ -28,14 +27,10 @@ namespace :heroku do
28 end 27 end
29 28
30 if ask_yn("Use GMail to send outgoing emails?") 29 if ask_yn("Use GMail to send outgoing emails?")
31 - vars[:GMAIL_EMAIL] = ask_value('GMail email address') 30 + vars[:GMAIL_EMAIL] = ask_value('GMail email address')
32 vars[:GMAIL_PASSWORD] = ask_value('GMail password') 31 vars[:GMAIL_PASSWORD] = ask_value('GMail password')
33 end 32 end
34 33
35 - puts "Generating a session key and session secret"  
36 - vars[:SESSION_KEY] = "_#{ActiveSupport::SecureRandom.hex(6)}_session"  
37 - vars[:SESSION_SECRET] = ActiveSupport::SecureRandom.hex(64)  
38 -  
39 puts "Setting all config vars on Heroku app" 34 puts "Setting all config vars on Heroku app"
40 vars_string = vars.map { |k,v| "#{k}='#{v}'" }.join(' ') 35 vars_string = vars.map { |k,v| "#{k}='#{v}'" }.join(' ')
41 sh "heroku config:add #{vars_string}" 36 sh "heroku config:add #{vars_string}"