handsome_fencer-circle_c_i 0.1.10 → 0.1.11

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: 042f6427f12410823e59a9f7e4d60ed98640c8bb00950a72ae9ad03e5ad714e9
4
- data.tar.gz: 3658d0de2a4de63ddc657eb66a7dda846958f5030185691e31b7153525afdd35
3
+ metadata.gz: 2c39e092e02889002eecd453021ea081461ce3485419980123e214afa3ba1d95
4
+ data.tar.gz: 45c1c0eba7545924fa0eb237816607ee65608858b15431ea6553e09d9e8a3d0b
5
5
  SHA512:
6
- metadata.gz: 581f9ae0c3cd48af19f2fdc7d630edbcda253dcf11abc106e3ae39a7dde0444cd3755c6da35a56eace03f3d78d3b85b2d370ef16cd4346ffcca79ee4c649f12a
7
- data.tar.gz: c9bee3af2db0f2febbe5314fba32a918fd9e9a0f90bc6ace3c824d0061c93516ca176829e90adc4fa9231448d1cb21735694eb4ad481348686a120fec39cb30f
6
+ metadata.gz: 0d4108d73001085e58d0a6a59a762ac762b2950c5bb7d8b1fd0bc1fa6e07463ba01e9660b0faf348d4da7c880e82b659caab4a314cf5c55829ff6a1ce90403a0
7
+ data.tar.gz: 7d13310aa34fbf29899c4e287cb8636fd0efa232c796f3dfad36772fbdc23b49ec8512f3fc1817958e00217ea6c5f4306189a762e3e653d0d7fc3780face8f4b
@@ -1,6 +1,6 @@
1
1
  require 'openssl'
2
2
  require 'base64'
3
- require 'byebug'
3
+
4
4
  module HandsomeFencer
5
5
  module CircleCI
6
6
  class Crypto
@@ -8,10 +8,9 @@ module HandsomeFencer
8
8
  DeployKeyError = Class.new(StandardError)
9
9
 
10
10
  def initialize(options={})
11
-
12
11
  @cipher = OpenSSL::Cipher.new 'AES-128-CBC'
13
12
  @salt = '8 octets'
14
- @dkfile = ".circleci/" + options[:dkfile] + ".key"
13
+ @dkfile = options[:dkfile] ? options[:dkfile] : dkfile
15
14
  @pass_phrase = get_deploy_key
16
15
  end
17
16
 
@@ -58,7 +57,7 @@ module HandsomeFencer
58
57
 
59
58
  def decrypt(file)
60
59
 
61
- encrypted = Base64.decode64 File.read(file.to_s)
60
+ encrypted = Base64.decode64 File.read(Rails.root(file.to_s))
62
61
  @cipher.decrypt.pkcs5_keyivgen @pass_phrase, @salt
63
62
  decrypted = @cipher.update(encrypted) + @cipher.final
64
63
  decrypted_file = file.split('.enc').first
@@ -76,9 +75,6 @@ module HandsomeFencer
76
75
  end
77
76
 
78
77
  def expose(directory=nil, extension=nil)
79
- # if @dkfile == '.circleci/production.key'
80
- # # byebug
81
- # end
82
78
  extension = extension || '.env.enc'
83
79
  directory = directory || '.circleci'
84
80
  source_files(directory, extension).each { |file| decrypt(file) }
@@ -87,7 +83,7 @@ module HandsomeFencer
87
83
  private
88
84
 
89
85
  def dkfile
90
- ".circleci/deploy.key"
86
+ Rails.root.join(".circleci/deploy.key")
91
87
  end
92
88
 
93
89
  def write_to_file(data, filename)
@@ -1,5 +1,5 @@
1
1
  module HandsomeFencer
2
2
  module CircleCI
3
- VERSION = '0.1.10'
3
+ VERSION = '0.1.11'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
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.10
4
+ version: 0.1.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - schadenfred
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-09-30 00:00:00.000000000 Z
11
+ date: 2018-10-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sshkit