handsome_fencer-circle_c_i 0.1.11 → 0.1.12
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3a4536073e8d98a4adaadb671df91de15ac1645d95fffd44aec476df402e28b3
|
4
|
+
data.tar.gz: 88c97270624ff3d7de942b59143b6dc69d95b45852eddf596fcbcced353a24e1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cae21dd0094dbf203f92e32384a6a1d2c959ed37a869fad3125227a9a4e59b05f85feb2105e0e67da5bee31020cd07e0e17848ce36cc8832159a8261e15d3aa3
|
7
|
+
data.tar.gz: 9f9ec021ccb1c2bf59e2235c8296bf866382ec61373b85b45d121300dfea294da1080135445d148906a22f67352fd555554e42194855f88e79a807a9d49521a3
|
@@ -1,5 +1,6 @@
|
|
1
1
|
require 'openssl'
|
2
2
|
require 'base64'
|
3
|
+
require 'byebug'
|
3
4
|
|
4
5
|
module HandsomeFencer
|
5
6
|
module CircleCI
|
@@ -10,7 +11,7 @@ module HandsomeFencer
|
|
10
11
|
def initialize(options={})
|
11
12
|
@cipher = OpenSSL::Cipher.new 'AES-128-CBC'
|
12
13
|
@salt = '8 octets'
|
13
|
-
@dkfile = options[:dkfile] ? options[:dkfile] : dkfile
|
14
|
+
@dkfile = options[:dkfile] ? ('.circleci/' + options[:dkfile] + '.key') : dkfile
|
14
15
|
@pass_phrase = get_deploy_key
|
15
16
|
end
|
16
17
|
|
@@ -49,15 +50,14 @@ module HandsomeFencer
|
|
49
50
|
end
|
50
51
|
|
51
52
|
def encrypt(file)
|
52
|
-
file =
|
53
|
+
file = file
|
53
54
|
@cipher.encrypt.pkcs5_keyivgen @pass_phrase, @salt
|
54
55
|
encrypted = @cipher.update(File.read file) + @cipher.final
|
55
56
|
write_to_file(Base64.encode64(encrypted), file + '.enc')
|
56
57
|
end
|
57
58
|
|
58
59
|
def decrypt(file)
|
59
|
-
|
60
|
-
encrypted = Base64.decode64 File.read(Rails.root(file.to_s))
|
60
|
+
encrypted = Base64.decode64 File.read(file)
|
61
61
|
@cipher.decrypt.pkcs5_keyivgen @pass_phrase, @salt
|
62
62
|
decrypted = @cipher.update(encrypted) + @cipher.final
|
63
63
|
decrypted_file = file.split('.enc').first
|
@@ -83,7 +83,7 @@ module HandsomeFencer
|
|
83
83
|
private
|
84
84
|
|
85
85
|
def dkfile
|
86
|
-
|
86
|
+
".circleci/deploy.key"
|
87
87
|
end
|
88
88
|
|
89
89
|
def write_to_file(data, filename)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: handsome_fencer-circle_c_i
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.12
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- schadenfred
|
@@ -113,7 +113,7 @@ files:
|
|
113
113
|
- lib/handsome_fencer/circle_c_i/railtie.rb
|
114
114
|
- lib/handsome_fencer/circle_c_i/version.rb
|
115
115
|
- lib/tasks/handsome_fencer/circle_c_i_tasks.rake
|
116
|
-
homepage: https://github.com/schadenfred/
|
116
|
+
homepage: https://github.com/schadenfred/handsome_fencer-circle_c_i
|
117
117
|
licenses:
|
118
118
|
- MIT
|
119
119
|
metadata: {}
|