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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a5daeb88cfefed35938043bd207c5f0da83e5459
4
- data.tar.gz: c957d6ef5ff7b213b7c20e6d0cd1d29f71da898f
3
+ metadata.gz: c4eb9d68be78e9203cd742d79ae99edbb4da397f
4
+ data.tar.gz: d0c8b29ee9be5371c44743beed65afb0bad9ebff
5
5
  SHA512:
6
- metadata.gz: ca8f5bdbd2f673933c945bec5a952e327aa20e96c9e51c9e14d27c1eb9ccbe52fad6c0a4df1c721310d545a28c1613830203f7034601a62d64bd60f08e748a1c
7
- data.tar.gz: 289b3b107fae7f86377a1606debc2dbccbd3eecdeecf128a1efb4c44fbc781acb2b2bc1230d9b152b30e0e12316d2a987175298639a847aa5c9f892ae3150760
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
- renew_on = cert.not_after.to_date - @options[:days_valid]
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
@@ -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 of key creation. A subfolder with the first domain will be created where all certs + key are stored", default: "~/certs/"
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'),
@@ -1,5 +1,5 @@
1
1
  module Letsencrypt
2
2
  module Cli
3
- VERSION = "0.3.0"
3
+ VERSION = "0.4.0"
4
4
  end
5
5
  end
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.3.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-05-31 00:00:00.000000000 Z
11
+ date: 2016-07-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: acme-client