dotenv-vault-rails 0.7.0 → 0.8.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4fd6eab8f7ad51c5b1f2b33187eddbcfe000b95e74538fce3d08850990ec5f76
4
- data.tar.gz: 20d9bf1e87a3e2c3cd863ad47ecfd8ed7db6608bccc78828da8b38a23f901f0c
3
+ metadata.gz: 81836f8e99d481c8ae8dc9ab69c6be7c9bc2275d86ab29025db14ad9a31c4a67
4
+ data.tar.gz: e9e4296b3dd37d4b27f9d2ebc0d3bb9965c1aeb2e33377aaad02ad76527b6a4c
5
5
  SHA512:
6
- metadata.gz: 4f41e45e09a9f1c97bfc4fa64b0e4322bbd917e30e827b886f80d23d28287aaa894957a27a17b28d119fcf59c741a60b5794fb3dc67dc42c8c77af5b94a4ae43
7
- data.tar.gz: 95f221dfd6927d2a04d359079a51a6493d0fc05ba6a79324c1cf5a65e2c2aa31097a1cb1590ec2639623443b8617dc6600592c21db50214dc8f1af9eb57d687c
6
+ metadata.gz: bf1c763c3304ae0a6e8275298187c6a836578e6e6fe6941d4f1fb7276d158c215e4a9347b28e4ae012b02a52da710dc289f04bcf7c631b6ad9dd3281dde24caf
7
+ data.tar.gz: 03d12b9d8dfe69f723394076b20cae13a4fc1d7daa550f3b8322bc6ff7ca71735c5368600adf62bdbdea27eeafcad3f048541b135ebefec4a27c6901e64118cb
data/CHANGELOG.md ADDED
@@ -0,0 +1,21 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
+
5
+ ## [Unreleased](https://github.com/dotenv-org/dotenv-vault-ruby/compare/v0.8.0...master)
6
+
7
+ ## 0.8.0
8
+
9
+ ### Added
10
+
11
+ - Add `dotenv-vault/load`
12
+
13
+ ## 0.7.1
14
+
15
+ ### Added
16
+
17
+ - Added README
18
+
19
+ ## 0.7.0 and prior
20
+
21
+ Please see commit history.
data/Gemfile.lock CHANGED
@@ -1,12 +1,12 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- dotenv-vault (0.7.0)
4
+ dotenv-vault (0.8.0)
5
5
  dotenv
6
6
  lockbox
7
- dotenv-vault-rails (0.7.0)
7
+ dotenv-vault-rails (0.8.0)
8
8
  dotenv-rails
9
- dotenv-vault (= 0.7.0)
9
+ dotenv-vault (= 0.8.0)
10
10
 
11
11
  GEM
12
12
  remote: https://rubygems.org/
data/README.md CHANGED
@@ -1,3 +1,140 @@
1
- # dotenv-vault
1
+ # dotenv-vault [![Gem Version](https://badge.fury.io/rb/dotenv-vault.svg)](https://badge.fury.io/rb/dotenv-vault)
2
2
 
3
- Coming soon
3
+ <img src="https://raw.githubusercontent.com/motdotla/dotenv/master/dotenv.svg" alt="dotenv-vault" align="right" width="200" />
4
+
5
+ Dotenv Vault extends the proven & trusted foundation of [dotenv](https://github.com/bkeepers/dotenv), with a `.env.vault` file.
6
+
7
+ This new standard lets you sync your .env files – quickly & securely. Stop sharing them over insecure channels like Slack and email, and never lose an important .env file again.
8
+
9
+ ## Installation
10
+
11
+ ### Rails
12
+
13
+ Add this line to the top of your application's Gemfile:
14
+
15
+ ```ruby
16
+ gem 'dotenv-vault-rails'
17
+ ```
18
+
19
+ And then execute:
20
+
21
+ ```shell
22
+ $ bundle
23
+ ```
24
+
25
+ ## Usage
26
+
27
+ ### `.env`
28
+
29
+ Basic usage begins just like [dotenv](https://github.com/bkeepers/dotenv).
30
+
31
+ Add your application configuration to your `.env` file in the root of your project:
32
+
33
+ ```shell
34
+ S3_BUCKET=YOURS3BUCKET
35
+ SECRET_KEY=YOURSECRETKEYGOESHERE
36
+ ```
37
+
38
+ Whenever your application loads, these variables will be available in `ENV`:
39
+
40
+ ```ruby
41
+ config.fog_directory = ENV['S3_BUCKET']
42
+ ```
43
+
44
+ ### `.env.vault`
45
+
46
+ Usage is similar to git. In the same directory as your `.env` file, run the command:
47
+
48
+ ```shell
49
+ npx dotenv-vault new
50
+ ```
51
+
52
+ Follow those instructions and then run:
53
+
54
+ ```shell
55
+ $ npx dotenv-vault login
56
+ ```
57
+
58
+ Then run push and pull:
59
+
60
+ ```shell
61
+ $ npx dotenv-vault push
62
+ $ npx dotenv-vault pull
63
+ ```
64
+
65
+ That's it!
66
+
67
+ You just synced your `.env` file. Commit your `.env.vault` file to code, and tell your teammates to run `npx dotenv-vault pull`.
68
+
69
+ ## Multiple Environments
70
+
71
+ Run the command:
72
+
73
+ ```shell
74
+ $ npx dotenv-vault open production
75
+ ```
76
+
77
+ It will open up an interface to manage your production environment variables.
78
+
79
+ ## Deploy Anywhere
80
+
81
+ Build your encrypted `.env.vault`:
82
+
83
+ ```shell
84
+ $ npx dotenv-vault build
85
+ ```
86
+
87
+ Safely commit and push your changes:
88
+
89
+ ```shell
90
+ $ git commit -am "Updated .env.vault"
91
+ $ git push
92
+ ```
93
+
94
+ Obtain your `DOTENV_KEY`:
95
+
96
+ ```shell
97
+ $ npx dotenv-vault keys
98
+ ```
99
+
100
+ Set `DOTENV_KEY` on your infrastructure. For example, on Heroku:
101
+
102
+ ```shell
103
+ $ heroku config:set DOTENV_KEY="dotenv://:key_1234@dotenv.org/vault/.env.vault?environment=production"
104
+ ```
105
+
106
+ All set! When your app boots, it will recognize a `DOTENV_KEY` is set, decrypt the `.env.vault` file, and load the variables to `ENV`.
107
+
108
+ ## FAQ
109
+
110
+ #### What happens if `DOTENV_KEY` is not set?
111
+
112
+ Dotenv Vault gracefully falls back to [dotenv](https://github.com/bkeepers/dotenv) when `DOTENV_KEY` is not set. This is the default for development so that you can focus on editing your `.env` file and save the `build` command until you are ready to deploy those environment variables changes.
113
+
114
+ #### Should I commit my `.env` file?
115
+
116
+ No. We **strongly** recommend against committing your `.env` file to version control. It should only include environment-specific values such as database passwords or API keys. Your production database should have a different password than your development database.
117
+
118
+ #### Should I commit my `.env.vault` file?
119
+
120
+ Yes. It is safe and recommended to do so. It contains your vault identifier at the vault provider (in this case [dotenv.org](https://dotenv.org)) and contains your encrypted values.
121
+
122
+ #### Can I share the `DOTENV_KEY`?
123
+
124
+ No. It is the key that unlocks your encrypted environment variables. Be very careful who you share this key with. Do not let it leak.
125
+
126
+ ## Contributing
127
+
128
+ 1. Fork it
129
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
130
+ 3. Commit your changes (`git commit -am 'Added some feature'`)
131
+ 4. Push to the branch (`git push origin my-new-feature`)
132
+ 5. Create new Pull Request
133
+
134
+ ## Changelog
135
+
136
+ See [CHANGELOG.md](CHANGELOG.md)
137
+
138
+ ## License
139
+
140
+ MIT
@@ -0,0 +1,2 @@
1
+ require "dotenv-vault"
2
+ DotenvVault.load
@@ -1,3 +1,3 @@
1
1
  module DotenvVault
2
- VERSION = "0.7.0"
2
+ VERSION = "0.8.0"
3
3
  end
data/lib/dotenv-vault.rb CHANGED
@@ -90,7 +90,7 @@ module DotenvVault
90
90
  #
91
91
  # Decrypts and loads to ENV
92
92
  def load_vault(*filenames)
93
- DotenvVault.logger.info("[dotenv-vault] Loading .env.vault") if DotenvVault.logger
93
+ DotenvVault.logger.info("[dotenv-vault] Loading encrypted .env.vault to environment variables") if DotenvVault.logger
94
94
 
95
95
  parsed = parse_vault(*filenames)
96
96
 
@@ -104,7 +104,7 @@ module DotenvVault
104
104
  #
105
105
  # Decrypts and overloads to ENV
106
106
  def overload_vault(*filenames)
107
- DotenvVault.logger.info("[dotenv-vault] Overloading .env.vault") if DotenvVault.logger
107
+ DotenvVault.logger.info("[dotenv-vault] Overloading encrypted .env.vault to environment variables") if DotenvVault.logger
108
108
 
109
109
  parsed = parse_vault(*filenames)
110
110
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dotenv-vault-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.0
4
+ version: 0.8.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - motdotla
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-09-17 00:00:00.000000000 Z
11
+ date: 2022-09-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: dotenv-rails
@@ -30,14 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - '='
32
32
  - !ruby/object:Gem::Version
33
- version: 0.7.0
33
+ version: 0.8.0
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - '='
39
39
  - !ruby/object:Gem::Version
40
- version: 0.7.0
40
+ version: 0.8.0
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: spring
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -76,6 +76,7 @@ files:
76
76
  - ".gitignore"
77
77
  - ".rspec"
78
78
  - ".travis.yml"
79
+ - CHANGELOG.md
79
80
  - Gemfile
80
81
  - Gemfile.lock
81
82
  - LICENSE.txt
@@ -87,6 +88,7 @@ files:
87
88
  - dotenv-vault.gemspec
88
89
  - lib/dotenv-vault-rails.rb
89
90
  - lib/dotenv-vault.rb
91
+ - lib/dotenv-vault/load.rb
90
92
  - lib/dotenv-vault/rails-now.rb
91
93
  - lib/dotenv-vault/rails.rb
92
94
  - lib/dotenv-vault/version.rb