Enforce environment variable requirements.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
bin
lib
spec
.envforcer.yml
.gitignore
.rubocop.yml
.travis.yml
Gemfile
README.md
Rakefile
envforcer.gemspec

README.md

Envforcer Build Status Gem Version

Enforce environment variable requirements.

Storing configuration in the environment is one of the tenets of a twelve-factor app. However, problems arise when required environment variables aren't set.

Usage

Add your required ENV keys to .envforcer.yml:

- REQUIRED_KEY1
- REQUIRED_KEY2
- REQUIRED_KEY3

When the app starts, envforcer will check that all the required variables are set, and raise an error if they are not. This will prevent the app from starting.

Note: Currently only tested with Heroku. Will cause push to be rejected.

Installation

Rails

Add this line to your application's Gemfile:

gem 'envforcer', require: 'envforcer-rails'

And then execute:

$ bundle

This will add a Railtie to enforce environment variables after_initialize.

Other Frameworks

At the time you wish to enforce the environment variables, add the line:

Envforcer.enforce

Contributing

We welcome pull requests. Please make sure tests accompany any PRs.


Curated by the good people at MojoTech.

(psst, we're hiring)