No commit activity in last 3 years
No release in over 3 years
Ruby gem to initialize Rails config.secret_token from an environment variable
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

 Project Readme

Manage config.secret_token with environment variable

Put this in your rails app's Gemfile:

gem 'rails_secret_token_env'

This will set your app's config.secret_token to the SECRET_TOKEN environment variable. You should delete the default config/initializer/secret_token.rb file.

For rails 4, it also sets app.config.secret_key_base

In production mode, it will log an error if the variable is missing.

(In development mode, it will default to 'xxxxxx' if not found)

See also: gem 'dotenv' and 'dotenv-rails'