Skip to content

Installation

Jeff Felchner edited this page Mar 6, 2023 · 10 revisions

Add this line to your application's Gemfile:

gem 'chamber'

And then execute:

$ bundle

Or install it yourself as:

$ gem install chamber

Initialization

Once the gem is installed, you'll want to add it to your project. To do this, type:

chamber init

This does a few things:

  • creates a public key called .chamber.pem.pub
  • creates a private key called .chamber.pem
  • creates a encrypted version of the private key called .chamber.enc
  • adds standard chamber key filename formats to your .gitignore file so they aren't accidentally checked in
  • creates a settings.yml template file to get you started

Note: Keep the private key safe since anyone who has it will be able to decrypt any settings that Chamber encrypts for you.

For more information on chamber init, including its additional super powers, check out its documentation

Project Integrations

Next up, we need to have Chamber automatically load your settings from your project. Depending on your project type, the method will be slightly different, but in most cases it requires no code.

In a Ruby Project or Ruby Gem

Chamber.load basepath: '/path/to/my/application'

That's all you have to do.

Which settings will it load? As mentioned here, Chamber will load /path/to/my/application/settings.yml, as well as the other files mentioned on that page.

In a Rails Project

You do not have to do anything. Chamber's Rails plugin will:

In a Rails Engine

Add Chamber to the dummy application just as you would as if it was a regular Rails app and it will just work. You can put your config settings in test/dummy/config/settings.yml (or spec/dummy/config/settings.yml) and Chamber will do the right thing.

In a Sinatra Project

Just add the following to your app.rb and Chamber will handle the rest.

require 'chamber/integrations/sinatra'

set :root, File.dirname(__FILE__)
register Chamber::Integrations::Sinatra

The full app.rb example might look something like this.

In a Padrino Project

Just add the following to your app.rb and Chamber will handle the rest.

require 'chamber/integrations/sinatra'

register Chamber::Integrations::Sinatra

The full app.rb example might look something like this.

In a Hanami Project

# TODO

Gem Signing

Because Chamber deals with your most sensitive information, I want to give my users as many tools as possible to keep their secrets safe.

From 2.9.0 forward, I'll begin cryptographically signing each of my releases with my private key. My public key will be available on the repo for anyone to access at any time.

There are only two steps required for you to securely install this gem:

  • Add my public key as a trusted certificate
gem cert --add <(curl -Ls https://raw.github.com/thekompanee/chamber/master/certs/thekompanee.pem)
  • Install the gem by telling Rubygems to verify the signature
gem install chamber -P MediumSecurity

The MediumSecurity trust profile will verify signed gems, but allow the installation of unsigned dependencies (compared to HighSecurity which requires all dependencies to be signed as well). Because Chamber depends on thor for its CLI commands, and thor is not signed, you cannot install Chamber with HighSecurity. If you would like to do this, throw you support on the issue here.

Checksums

In addition to signing each release, I'll commit the checksums for each release to the repo and they too will be publicly available.

A simple curl command is all that's required to get the verifiable checksum for any release:

curl --silent https://raw.githubusercontent.com/thekompanee/chamber/master/checksum/chamber-2.9.1.gem.sha256

=> 0deb7b68351eb9162c22575a2e8c36152cce2f45b7c273e276c943a62cc65e9c

Simply replace the version number with the version you'd like to verify and the extension with the algorithm you'd like to verify against.


Next Step: Basic Usage

Clone this wiki locally