aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib/rails/generators/rails
diff options
context:
space:
mode:
authorschneems <richard.schneeman@gmail.com>2014-01-13 14:01:24 -0600
committerschneems <richard.schneeman@gmail.com>2014-01-13 14:31:43 -0600
commitb9095ec95c38e17425eef26018aeb962e96c323f (patch)
treeee46eb1411e056bc1d880eed1f622ddf6a36672a /railties/lib/rails/generators/rails
parente0a521cfcd13e4d1f0ae8ab96004289e1c020f71 (diff)
downloadrails-b9095ec95c38e17425eef26018aeb962e96c323f.tar.gz
rails-b9095ec95c38e17425eef26018aeb962e96c323f.tar.bz2
rails-b9095ec95c38e17425eef26018aeb962e96c323f.zip
Favor canonical environment variables for secrets
Prefixing an environment variable with `RAILS_` should be used when there is otherwise a conflict, such as `RAILS_ENV` or if it is being used for a very Rails specific value. If we remove the prefix of `RAILS_` in the case of `RAILS_SECRET_KEY_BASE` then we can push for a pseudo standard among other frameworks that will accept a common environment key `SECRET_KEY_BASE` to keep your app secure. This is beneficial for containerized deployments such as docker, Heroku, etc. So that the container need to know one less thing about your app (it can just set it no-matter what language or framework you are using). This change also allows the defaults to be consistent with the way the secret key is accessed so `secrets.secret_key_base` is aliased to `SECRET_KEY_BASE` instead of `RAILS_SECRET_KEY_BASE`.
Diffstat (limited to 'railties/lib/rails/generators/rails')
-rw-r--r--railties/lib/rails/generators/rails/app/templates/config/secrets.yml2
1 files changed, 1 insertions, 1 deletions
diff --git a/railties/lib/rails/generators/rails/app/templates/config/secrets.yml b/railties/lib/rails/generators/rails/app/templates/config/secrets.yml
index 6e2c45e119..b2669a0f79 100644
--- a/railties/lib/rails/generators/rails/app/templates/config/secrets.yml
+++ b/railties/lib/rails/generators/rails/app/templates/config/secrets.yml
@@ -19,4 +19,4 @@ test:
# Do not keep production secrets in the repository,
# instead read values from the environment.
production:
- secret_key_base: <%%= ENV["RAILS_SECRET_KEY_BASE"] %>
+ secret_key_base: <%%= ENV["SECRET_KEY_BASE"] %>