dotenv-gpg 0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +1 -0
- data/Gemfile +2 -0
- data/Gemfile.lock +33 -0
- data/README.md +132 -0
- data/Rakefile +7 -0
- data/bin/dotgpg +5 -0
- data/dotenv-gpg.gemspec +22 -0
- data/lib/dotgpg.rb +96 -0
- data/lib/dotgpg/cli.rb +194 -0
- data/lib/dotgpg/dir.rb +220 -0
- data/lib/dotgpg/key.rb +105 -0
- data/lib/dotgpg/template/README.md +20 -0
- data/spec/cli_spec.rb +255 -0
- data/spec/dir_spec.rb +214 -0
- data/spec/fixture/add1.key +30 -0
- data/spec/fixture/add2.key +30 -0
- data/spec/fixture/add3.key +30 -0
- data/spec/fixture/basic/.gpg/removed1@example.com +30 -0
- data/spec/fixture/basic/.gpg/removed2@example.com +30 -0
- data/spec/fixture/basic/.gpg/removed3@example.com +0 -0
- data/spec/fixture/basic/.gpg/test2@example.com +31 -0
- data/spec/fixture/basic/.gpg/test3@example.com +31 -0
- data/spec/fixture/basic/.gpg/test@example.com +31 -0
- data/spec/fixture/basic/README.md +28 -0
- data/spec/fixture/basic/a +47 -0
- data/spec/fixture/basic/b/c +47 -0
- data/spec/fixture/gnupghome/pubring.gpg +0 -0
- data/spec/fixture/gnupghome/pubring.gpg~ +0 -0
- data/spec/fixture/gnupghome/random_seed +0 -0
- data/spec/fixture/gnupghome/secring.gpg +0 -0
- data/spec/fixture/gnupghome/trustdb.gpg +0 -0
- data/spec/fixture/secret1.key +31 -0
- data/spec/helper.rb +19 -0
- data/spec/helper/assertions.rb +54 -0
- metadata +136 -0
@@ -0,0 +1,28 @@
|
|
1
|
+
This directory is managed by `dotgpg`.
|
2
|
+
|
3
|
+
User management
|
4
|
+
---------------
|
5
|
+
|
6
|
+
To get your key, run:
|
7
|
+
|
8
|
+
dotgpg key
|
9
|
+
|
10
|
+
Then get someone to import for you with:
|
11
|
+
|
12
|
+
dotgpg add path/to/public.key
|
13
|
+
|
14
|
+
Usage
|
15
|
+
-----
|
16
|
+
|
17
|
+
To see the contents of a file:
|
18
|
+
|
19
|
+
dotgpg cat development.env
|
20
|
+
|
21
|
+
To edit a file:
|
22
|
+
|
23
|
+
dotgpg edit production.env
|
24
|
+
|
25
|
+
Further help
|
26
|
+
------------
|
27
|
+
|
28
|
+
Try `dotgpg --help` or https://github.com/ConradIrwin/dotgpg.
|
@@ -0,0 +1,47 @@
|
|
1
|
+
-----BEGIN PGP MESSAGE-----
|
2
|
+
Version: GnuPG v1.4.15 (Darwin)
|
3
|
+
|
4
|
+
hQEMA4Q0MbNn6eYmAQf/d5YFZBocqeOXbcdfiqAgAju0Wzrc3ZbJH8kFnOrCeaJf
|
5
|
+
YUHy/FA5yUWVuNg85Xwz9LLjv0pZWXfAupuWdkTKJVuu/jXB7VLqCgvMsTqfmfeb
|
6
|
+
6w5PDyJfMi7uQJcjGEbyzI4V1GEX+SHD0o+R7HT/hxYuagP5xY5AV07cR1Zasmrh
|
7
|
+
JvjUVRxfhhvWjsCnawm8Foehv8l2aaGrW3J6tHmrcPzXqkX8uW/WjtZsXTpT5wdH
|
8
|
+
6NED5vmEhfwbfBP9IZrzL2pVwBMse58uP66cVUHZxJD/B9i8xmpHRzgstk4EC9aN
|
9
|
+
SZUYO6hz8BGeI1GqH32oeeXmMdbU6BXo/g7Vc1DzxIUBDANpxc8wfHWL2gEIAJce
|
10
|
+
jiBceTRrjW0IP7nO0KX0Rtu4GFSW9pNBr/YEiQDG+hYr1nXchtRQdLayM5VmI6YK
|
11
|
+
wKiVQLquuRwNJ4AJvsDs1n8BsfW0YTUfHW2lDorxXCxm0xbDYBLMro+VO+Lst6F3
|
12
|
+
p9F2mwV3R4stj760P21KC9dTE2+Zs4PWTkfRR6H6xCyMdc/FzdLoZMQBMh8q1b5/
|
13
|
+
756D1j4eqwgi0Pdn36BzTabLos0lBcZEn2LgouU1rrCscXx1qqf1+K+SdW2rXQR/
|
14
|
+
o5bw3x085OuluUZGCH1LZ+VhM9eyt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bAaym4hYq+ZLOAhsG3PTSI63M536xhlfml74CYIKBzT86fvBYx+6qkMCsmXsn1
|
45
|
+
VccT6KbyH/opvpXQuab/SWhFcGgH5aflKT/ccGYuxzsJcA==
|
46
|
+
=6xFr
|
47
|
+
-----END PGP MESSAGE-----
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
@@ -0,0 +1,31 @@
|
|
1
|
+
-----BEGIN PGP PUBLIC KEY BLOCK-----
|
2
|
+
Version: GnuPG v1.4.14 (Darwin)
|
3
|
+
|
4
|
+
mQENBFK0334BCACvh5hmy1NWf75IDiHuKaMdf6L7do4KnzwgfNahwzyd4yTcKlka
|
5
|
+
7rVXPS7zYuFuOQ7PdVGf3zUqxJ9wNfcFjhhVKfbf3Mx4j41sDjMbfYN5XSUIR3A2
|
6
|
+
8bjyA11rbgsgldveuYR7eTf5oUTz3WB3A7GaM+H3K2m101Ipk11FuH3SpQ8rmr0F
|
7
|
+
uL14K7tX+7qSne0LrIYgv7f8eOEL75VPRPgMNao7w+k82HwwRnRU43g6kWfRqEnW
|
8
|
+
oLfE3n+j4hzWkDT1e4Hok37htgkQnOS+mbi68vZhj/oCYXLg9qT/ObJRxLlQeMaA
|
9
|
+
UqmRDAmImO+UxUfbpQC4H6ppy6XGXwOmEfmRABEBAAG0NkZha2UgU2VjcmV0IChG
|
10
|
+
b3IgY3JlYXRpb24gdGVzdHMpIDxzZWNyZXQxQGV4YW1wbGUuY29tPokBOAQTAQIA
|
11
|
+
IgUCUrTffgIbAwYLCQgHAwIGFQgCCQoLBBYCAwECHgECF4AACgkQ2tY7SRB+gOXy
|
12
|
+
pggAnDJCtaK8zSmB4QwQXbvD04OtLUnWKLZCYpfRbfEr36m+zJ96BlpsRMYXox82
|
13
|
+
hEIK9mxrCmoxepunYo7LwdWtODWLsZU5c+ntmZxl++aoC8lJvjNWdmeDgCXAalSz
|
14
|
+
u3bKL/ZrohjNce3A4tDQi2m5eUY3+ioe4mh0je28jJyyKrTXOpI045Nk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
-----END PGP PUBLIC KEY BLOCK-----
|
data/spec/helper.rb
ADDED
@@ -0,0 +1,19 @@
|
|
1
|
+
require "bundler"
|
2
|
+
Bundler.setup
|
3
|
+
|
4
|
+
require "dotgpg"
|
5
|
+
|
6
|
+
require "minitest/spec"
|
7
|
+
require "./spec/helper/assertions"
|
8
|
+
|
9
|
+
# Make a totally isolated directory for running tests.
|
10
|
+
# This is necessary because GPG maintains state in GNUPGHOME,
|
11
|
+
# and we don't want running the tests to spoil developer's real key stores.
|
12
|
+
$fixture = Pathname.new(Dir::mktmpdir).realpath
|
13
|
+
FileUtils.cp_r "spec/fixture/", $fixture
|
14
|
+
$fixture += "fixture"
|
15
|
+
$basic = $fixture + "basic"
|
16
|
+
ENV["GNUPGHOME"] = $fixture.join("gnupghome").to_s
|
17
|
+
at_exit{ FileUtils.rm_rf $fixture }
|
18
|
+
|
19
|
+
require "minitest/autorun"
|
@@ -0,0 +1,54 @@
|
|
1
|
+
module Minitest::Assertions
|
2
|
+
|
3
|
+
def hex_gpg_bytes(data)
|
4
|
+
require 'base64'
|
5
|
+
raw = Base64.decode64(data.split("\n\n").last.split("\n=").first)
|
6
|
+
raw.bytes.map{ |x| x.to_s(16).rjust(2, "0") }.join.upcase
|
7
|
+
end
|
8
|
+
|
9
|
+
def assert_contains_keyid(keyid, data)
|
10
|
+
# 03 is the version tag of the Public Key Encrypted Session Key packet emitted
|
11
|
+
# by the current version of GPGME.
|
12
|
+
# 01 identifies the key as an RSA key.
|
13
|
+
assert_match Regexp.new("03#{keyid}01"), hex_gpg_bytes(data)
|
14
|
+
end
|
15
|
+
|
16
|
+
def refute_contains_keyid(keyid, data)
|
17
|
+
refute_match Regexp.new("03#{keyid}01"), hex_gpg_bytes(data)
|
18
|
+
end
|
19
|
+
|
20
|
+
def assert_warns(expected, &block)
|
21
|
+
actual = nil
|
22
|
+
Dotgpg.singleton_class.class_eval do
|
23
|
+
|
24
|
+
alias_method :warn_without_asserts, :warn
|
25
|
+
define_method :warn do |context, e|
|
26
|
+
actual = "#{context}: #{e.message.gsub(/\W*#{context}/, '')}"
|
27
|
+
end
|
28
|
+
end
|
29
|
+
yield
|
30
|
+
assert_equal expected, actual
|
31
|
+
ensure
|
32
|
+
Dotgpg.singleton_class.class_eval do
|
33
|
+
alias_method :warn, :warn_without_asserts
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
def assert_outputs(expected, &block)
|
38
|
+
old_stdout = $stdout
|
39
|
+
$stdout = StringIO.new
|
40
|
+
yield
|
41
|
+
$stdout.rewind
|
42
|
+
assert_equal expected, $stdout.read
|
43
|
+
ensure
|
44
|
+
$stdout = old_stdout
|
45
|
+
end
|
46
|
+
|
47
|
+
def assert_fails(expected, &block)
|
48
|
+
yield
|
49
|
+
rescue Dotgpg::Failure => e
|
50
|
+
assert_match expected, e.message
|
51
|
+
else
|
52
|
+
assert false, "did not fail"
|
53
|
+
end
|
54
|
+
end
|
metadata
ADDED
@@ -0,0 +1,136 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: dotenv-gpg
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: '0.3'
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Conrad Irwin
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2013-12-24 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: thor
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - '>='
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - '>='
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: gpgme
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - '>='
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - '>='
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: pry
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - '>='
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - '>='
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: pry-stack_explorer
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - '>='
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - '>='
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
description: Easy management of gpg-encrypted backup files
|
70
|
+
email:
|
71
|
+
- conrad@bugsnag.com
|
72
|
+
executables:
|
73
|
+
- dotgpg
|
74
|
+
extensions: []
|
75
|
+
extra_rdoc_files: []
|
76
|
+
files:
|
77
|
+
- .gitignore
|
78
|
+
- Gemfile
|
79
|
+
- Gemfile.lock
|
80
|
+
- README.md
|
81
|
+
- Rakefile
|
82
|
+
- bin/dotgpg
|
83
|
+
- dotenv-gpg.gemspec
|
84
|
+
- lib/dotgpg.rb
|
85
|
+
- lib/dotgpg/cli.rb
|
86
|
+
- lib/dotgpg/dir.rb
|
87
|
+
- lib/dotgpg/key.rb
|
88
|
+
- lib/dotgpg/template/README.md
|
89
|
+
- spec/cli_spec.rb
|
90
|
+
- spec/dir_spec.rb
|
91
|
+
- spec/fixture/add1.key
|
92
|
+
- spec/fixture/add2.key
|
93
|
+
- spec/fixture/add3.key
|
94
|
+
- spec/fixture/basic/.gpg/removed1@example.com
|
95
|
+
- spec/fixture/basic/.gpg/removed2@example.com
|
96
|
+
- spec/fixture/basic/.gpg/removed3@example.com
|
97
|
+
- spec/fixture/basic/.gpg/test2@example.com
|
98
|
+
- spec/fixture/basic/.gpg/test3@example.com
|
99
|
+
- spec/fixture/basic/.gpg/test@example.com
|
100
|
+
- spec/fixture/basic/README.md
|
101
|
+
- spec/fixture/basic/a
|
102
|
+
- spec/fixture/basic/b/c
|
103
|
+
- spec/fixture/gnupghome/pubring.gpg
|
104
|
+
- spec/fixture/gnupghome/pubring.gpg~
|
105
|
+
- spec/fixture/gnupghome/random_seed
|
106
|
+
- spec/fixture/gnupghome/secring.gpg
|
107
|
+
- spec/fixture/gnupghome/trustdb.gpg
|
108
|
+
- spec/fixture/secret1.key
|
109
|
+
- spec/helper.rb
|
110
|
+
- spec/helper/assertions.rb
|
111
|
+
homepage: http://github.com/ConradIrwin/dotenv-gpg
|
112
|
+
licenses:
|
113
|
+
- MIT
|
114
|
+
metadata: {}
|
115
|
+
post_install_message:
|
116
|
+
rdoc_options: []
|
117
|
+
require_paths:
|
118
|
+
- lib
|
119
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
120
|
+
requirements:
|
121
|
+
- - '>='
|
122
|
+
- !ruby/object:Gem::Version
|
123
|
+
version: '0'
|
124
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
125
|
+
requirements:
|
126
|
+
- - '>='
|
127
|
+
- !ruby/object:Gem::Version
|
128
|
+
version: '0'
|
129
|
+
requirements: []
|
130
|
+
rubyforge_project:
|
131
|
+
rubygems_version: 2.0.3
|
132
|
+
signing_key:
|
133
|
+
specification_version: 4
|
134
|
+
summary: gpg-encrypted backup for your dotenv files
|
135
|
+
test_files: []
|
136
|
+
has_rdoc:
|