leml 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +28 -7
- data/lib/leml/core.rb +3 -0
- data/lib/leml/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8066148d2d71caaa92c3c4e79b8b3a1585e7c611
|
4
|
+
data.tar.gz: c21b6ea3221e2b5202325e86c74597515a2273a5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 04c21d0fe7ea3c84bf460ac78e82175fc7ce68fb73946b76205508de2eae70355642d1dfdec2be2d3cd96084096d9f2121d79e83d6cc013f0315d4e6780d4762
|
7
|
+
data.tar.gz: e624c9a540ac14448bb3eb9b8fe44dc30489d0f896bbdda86a03fdffd750d3f0e6d80e9038a4869df0a1e8dc000b831773b54c504cd8ed1ebac6658460b501b4
|
data/README.md
CHANGED
@@ -1,8 +1,7 @@
|
|
1
|
-
# Leml
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
How to use my plugin.
|
1
|
+
# Leml(Leaf Enrypted YAML)
|
2
|
+
Leml encrypt your secrets only leaf.
|
3
|
+
You and member can see only keys without decrypt.
|
4
|
+
It depend on rails.
|
6
5
|
|
7
6
|
## Installation
|
8
7
|
Add this line to your application's Gemfile:
|
@@ -21,8 +20,30 @@ Or install it yourself as:
|
|
21
20
|
$ gem install leml
|
22
21
|
```
|
23
22
|
|
24
|
-
##
|
25
|
-
|
23
|
+
## Usage
|
24
|
+
```bash
|
25
|
+
$ gem install leml
|
26
|
+
|
27
|
+
# Initialize your secrets
|
28
|
+
$ rake leml:init
|
29
|
+
Complete!
|
30
|
+
create config/leml.key
|
31
|
+
create config/leml.yml
|
32
|
+
|
33
|
+
Caution Don't forget add key file in gitignore
|
34
|
+
|
35
|
+
# Edit your secrets
|
36
|
+
# It use environmental variable `EDITOR`, please set your editor.
|
37
|
+
$ EDITOR=vim rake leml:edit
|
38
|
+
## edit your secrets
|
39
|
+
OK, your secrets is encrypted.
|
40
|
+
|
41
|
+
# You can also see secrets
|
42
|
+
$ rake leml:show
|
43
|
+
---
|
44
|
+
development:
|
45
|
+
author: onunu
|
46
|
+
```
|
26
47
|
|
27
48
|
## License
|
28
49
|
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
|
data/lib/leml/core.rb
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
require 'rails'
|
2
|
+
require 'pry'
|
2
3
|
|
3
4
|
module Leml
|
4
5
|
class Core
|
@@ -62,6 +63,7 @@ module Leml
|
|
62
63
|
end
|
63
64
|
|
64
65
|
def initialize
|
66
|
+
return unless File.exist?(KEY)
|
65
67
|
key = File.read(KEY).chop
|
66
68
|
@encryptor = ActiveSupport::MessageEncryptor.new(key, cipher: 'aes-256-cbc')
|
67
69
|
@secrets = YAML.load_file(SECRETS)
|
@@ -131,6 +133,7 @@ module Leml
|
|
131
133
|
|
132
134
|
def reload_secrets_file(tmp_file)
|
133
135
|
raw_secrets = YAML.load_file(tmp_file)
|
136
|
+
return unless raw_secrets
|
134
137
|
File.open(SECRETS, 'w') do |file|
|
135
138
|
file.puts encrypt(raw_secrets).to_yaml
|
136
139
|
end
|
data/lib/leml/version.rb
CHANGED