Skip to content
This repository has been archived by the owner on Mar 6, 2020. It is now read-only.

Commit

Permalink
Handle Secrets With Environment Variables
Browse files Browse the repository at this point in the history
Enables deploying directly from the public repo securely, so long as you
specify the RAILS_SECRET_TOKEN environment variable on the target app
servers.

The development and test secret tokens are obviously garbage, but will
do for local testing.
  • Loading branch information
awood45 committed Aug 20, 2014
1 parent 67a0f4b commit 7c215ab
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 4 deletions.
5 changes: 1 addition & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,4 @@

# Ignore all logfiles and tempfiles.
/log/*.log
/tmp

# Do not include secrets.
/config/secrets.yml
/tmp
7 changes: 7 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ GEM
railties (>= 3.0, < 5.0)
thor (>= 0.14, < 2.0)
json (1.8.1)
kgio (2.9.2)
libv8 (3.16.14.3)
mail (2.5.4)
mime-types (~> 1.16)
Expand Down Expand Up @@ -76,6 +77,7 @@ GEM
activesupport (= 4.1.1)
rake (>= 0.8.7)
thor (>= 0.18.1, < 2.0)
raindrops (0.13.0)
rake (10.3.2)
rdoc (4.1.1)
json (~> 1.4)
Expand Down Expand Up @@ -116,6 +118,10 @@ GEM
uglifier (2.5.0)
execjs (>= 0.3.0)
json (>= 1.8.0)
unicorn (4.8.3)
kgio (~> 2.6)
rack
raindrops (~> 0.7)

PLATFORMS
ruby
Expand All @@ -134,3 +140,4 @@ DEPENDENCIES
therubyracer
turbolinks
uglifier (>= 1.3.0)
unicorn
8 changes: 8 additions & 0 deletions config/secrets.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
development:
secret_key_base: 'devdevdevdevdevdevdevdevdevdev'

test:
secret_key_base: 'testtesttesttesttesttesttesttest'

production:
secret_key_base: ENV['RAILS_SECRET_TOKEN']

0 comments on commit 7c215ab

Please sign in to comment.