dotgpg 0.4 → 0.4.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +2 -0
- data/README.md +46 -11
- data/certs/gem-public_cert.pem +21 -0
- data/dotgpg.gemspec +4 -1
- data.tar.gz.sig +0 -0
- metadata +26 -3
- metadata.gz.sig +2 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2cd64108df8b8d580aefe29d8e5f51486fac2899
|
4
|
+
data.tar.gz: ee061407adc7a15e53fbfc84d2dcffc233d91a52
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a686c103fae37e1254aa9e6318190d6cba68b9d06da510f562a1020e7d13aaa2ec15b322563cb708a790c671dbb5cca5d0a81dc3ee12aafe2ee8659fcf947f98
|
7
|
+
data.tar.gz: 54b912d0a9db5e21ef34b3939a2da4509e9e39ce0872c2e568fcec8ec83fe18924f763b540ed527aca66cfafe2ab7d1aad121267c86e70e1ec9ff020cadf99d7
|
checksums.yaml.gz.sig
ADDED
data/README.md
CHANGED
@@ -1,13 +1,6 @@
|
|
1
|
-
dotgpg is a tool for backing up and versioning your production secrets securely and easily.
|
1
|
+
dotgpg is a tool for backing up and versioning your [production secrets](#deploying) or [shared passwords](#shared-passwords) securely and easily. ([Why?](#why))
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
Most people do not look after their production secrets well. If you've got them in your source-code, or unencrypted in Dropbox or Google docs you are betraying your users trust. It's too easy for someone else to get at them.
|
6
|
-
|
7
|
-
Dotgpg aims to be as easy to use as your current solution, but with added encryption. It manages a shared directory of GPG-encrypted files that you can check into git or put in Dropbox. When you deploy the secrets to your servers they are decrypted so that your app can boot without intervention.
|
8
|
-
|
9
|
-
Getting started
|
10
|
-
---------------
|
3
|
+
## Getting started
|
11
4
|
|
12
5
|
If you're a ruby developer, you know the drill. Either `gem install dotgpg` or add `gem "dotgpg"` to your Gemfile.
|
13
6
|
|
@@ -41,7 +34,7 @@ Passphrase confirmation:
|
|
41
34
|
To create or edit files, just use `dotgpg edit`. I recommend you use the `.gpg` suffix so that other tools know what these files contain.
|
42
35
|
|
43
36
|
```
|
44
|
-
$ dotgpg edit production.
|
37
|
+
$ dotgpg edit production.gpg
|
45
38
|
[ opens your $EDITOR ]
|
46
39
|
```
|
47
40
|
|
@@ -50,7 +43,7 @@ $ dotgpg edit production.env.gpg
|
|
50
43
|
To read encrypted files, `dotgpg cat` them.
|
51
44
|
|
52
45
|
```
|
53
|
-
$ dotgpg cat prodution.
|
46
|
+
$ dotgpg cat prodution.gpg
|
54
47
|
GPG passphrase for conrad.irwin@gmail.com:
|
55
48
|
```
|
56
49
|
|
@@ -87,6 +80,48 @@ leJCaaNJQBbIOj4QOjFWiZ8ATqLH9nkgawSwOV3xp0MWayCJ3MVnibt4CaI=
|
|
87
80
|
-----END PGP PUBLIC KEY BLOCK-----
|
88
81
|
```
|
89
82
|
|
83
|
+
## Why
|
84
|
+
|
85
|
+
Production secrets are the keys that your app needs to run. For example the session cookie encryption key, or the database password. These are critical to the running of your app, so it's essential to have a backup that is version controlled. Then if anything goes wrong, you can find the previous values and go back to running happily.
|
86
|
+
|
87
|
+
Unfortunately it's also essential that your production secrets are kept secret. This means that traditional solutions to storing them, like putting them unenecrypted in git or in a shared google doc or in Dropbox are not sufficiently secure. Anyone who gets access to your source code, or to someone's Dropbox password, gets the keys to the kingdom for free.
|
88
|
+
|
89
|
+
Dotgpg aims to be as easy to use as "just store them in git/Dropbox", but because it uses [gpg encryption](#security) is less vulnerable. If someone gets access to your source code, or someone's Google Apps account, they won't be able to get to your production database.
|
90
|
+
|
91
|
+
## Deploying
|
92
|
+
|
93
|
+
### dotenv
|
94
|
+
|
95
|
+
I recommend using [dotenv](https://github.com/bkeepers/dotenv) for production secrets, then storing your production `.env` file as `config/dotgpg/production.gpg` in your web repository (after doing `dotgpg init config/dotgpg`).
|
96
|
+
|
97
|
+
You can do this manually with ssh:
|
98
|
+
|
99
|
+
```shell
|
100
|
+
dotgpg cat config/dotgpg/production.gpg |\
|
101
|
+
ssh host1.example.com 'cat > /apps/website/shared/.env'
|
102
|
+
```
|
103
|
+
|
104
|
+
Or use Capistrano's `put` helper:
|
105
|
+
|
106
|
+
```ruby
|
107
|
+
file = `dotgpg cat config/dotgpg/production.gpg`
|
108
|
+
put file, "/apps/website/shared/.env"
|
109
|
+
```
|
110
|
+
|
111
|
+
### Heroku
|
112
|
+
|
113
|
+
We store a dump of `heroku config -s` in `dotgpg` with added comments. The dotgpg version is considered the master version, so if we make a mistake configuring Heroku (I've done that before...) we can restore easily.
|
114
|
+
|
115
|
+
### Other
|
116
|
+
|
117
|
+
You're kind of on your own for now :). Just store secrets in dotgpg and nowhere else, and you'll be fine!
|
118
|
+
|
119
|
+
If you've got a setup that you think is common enough, please send a pull request to add docs.
|
120
|
+
|
121
|
+
## Shared passwords
|
122
|
+
|
123
|
+
You can also use `dotgpg` to share passwords for things that you log into manually with the rest of your team. This works particularly well if you put the `dotgpg` directory into Dropbox so that it syncs magically.
|
124
|
+
|
90
125
|
## Use without ruby
|
91
126
|
|
92
127
|
The only person who really needs to use the `dotgpg` executable is the one responsible for adding and removing users from the directory. If you want to use `dotgpg` without requiring everyone to install ruby you can give them these instructions:
|
@@ -0,0 +1,21 @@
|
|
1
|
+
-----BEGIN CERTIFICATE-----
|
2
|
+
MIIDcDCCAligAwIBAgIBATANBgkqhkiG9w0BAQUFADA/MQ8wDQYDVQQDDAZjb25y
|
3
|
+
YWQxFzAVBgoJkiaJk/IsZAEZFgdidWdzbmFnMRMwEQYKCZImiZPyLGQBGRYDY29t
|
4
|
+
MB4XDTE0MDEwNjAwNTgwOFoXDTE1MDEwNjAwNTgwOFowPzEPMA0GA1UEAwwGY29u
|
5
|
+
cmFkMRcwFQYKCZImiZPyLGQBGRYHYnVnc25hZzETMB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21
|
+
-----END CERTIFICATE-----
|
data/dotgpg.gemspec
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
Gem::Specification.new do |gem|
|
2
2
|
gem.name = 'dotgpg'
|
3
|
-
gem.version = '0.4'
|
3
|
+
gem.version = '0.4.1'
|
4
4
|
|
5
5
|
gem.summary = 'gpg-encrypted backup for your dotenv files'
|
6
6
|
gem.description = "Easy management of gpg-encrypted backup files"
|
@@ -17,6 +17,9 @@ Gem::Specification.new do |gem|
|
|
17
17
|
gem.add_development_dependency 'pry'
|
18
18
|
gem.add_development_dependency 'pry-stack_explorer'
|
19
19
|
|
20
|
+
gem.cert_chain = `git ls-files certs`.split("\n")
|
21
|
+
gem.signing_key = File.expand_path("~/.ssh/dotgpg-private_key.pem")
|
22
|
+
|
20
23
|
gem.executables = 'dotgpg'
|
21
24
|
gem.files = `git ls-files`.split("\n")
|
22
25
|
end
|
data.tar.gz.sig
ADDED
Binary file
|
metadata
CHANGED
@@ -1,14 +1,36 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dotgpg
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 0.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Conrad Irwin
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
|
-
cert_chain:
|
11
|
-
|
10
|
+
cert_chain:
|
11
|
+
- |
|
12
|
+
-----BEGIN CERTIFICATE-----
|
13
|
+
MIIDcDCCAligAwIBAgIBATANBgkqhkiG9w0BAQUFADA/MQ8wDQYDVQQDDAZjb25y
|
14
|
+
YWQxFzAVBgoJkiaJk/IsZAEZFgdidWdzbmFnMRMwEQYKCZImiZPyLGQBGRYDY29t
|
15
|
+
MB4XDTE0MDEwNjAwNTgwOFoXDTE1MDEwNjAwNTgwOFowPzEPMA0GA1UEAwwGY29u
|
16
|
+
cmFkMRcwFQYKCZImiZPyLGQBGRYHYnVnc25hZzETMBEGCgmSJomT8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TIFICATE-----
|
33
|
+
date: 2014-01-06 00:00:00.000000000 Z
|
12
34
|
dependencies:
|
13
35
|
- !ruby/object:Gem::Dependency
|
14
36
|
name: thor
|
@@ -80,6 +102,7 @@ files:
|
|
80
102
|
- README.md
|
81
103
|
- Rakefile
|
82
104
|
- bin/dotgpg
|
105
|
+
- certs/gem-public_cert.pem
|
83
106
|
- dotgpg.gemspec
|
84
107
|
- lib/dotgpg.rb
|
85
108
|
- lib/dotgpg/cli.rb
|
metadata.gz.sig
ADDED