canzea 0.1.40 → 0.1.41

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b159fea66d70a890582c30699c629c3f39d1a7da
4
- data.tar.gz: 5f4c09773e77e2404958cad2882118a6fe637e37
3
+ metadata.gz: 1038b6a7395c045a997412801729f93000e4a8dd
4
+ data.tar.gz: 33d5a1b94baa890d4e9282ae7ae1c7f00bf30772
5
5
  SHA512:
6
- metadata.gz: 5d5377987328771014950546eaae8bd93856133b5b4b3571014ced10d938a1ec1097f8d5ab8bf36cad1c389e8b349f14eaa9e1e4b3e462e520644853a805e82d
7
- data.tar.gz: 9a27423fdb1017e836b1b02ca1958ee13c97c4f3502d96cadb9cd336a4af0232c788cb01c7a9a536fcb0477d90bf5c2770ec513d2b63e14dc854a80dc0663141
6
+ metadata.gz: eb78d932f08445bcfb5dee485b7f43b47b08a79adad0d346a549f9d9722453703ea5b0ca57e5f7a225a5ebc13449040f34a96f6e3daf6281f6a7ebd39879d37b
7
+ data.tar.gz: 7d7142b7077522cb53034b5d0309e7b699b5f9f5fb1518b2ab84c1e01dbe63e72b356b4b29ddbf46ba94c8ce80568747938d579a94ec7768637a5ccbf7d8c8d8
data/lib/canzea/config.rb CHANGED
@@ -11,6 +11,7 @@ module Canzea
11
11
  :git_repo => "/opt/cloud-profile",
12
12
  :logging_root => Dir.home,
13
13
  :pwd => Dir.pwd,
14
+ :consul_tls => false,
14
15
  :consul_tls_ca_file => "/etc/consul.d/ssl/ca.cert",
15
16
  :consul_tls_cert_file => "/etc/consul.d/ssl/consul.cert",
16
17
  :consul_tls_key_file => "/etc/consul.d/ssl/consul.key",
@@ -1,3 +1,3 @@
1
1
  module Canzea
2
- VERSION = "0.1.40"
2
+ VERSION = "0.1.41"
3
3
  end
@@ -41,18 +41,21 @@ class PrepareEnvironment
41
41
 
42
42
  puts "-- Looking up...#{svc['name']}"
43
43
 
44
- pemCert = File.read(Canzea::config[:consul_tls_cert_file])
45
- pemKey = File.read(Canzea::config[:consul_tls_key_file])
46
-
47
44
  uri = URI.parse(ENV["CONSUL_URL"] + '/v1/catalog/service/' + svc['name'])
48
45
  http = Net::HTTP.new(uri.host, uri.port)
49
- http.use_ssl = true
50
- http.ca_file = Canzea::config[:consul_tls_ca_file]
51
- http.cert = OpenSSL::X509::Certificate.new(pemCert)
52
- http.key = OpenSSL::PKey::RSA.new(pemKey)
53
- http.verify_mode = OpenSSL::SSL::VERIFY_PEER
54
- # http.set_debug_output($stdout)
55
- http.ssl_version = :SSLv23
46
+
47
+ if (Canzea::config[:consul_tls])
48
+ pemCert = File.read(Canzea::config[:consul_tls_cert_file])
49
+ pemKey = File.read(Canzea::config[:consul_tls_key_file])
50
+
51
+ http.use_ssl = true
52
+ http.ca_file = Canzea::config[:consul_tls_ca_file]
53
+ http.cert = OpenSSL::X509::Certificate.new(pemCert)
54
+ http.key = OpenSSL::PKey::RSA.new(pemKey)
55
+ http.verify_mode = OpenSSL::SSL::VERIFY_PEER
56
+ # http.set_debug_output($stdout)
57
+ http.ssl_version = :SSLv23
58
+ end
56
59
  request = Net::HTTP::Get.new(uri.request_uri)
57
60
  resp = http.request(request)
58
61
 
@@ -89,18 +92,23 @@ class PrepareEnvironment
89
92
 
90
93
  puts "-- Looking up secret...#{svc['name']}"
91
94
 
92
- pemCert = File.read(Canzea::config[:vault_tls_cert_file])
93
- pemKey = File.read(Canzea::config[:vault_tls_key_file])
94
-
95
95
  uri = URI.parse(ENV["VAULT_URL"] + '/v1/secret/' + svc['name'])
96
96
  http = Net::HTTP.new(uri.host, uri.port)
97
- http.use_ssl = true
98
- http.ca_file = Canzea::config[:consul_tls_ca_file]
99
- http.cert = OpenSSL::X509::Certificate.new(pemCert)
100
- http.key = OpenSSL::PKey::RSA.new(pemKey)
101
- http.verify_mode = OpenSSL::SSL::VERIFY_PEER
102
- # http.set_debug_output($stdout)
103
- http.ssl_version = :SSLv23
97
+
98
+ if (Canzea::config[:consul_tls])
99
+
100
+ pemCert = File.read(Canzea::config[:vault_tls_cert_file])
101
+ pemKey = File.read(Canzea::config[:vault_tls_key_file])
102
+
103
+ http.use_ssl = true
104
+ http.ca_file = Canzea::config[:consul_tls_ca_file]
105
+ http.cert = OpenSSL::X509::Certificate.new(pemCert)
106
+ http.key = OpenSSL::PKey::RSA.new(pemKey)
107
+ http.verify_mode = OpenSSL::SSL::VERIFY_PEER
108
+ # http.set_debug_output($stdout)
109
+ http.ssl_version = :SSLv23
110
+ end
111
+
104
112
  request = Net::HTTP::Get.new(uri.request_uri)
105
113
 
106
114
  request['X-Vault-Token'] = ENV["VAULT_TOKEN"]
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: canzea
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.40
4
+ version: 0.1.41
5
5
  platform: ruby
6
6
  authors:
7
7
  - Canzea Technologies
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-12-14 00:00:00.000000000 Z
11
+ date: 2016-12-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler