letsencrypt-cli 0.3.0 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/letsencrypt/cli/acme_wrapper.rb +6 -1
- data/lib/letsencrypt/cli/app.rb +3 -2
- data/lib/letsencrypt/cli/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c4eb9d68be78e9203cd742d79ae99edbb4da397f
|
4
|
+
data.tar.gz: d0c8b29ee9be5371c44743beed65afb0bad9ebff
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0c4e4b92a4bb85d480d0439f521559f88b1c4ecbf504f7ff571e67d2e0d523b0a1eb82c64072d3a6eadf910aeb54b62a6481d07332d799c3a9861864d68f764b
|
7
|
+
data.tar.gz: ec42ddcc2a121f002072bcb1c4ad25a097449960c9f283dde9d7dfba37c916dbc10c59f6f758d96ae00c9d22fda4a9e27e0fb55036a9437195c6bdd17ae2e04e
|
@@ -132,7 +132,12 @@ class AcmeWrapper
|
|
132
132
|
log "Certificate '#{@options[:certificate_path]}' missing domains #{missing_domains.join(' ')}. Existing: #{domains_in_cert.join(' ')}", :warn
|
133
133
|
return false
|
134
134
|
end
|
135
|
-
|
135
|
+
expires_on = cert.not_after.to_date
|
136
|
+
if expires_on <= Date.today
|
137
|
+
log "Certificate '#{@options[:certificate_path]}' has expired on #{expires_on}.", :warn
|
138
|
+
return false
|
139
|
+
end
|
140
|
+
renew_on = expires_on - @options[:days_valid]
|
136
141
|
if renew_on > Date.today
|
137
142
|
log "Certificate '#{@options[:certificate_path]}' still valid till #{cert.not_after.to_date}.", :warn
|
138
143
|
log "Won't renew until #{renew_on} (#{@options[:days_valid]} days before)", :warn
|
data/lib/letsencrypt/cli/app.rb
CHANGED
@@ -82,9 +82,10 @@ module Letsencrypt
|
|
82
82
|
method_option :key_length, desc: "Length of private key", default: 2048, type: :numeric
|
83
83
|
method_option :days_valid, desc: "If the --certificate-path already exists, only create new stuff, if that certificate isn't valid for less than the given number of days", default: 30, type: :numeric
|
84
84
|
method_option :webroot_path, desc: "Path to mapped .well-known/acme-challenge folder (no subdirs will be created)", aliases: '-w', required: true
|
85
|
-
method_option :key_directory, desc: "Base directory
|
85
|
+
method_option :key_directory, desc: "Base directory for certificate storage.", default: "~/certs/"
|
86
|
+
method_option :sub_directory, desc: "Sub-directory name in base directory where all certs + key are stored. If not set, the first domain name will be used", default: nil
|
86
87
|
def manage(*domains)
|
87
|
-
key_dir = File.join(@options[:key_directory], domains.first)
|
88
|
+
key_dir = File.join(@options[:key_directory], @options[:sub_directory] || domains.first)
|
88
89
|
FileUtils.mkdir_p(key_dir)
|
89
90
|
@options = @options.merge(
|
90
91
|
:private_key_path => File.join(key_dir, 'key.pem'),
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: letsencrypt-cli
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Stefan Wienert
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-07-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: acme-client
|