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 +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +9 -2
- data/lib/tcce/consul.rb +11 -5
- data/lib/tcce/version.rb +1 -1
- data/tcce.gemspec +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b1895498fd58497c40463e243747be66e87b29b4bfffff31e8b9ed9e8fecdf74
|
4
|
+
data.tar.gz: 2a80e5bb9eab689a97e02e0f1bece64c4cf2d177094f0805a522d6c081ead495
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 103b4b9a9b87e854edf9f938a0a443a14783fdd4b8c3a8c2c6c08258da49722e7c62709766e39e4be6dfa9395800f1a93c2c880e8b785a389380300cc19d4043
|
7
|
+
data.tar.gz: 804bcec846851236116068d9a81e8aab48439aaa8301cf61507ae7a72c76556044180891f179002e0f38bc890806829ebcd0c1b63e1b184ab43a04611b6c6c00
|
data/Gemfile.lock
CHANGED
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
|
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.
|
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
|
|
data/lib/tcce/consul.rb
CHANGED
@@ -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
|
-
|
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: {
|
24
|
+
config.options = { ssl: {
|
25
|
+
version: :TLSv1_2,
|
26
|
+
ca_file: ca_file
|
27
|
+
} }
|
22
28
|
end
|
23
29
|
end
|
24
30
|
|
data/lib/tcce/version.rb
CHANGED
data/tcce.gemspec
CHANGED
@@ -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.
|
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: []
|