tcce 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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4aa9c8b89db6fb2cfc574f7d678d819d68d5ba6278806a51f115f13b5927abec
4
- data.tar.gz: 8b05f710aaa3460c44f5d277625b1266a2bc5076be96d1521b1ebae13898d6a5
3
+ metadata.gz: b1895498fd58497c40463e243747be66e87b29b4bfffff31e8b9ed9e8fecdf74
4
+ data.tar.gz: 2a80e5bb9eab689a97e02e0f1bece64c4cf2d177094f0805a522d6c081ead495
5
5
  SHA512:
6
- metadata.gz: a687c52182c62cc17ab4ce1da7cc53041da87f2051c0b9dbcf5817a870fe4b2f172e15000f1078e9bd3a2433a02efd127bb4f8880b0094bb86694e5fc79ab315
7
- data.tar.gz: ec1bfbf72e439259729920e8df7c2877acea5ddbdad11715cbaaeb4c44a9817bac8b85ac8fbd8bc0035ce057b898baf72aa79ea4fc18159cfa4a0a3d0544adfd
6
+ metadata.gz: 103b4b9a9b87e854edf9f938a0a443a14783fdd4b8c3a8c2c6c08258da49722e7c62709766e39e4be6dfa9395800f1a93c2c880e8b785a389380300cc19d4043
7
+ data.tar.gz: 804bcec846851236116068d9a81e8aab48439aaa8301cf61507ae7a72c76556044180891f179002e0f38bc890806829ebcd0c1b63e1b184ab43a04611b6c6c00
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- tcce (0.1.0)
4
+ tcce (0.1.1)
5
5
  diplomat (~> 2.0, >= 2.0.2)
6
6
 
7
7
  GEM
data/README.md CHANGED
@@ -37,7 +37,7 @@ To retrieve the contents of the consul kv-object, execute the following code:
37
37
  ```ruby
38
38
  consul = TCCE::Consul.new url, acl_token, kv_path
39
39
  acme_json = consul.get
40
- # => "{"Email":"ralf.herzog@mail.com","Registration":{"body":{"status":"valid","contact":["mailto:ralf.herzog@mail.com"]},"uri":"https://acme-v02.api.letsencrypt.org/acme/acct/37963798"},"PrivateKey":"MII..."}"
40
+ # => "{"Email":"ralf@rherzog.de","Registration":{"body":{"status":"valid","contact":["mailto:ralf@rherzog.de"]},"uri":"https://acme-v02.api.letsencrypt.org/acme/acct/15648645"},"PrivateKey":"MII..."}"
41
41
  ```
42
42
 
43
43
  This will decompress the stored object. For example:
@@ -87,7 +87,14 @@ end
87
87
 
88
88
  ## Development
89
89
 
90
- After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
90
+ After checking out the repo, run `bin/setup` to install dependencies. Set the environment variables with working values:
91
+
92
+ CONSUL_URL=http://localhost:8300
93
+ CONSUL_TOKEN=xxxxxxxx-yyyy-zzzz-1111-222222222222
94
+ CONSUL_KV_PATH=traefik/acme/account
95
+ CONSUL_CA_PATH=ca.crt # optional
96
+
97
+ Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
91
98
 
92
99
  To install this gem onto your local machine, run `bundle exec rake install`.
93
100
 
@@ -6,19 +6,25 @@ module TCCE
6
6
  class Consul
7
7
  attr_accessor :kv_path
8
8
 
9
- # @param [String] url
10
- # @param [String] acl_token
11
- # @param [String] kv_path
12
- def initialize(url, acl_token, kv_path = nil)
9
+ # @param [String] url consul api url
10
+ # @param [String] acl_token consul acl token
11
+ # @param [String] kv_path consul path to object
12
+ # @param [String] ca_file Path to ca file
13
+ def initialize(url, acl_token, kv_path, ca_file = nil)
13
14
  self.kv_path = kv_path
14
15
 
15
16
  Diplomat.configure do |config|
16
17
  # Set up a custom Consul URL
17
18
  config.url = url
19
+
18
20
  # Connect into consul with custom access token (ACL)
19
21
  config.acl_token = acl_token
22
+
20
23
  # Set extra Faraday configuration options
21
- config.options = { ssl: { version: :TLSv1_2 } }
24
+ config.options = { ssl: {
25
+ version: :TLSv1_2,
26
+ ca_file: ca_file
27
+ } }
22
28
  end
23
29
  end
24
30
 
@@ -1,3 +1,3 @@
1
1
  module TCCE
2
- VERSION = '0.1.0'.freeze
2
+ VERSION = '0.1.1'.freeze
3
3
  end
@@ -9,7 +9,7 @@ Gem::Specification.new do |spec|
9
9
  spec.email = ['ralf@rherzog.de']
10
10
 
11
11
  spec.summary = 'Traefik Consul Certificate Export'
12
- spec.description = 'Export certificates from consul kv to files'
12
+ spec.description = 'Export traefik acme certificates from consul kv to files'
13
13
  spec.homepage = 'https://github.com/RalfHerzog/tcce'
14
14
  spec.license = 'MIT'
15
15
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tcce
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ralf Herzog
@@ -86,7 +86,7 @@ dependencies:
86
86
  - - "~>"
87
87
  - !ruby/object:Gem::Version
88
88
  version: 0.16.1
89
- description: Export certificates from consul kv to files
89
+ description: Export traefik acme certificates from consul kv to files
90
90
  email:
91
91
  - ralf@rherzog.de
92
92
  executables: []