letsencrypt_heroku 0.2.13 → 0.2.14

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: 8eb284598baf493d90c746fc8e02e35b651876b6
4
- data.tar.gz: 4c5ccbfee1f1acc8b41ad2a26fd3b7829592cd23
3
+ metadata.gz: 1b4266febb3c0d48e0773e9fcd3480514fd7a108
4
+ data.tar.gz: 272c06da312b4e15268810007fd5fa731f76c128
5
5
  SHA512:
6
- metadata.gz: 4a82db26f2f7c8f2bbb7b8c1831cdf9f964a0749a7e39d61c2fbbcf4597e7c796afba7a1f8475a65f51f1734a550291a7acbf8558d7f183dd6f2a21bf17a9875
7
- data.tar.gz: 1f0923bdbd8a2036a1e59790e87d051d08d71d1bee4993d5cca2295e06b18d62be3c3852eece560d564fd15aa0fe844cce73c89a7bbd6eeac018f0e8fcf61273
6
+ metadata.gz: 46ac4d7514849beef492c85e71935c45512de11c25a23bc3e04aaf720ecc6e3cdec4aaae6ace8fed2f96a2c6e020067a34c9a96682348738fd0ada16e943932d
7
+ data.tar.gz: c2bd0c3e38d7bf47b39b9e89bfb24bee7762abc116fe512e0afeff66f5db661d4b7298dc9c67df0cbd8986364a9e5ab3b912ce20ff634b20bd064d4842fead8e
data/README.md CHANGED
@@ -70,6 +70,8 @@ Each block in this configuration will issue a new certificate, so if you need to
70
70
  heroku_app: stg-example-dev-application
71
71
  ```
72
72
 
73
+ You can add `keep_certs: true` to a block if you need to keep the generated certificate.
74
+
73
75
  Please note that your application will be restarted for every single domain in your config. The restart happens automatically when the heroku challenge response gets set as environment variable.
74
76
 
75
77
 
@@ -8,15 +8,20 @@ class LetsencryptHeroku::Process
8
8
  output 'Update certificates' do
9
9
  csr = Acme::Client::CertificateRequest.new(names: context.config.domains)
10
10
  certificate = context.client.new_certificate(csr)
11
- File.write('privkey.pem', certificate.request.private_key.to_pem)
12
- File.write('fullchain.pem', certificate.fullchain_to_pem)
11
+ privkey_name = "privkey_#{herokuapp}.pem"
12
+ fullchain_name = "fullchain_#{herokuapp}.pem"
13
+ File.write(privkey_name, certificate.request.private_key.to_pem)
14
+ File.write(fullchain_name, certificate.fullchain_to_pem)
13
15
 
14
16
  if has_already_cert(herokuapp)
15
- execute "heroku certs:update fullchain.pem privkey.pem --confirm #{herokuapp} --app #{herokuapp}"
17
+ execute "heroku certs:update #{fullchain_name} #{privkey_name} --confirm #{herokuapp} --app #{herokuapp}"
16
18
  else
17
- execute "heroku certs:add fullchain.pem privkey.pem --app #{herokuapp}"
19
+ execute "heroku certs:add #{fullchain_name} #{privkey_name} --app #{herokuapp}"
20
+ end
21
+
22
+ unless context.config.keep_certs
23
+ FileUtils.rm [privkey_name, fullchain_name]
18
24
  end
19
- FileUtils.rm %w(privkey.pem fullchain.pem)
20
25
  end
21
26
  puts # finish the output with a nice newline ;)
22
27
  end
@@ -11,7 +11,7 @@ module LetsencryptHeroku
11
11
  block.call
12
12
  @_spinner.success
13
13
  rescue LetsencryptHeroku::TaskError
14
- exit
14
+ exit false
15
15
  end
16
16
 
17
17
  def log(message, level: :info)
@@ -1,3 +1,3 @@
1
1
  module LetsencryptHeroku
2
- VERSION = "0.2.13"
2
+ VERSION = "0.2.14"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: letsencrypt_heroku
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.13
4
+ version: 0.2.14
5
5
  platform: ruby
6
6
  authors:
7
7
  - Johannes Opper
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-07-17 00:00:00.000000000 Z
11
+ date: 2017-10-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rainbow