letsencrypt_standalone 0.1.16 → 0.1.17
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a1dc96b4eddbd583b7141881bf3aec8b2fbd2c5c
|
4
|
+
data.tar.gz: 79e7a69e16ed018ea89d5bbd1f7f7d982397a201
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0148cb5a4d77bebd9223279ff9c72d7bf93521a9140b7603abfb19f646807a2b691b9a0a6ba4e87a83e401329e168c81decdd29cda62d76944b56c313789e6a0
|
7
|
+
data.tar.gz: 3fc433da6910407d43a4c74d87dcedce87b0cb76fbef33440a5cde563aeccd93d850beb02c66b9fe45cc55b808de1334e9d5c18c0ff2f30c43c76d16ffc73428
|
data/exe/le_standalone
CHANGED
@@ -71,7 +71,7 @@ begin
|
|
71
71
|
config.domains.each do |params|
|
72
72
|
domain = LetsencryptStandalone::Domain.new(params: params)
|
73
73
|
config.push_private_key_name(domain: domain)
|
74
|
-
|
74
|
+
binding.pry if domain[:host] == "www.planetpass.io"
|
75
75
|
if domain.certificates
|
76
76
|
certificate = LetsencryptStandalone::Certificate.new(client: client.acme_client, domain: domain)
|
77
77
|
next if !certificate.needs_refresh?
|
@@ -87,7 +87,7 @@ begin
|
|
87
87
|
status = domain.verify_status
|
88
88
|
if status == 'valid'
|
89
89
|
logger.info "Verified #{domain.host} challenge. Obtaining certificate."
|
90
|
-
certificate
|
90
|
+
certificate = LetsencryptStandalone::Certificate.new(client: client.acme_client, domain: domain)
|
91
91
|
.obtain_new
|
92
92
|
|
93
93
|
certificate.save
|
@@ -15,10 +15,11 @@ module LetsencryptStandalone
|
|
15
15
|
attr_reader :files
|
16
16
|
|
17
17
|
def initialize(domain:, client:)
|
18
|
-
@
|
19
|
-
|
20
|
-
@
|
21
|
-
@
|
18
|
+
@certificate = domain.certificates[:certificate]
|
19
|
+
@files = domain.files || @@default_names
|
20
|
+
@domain = domain.host
|
21
|
+
@client = client
|
22
|
+
@private_key = domain.private_key
|
22
23
|
end
|
23
24
|
|
24
25
|
def obtain_new
|
@@ -28,8 +29,7 @@ module LetsencryptStandalone
|
|
28
29
|
end
|
29
30
|
|
30
31
|
def needs_refresh?
|
31
|
-
|
32
|
-
if cert.not_after > Time.now + 2*24*3600
|
32
|
+
if @certificate.not_after > Time.now + 2*24*3600
|
33
33
|
logger.info("It doesnt need to refresh cert for domain: #{@domain}")
|
34
34
|
false
|
35
35
|
else
|
@@ -4,7 +4,7 @@ require 'fileutils'
|
|
4
4
|
|
5
5
|
module LetsencryptStandalone
|
6
6
|
class Domain < Base
|
7
|
-
attr_accessor :host, :private_key, :certificates
|
7
|
+
attr_accessor :host, :private_key, :certificates, :files
|
8
8
|
attr_reader :private_key_name, :private_key_path
|
9
9
|
|
10
10
|
@@default_private_key_name = 'private_key.pem'
|
@@ -13,9 +13,9 @@ module LetsencryptStandalone
|
|
13
13
|
@host = params.fetch(:host)
|
14
14
|
@private_key_name = params.fetch(:private_key, @@default_private_key_name)
|
15
15
|
@private_key_path = File.join(output_dir,@host, @private_key_name)
|
16
|
-
|
16
|
+
@files = params[:certificates]
|
17
17
|
if params.has_key? :certificates
|
18
|
-
load_certs
|
18
|
+
load_certs
|
19
19
|
end
|
20
20
|
load_private_key
|
21
21
|
end
|
@@ -68,9 +68,9 @@ module LetsencryptStandalone
|
|
68
68
|
File.new(@private_key_path, 'w').write(@private_key.to_pem)
|
69
69
|
end
|
70
70
|
|
71
|
-
def load_certs
|
71
|
+
def load_certs
|
72
72
|
@certificates = {}
|
73
|
-
|
73
|
+
files.each do |type, file|
|
74
74
|
cert = OpenSSL::X509::Certificate.new(File.read(File.join(host_dir, file)))
|
75
75
|
@certificates[type] = cert
|
76
76
|
logger.info "Trying to use existing cert #{type} for #{@host}"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: letsencrypt_standalone
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.17
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Grigory Aksentyev
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-09-
|
11
|
+
date: 2016-09-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|