All Projects → envkey → envkey-ruby

envkey / envkey-ruby

Licence: MIT License
EnvKey's official Ruby client library

Programming Languages

ruby
36898 projects - #4 most used programming language
shell
77523 projects

Projects that are alternatives of or similar to envkey-ruby

envkeygo
EnvKey's official Go client library
Stars: ✭ 36 (+50%)
Mutual labels:  encryption, configuration, secret-management, secrets, environment-variables, configuration-management, devops-tools
Envkey App
Secure, human-friendly, cross-platform secrets and config.
Stars: ✭ 83 (+245.83%)
Mutual labels:  encryption, configuration, secret-management, secrets, configuration-management, devops-tools
envkey-python
EnvKey's python library. Protect API keys and credentials. Keep configuration in sync.
Stars: ✭ 24 (+0%)
Mutual labels:  configuration, secret-management, secrets, environment-variables, configuration-management, devops-tools
envkey-node
EnvKey's official Node.js client library
Stars: ✭ 46 (+91.67%)
Mutual labels:  configuration, secret-management, secrets, configuration-management, devops-tools
Node Convict
Featureful configuration management library for Node.js
Stars: ✭ 1,855 (+7629.17%)
Mutual labels:  configuration, environment-variables, configuration-management
Fsconfig
FsConfig is a F# library for reading configuration data from environment variables and AppSettings with type safety.
Stars: ✭ 108 (+350%)
Mutual labels:  configuration, environment-variables, configuration-management
parse it
A python library for parsing multiple types of config files, envvars & command line arguments that takes the headache out of setting app configurations.
Stars: ✭ 86 (+258.33%)
Mutual labels:  configuration, environment-variables, configuration-management
Dynaconf
Configuration Management for Python ⚙
Stars: ✭ 2,082 (+8575%)
Mutual labels:  configuration, environment-variables, configuration-management
Fig
A minimalist Go configuration library
Stars: ✭ 142 (+491.67%)
Mutual labels:  configuration, environment-variables, configuration-management
Helm Secrets
DEPRECATED A helm plugin that help manage secrets with Git workflow and store them anywhere
Stars: ✭ 1,129 (+4604.17%)
Mutual labels:  encryption, secret-management, secrets
gconfigs
gConfigs - Config and Secret parser
Stars: ✭ 42 (+75%)
Mutual labels:  configuration, secrets, environment-variables
Torus Cli
A secure, shared workspace for secrets
Stars: ✭ 611 (+2445.83%)
Mutual labels:  configuration, secrets, devops-tools
sitri
Sitri - powerful settings & configs for python
Stars: ✭ 20 (-16.67%)
Mutual labels:  configuration, environment-variables, configuration-management
superconfig
Access environment variables. Also includes presence validation, type coercion and default values.
Stars: ✭ 33 (+37.5%)
Mutual labels:  configuration, environment-variables, configuration-management
Helm Secrets
Successor of zendesk/helm-secrets - A helm plugin that help manage secrets with Git workflow and store them anywhere
Stars: ✭ 165 (+587.5%)
Mutual labels:  encryption, secret-management, secrets
climatecontrol
Python library for loading settings and config data from files and environment variables
Stars: ✭ 20 (-16.67%)
Mutual labels:  configuration, environment-variables, configuration-management
devops-notes
My technical documentation in the SRE / DevOps paradigm.
Stars: ✭ 19 (-20.83%)
Mutual labels:  configuration-management, devops-tools
ngx-env
Easily inject environment variables into your Angular applications
Stars: ✭ 73 (+204.17%)
Mutual labels:  configuration, environment-variables
nanobox-rails
Quickly set up a Ruby on Rails app on Nanobox, the ideal platform for developers. With Nanobox, Rails app developers can set up instant, isolated development environments that can be shared among team members. Rails apps created using Nanobox can be automatically deployed to AWS, Azure, Google Cloud, and other cloud hosts without the need for de…
Stars: ✭ 19 (-20.83%)
Mutual labels:  ruby-on-rails, devops-tools
aliceandbob
🔐 A free, light and easy to use client-side tool to generate PGP key pairs, encrypt and decrypt messages.
Stars: ✭ 24 (+0%)
Mutual labels:  encryption, ruby-on-rails

envkey gem

Integrate EnvKey with your Ruby or Ruby On Rails projects to keep api keys, credentials, and other configuration securely and automatically in sync for developers and servers.

Installation

In your Gemfile:

gem 'envkey'

If you're using Rails, that's all you need. In plain Ruby, you need to require envkey at the entry point of your application.

require 'envkey'

Usage

Generate an ENVKEY in the EnvKey App. Then set ENVKEY=..., either in a gitignored .env file in the root of your project (in development) or in an environment variable (on servers).

Now all your EnvKey variables will be available on ENV.

Errors

The gem will throw an error if an ENVKEY is missing or invalid.

Example

Assume you have STRIPE_SECRET_KEY set to sk_test_2a33b045e998d2ef60c7861d2ac22ea8 for the development environment in the EnvKey App. You generate a local development ENVKEY.

In your project's gitignored .env file:

# .env
ENVKEY=GsL8zC74DWchdpvssa9z-nk7humd7hJmAqNoA

In config/initializers/stripe.rb:

Stripe.api_key = ENV.fetch("STRIPE_SECRET_KEY")

Now STRIPE_SECRET_KEY will stay automatically in sync for all the developers on your team.

For a server, generate a server ENVKEY in the EnvKey App, then set the ENVKEY as an environment variable instead of putting it in a .env file.

Now your servers will stay in sync as well. If you need to rotate your STRIPE_SECRET_KEY you can do it in a few seconds in the EnvKey App, restart your servers, and you're good to go. All your team's developers and all your servers will have the new value.

Overriding Vars

The envkey gem will not overwrite existing environment variables or additional variables set in a .env file. This can be convenient for customizing environments that otherwise share the same configuration. You can also use sub-environments in the EnvKey app for this purpose.

Working Offline

The envkey gem caches your encrypted config in development so that you can still use it while offline. Your config will still be available (though possibly not up-to-date) the next time you lose your internet connection. If you do have a connection available, envkey will always load the latest config. Your cached encrypted config is stored in $HOME/.envkey/cache

For caching purposes, the gem assumes you're in development mode if either ENV["RAILS_ENV"] or ENV["RACK_ENV"] is "development" or "test". If you aren't using Rails or Rack, then it's assumed you're in development mode when a .env file exists in the root of your project.

envkey-fetch binaries

If you look in the ext directory of this gem, you'll find a number of envkey-fetch binaries for various platforms and architectures. These are output by the envkey-fetch Go library. It contains EnvKey's core cross-platform fetching, decryption, verification, web of trust, redundancy, and caching logic. It is completely open source.

x509 error / ca-certificates

On a stripped down OS like Alpine Linux, you may get an x509: certificate signed by unknown authority error when the envkey gem attempts to load your config. envkey-fetch tries to handle this by including its own set of trusted CAs via gocertifi, but if you're getting this error anyway, you can fix it by ensuring that the ca-certificates dependency is installed. On Alpine you'll want to run:

apk add --no-cache ca-certificates

Further Reading

For more on EnvKey in general:

Read the docs.

Read the integration quickstart.

Read the security and cryptography overview.

Need help? Have questions, feedback, or ideas?

Post an issue or email us: [email protected].

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].