Sha256: 16b646f413767d059cfd9219fc0a171f3e3aa770aa4b26194ab1a6065f12c956
Contents?: true
Size: 1.37 KB
Versions: 15
Compression:
Stored size: 1.37 KB
Contents
## Storing Encrypted Files in Source Control The Jets `encrypted` commands provide access to encrypted files or configurations. See the `Jets.application.encrypted` documentation for using them in your app. This is a more generalized concept of `jets credentials`. ## Encryption Keys By default, Jets looks for the encryption key in `config/master.key` or `ENV["JETS_MASTER_KEY"]`, but that lookup can be overridden with `--key`: jets encrypted:edit config/encrypted_file.yml.enc --key config/encrypted_file.key Don't commit the key! Add it to your source control's ignore file. If you use Git, Jets handles this for you. ## Editing Files To edit or create an encrypted file use: jets encrypted:edit config/encrypted_file.yml.enc This opens a temporary file in `$EDITOR` with the decrypted contents for editing. ## Viewing Files To print the decrypted contents of an encrypted file use: jets encrypted:show config/encrypted_file.yml.enc ## Access in App Let's say you have encrypted like so: ❯ jets encrypted:show config/encrypted_file.yml.enc cloud: foo: bar You can access them in the app like so: $ jets console > file = ActiveSupport::EncryptedFile.new(content_path: "./config/encrypted_file.yml.enc", key_path: "./config/master.key", env_key: Jets.env, raise_if_missing_key: true) > YAML.load(file.read) => {"cloud"=>{"foo"=>"bar"}} >
Version data entries
15 entries across 15 versions & 1 rubygems