rails-letsencrypt 0.4.0 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +6 -4
- data/Rakefile +2 -0
- data/app/jobs/lets_encrypt/application_job.rb +2 -0
- data/app/models/concerns/lets_encrypt/certificate_issuable.rb +2 -0
- data/app/models/concerns/lets_encrypt/certificate_verifiable.rb +2 -2
- data/config/routes.rb +2 -0
- data/lib/generators/lets_encrypt/register_generator.rb +2 -2
- data/lib/letsencrypt.rb +6 -4
- data/lib/letsencrypt/engine.rb +2 -0
- data/lib/letsencrypt/logger_proxy.rb +2 -0
- data/lib/letsencrypt/redis.rb +2 -0
- data/lib/letsencrypt/version.rb +3 -1
- data/lib/rails-letsencrypt.rb +2 -0
- metadata +58 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0633ffad33535aafb793abb0e38402b90ccb2d5a
|
4
|
+
data.tar.gz: db2be9f9072c31adb5592a936a7b5501e5a639cc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: faaa56f16f0ab8ace274c7bc2e56fc9d67a86db0c75579751d1e54491e09c7c221cf3560a713c2dfba9b54ca36d3da84b534b6139f64c81418a8f10dce285526
|
7
|
+
data.tar.gz: b285b39c7c74297456f6e209ec9d193937ca4af436b904a2691641be913cad87ac341d0d3f3aef53caf2794335393d07558c7f48e7537e95bafb9de4fc2e63cb
|
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# LetsEncrypt
|
1
|
+
# LetsEncrypt [![Gem Version](https://badge.fury.io/rb/rails-letsencrypt.svg)](https://badge.fury.io/rb/rails-letsencrypt) [![Build Status](https://travis-ci.org/elct9620/rails-letsencrypt.svg?branch=master)](https://travis-ci.org/elct9620/rails-letsencrypt) [![Coverage Status](https://coveralls.io/repos/github/elct9620/rails-letsencrypt/badge.svg?branch=master)](https://coveralls.io/github/elct9620/rails-letsencrypt?branch=master) [![Code Climate](https://codeclimate.com/github/elct9620/rails-letsencrypt/badges/gpa.svg)](https://codeclimate.com/github/elct9620/rails-letsencrypt)
|
2
2
|
|
3
3
|
Provide manageable Let's Encrypt Certificate for Rails.
|
4
4
|
|
@@ -46,7 +46,7 @@ rake letsencrypt:renew
|
|
46
46
|
If you are using Sidekiq or others, you can enqueue renew task daily.
|
47
47
|
|
48
48
|
```
|
49
|
-
LetsEncrypt::RenewCertificate.
|
49
|
+
LetsEncrypt::RenewCertificate.perform_later
|
50
50
|
```
|
51
51
|
|
52
52
|
### ngx_mruby
|
@@ -56,8 +56,10 @@ The setup is following this [Article](http://hb.matsumoto-r.jp/entry/2017/03/23/
|
|
56
56
|
Add `config/initializers/letsencrypt.rb` to add config to sync certificate.
|
57
57
|
|
58
58
|
```ruby
|
59
|
-
LetsEncrypt.config
|
60
|
-
|
59
|
+
LetsEncrypt.config do |config|
|
60
|
+
config.redis_url = 'redis://localhost:6379/1'
|
61
|
+
config.save_to_redis = true
|
62
|
+
end
|
61
63
|
```
|
62
64
|
|
63
65
|
Connect `Redis` when nginx worker start
|
data/Rakefile
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module LetsEncrypt
|
2
4
|
# :nodoc:
|
3
5
|
module CertificateVerifiable
|
@@ -52,9 +54,7 @@ module LetsEncrypt
|
|
52
54
|
@retries ||= 0
|
53
55
|
if e.is_a?(Acme::Client::Error::BadNonce) && @retries < 5
|
54
56
|
@retries += 1
|
55
|
-
# rubocop:disable Metrics/LineLength
|
56
57
|
logger.info "Bad nounce encountered. Retrying (#{@retries} of 5 attempts)"
|
57
|
-
# rubocop:enable Metrics/LineLength
|
58
58
|
sleep 1
|
59
59
|
verify
|
60
60
|
else
|
data/config/routes.rb
CHANGED
@@ -26,13 +26,13 @@ module LetsEncrypt
|
|
26
26
|
end
|
27
27
|
|
28
28
|
def generate_key
|
29
|
-
# rubocop:disable
|
29
|
+
# rubocop:disable Metrics/LineLength
|
30
30
|
key_path = ask("Where you to save private key [#{LetsEncrypt.private_key_path}]:", path: true)
|
31
31
|
# rubocop:enable Metrics/LineLength
|
32
32
|
key_path = LetsEncrypt.private_key_path if key_path.blank?
|
33
33
|
|
34
34
|
return unless file_collision(key_path)
|
35
|
-
FileUtils.rm(key_path)
|
35
|
+
FileUtils.rm(key_path) if File.exist?(key_path)
|
36
36
|
LetsEncrypt.config.use_env_key = false
|
37
37
|
LetsEncrypt.config.private_key_path = key_path
|
38
38
|
|
data/lib/letsencrypt.rb
CHANGED
@@ -1,7 +1,9 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'openssl'
|
2
4
|
require 'acme-client'
|
3
5
|
require 'redis'
|
4
|
-
require '
|
6
|
+
require 'letsencrypt/railtie'
|
5
7
|
require 'letsencrypt/engine'
|
6
8
|
require 'letsencrypt/configuration'
|
7
9
|
require 'letsencrypt/logger_proxy'
|
@@ -9,8 +11,8 @@ require 'letsencrypt/redis'
|
|
9
11
|
|
10
12
|
# :nodoc:
|
11
13
|
module LetsEncrypt
|
12
|
-
ENDPOINT = 'https://acme-v01.api.letsencrypt.org/'
|
13
|
-
ENDPOINT_STAGING = 'https://acme-staging.api.letsencrypt.org'
|
14
|
+
ENDPOINT = 'https://acme-v01.api.letsencrypt.org/'
|
15
|
+
ENDPOINT_STAGING = 'https://acme-staging.api.letsencrypt.org'
|
14
16
|
|
15
17
|
class << self
|
16
18
|
def client
|
@@ -26,7 +28,7 @@ module LetsEncrypt
|
|
26
28
|
|
27
29
|
def load_private_key
|
28
30
|
return ENV['LETSENCRYPT_PRIVATE_KEY'] if config.use_env_key
|
29
|
-
return File.open(private_key_path) if
|
31
|
+
return File.open(private_key_path) if File.exist?(private_key_path)
|
30
32
|
generate_private_key
|
31
33
|
end
|
32
34
|
|
data/lib/letsencrypt/engine.rb
CHANGED
data/lib/letsencrypt/redis.rb
CHANGED
data/lib/letsencrypt/version.rb
CHANGED
data/lib/rails-letsencrypt.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rails-letsencrypt
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- 蒼時弦也
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-05-
|
11
|
+
date: 2017-05-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -52,6 +52,20 @@ dependencies:
|
|
52
52
|
- - ">="
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: appraisal
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
55
69
|
- !ruby/object:Gem::Dependency
|
56
70
|
name: rspec-rails
|
57
71
|
requirement: !ruby/object:Gem::Requirement
|
@@ -66,6 +80,48 @@ dependencies:
|
|
66
80
|
- - ">="
|
67
81
|
- !ruby/object:Gem::Version
|
68
82
|
version: '0'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: simplecov
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - ">="
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0'
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - ">="
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: coveralls
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - ">="
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '0'
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - ">="
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '0'
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: codeclimate-test-reporter
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - ">="
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: '0'
|
118
|
+
type: :development
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - ">="
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: '0'
|
69
125
|
description: The Let's Encrypt certificate manager for rails
|
70
126
|
email:
|
71
127
|
- elct9620@frost.tw
|