This repository was archived by the owner on Dec 30, 2020. It is now read-only.
File tree Expand file tree Collapse file tree 9 files changed +23
-23
lines changed
lib/letsencrypt_webfaction
lib/letsencrypt_webfaction Expand file tree Collapse file tree 9 files changed +23
-23
lines changed Original file line number Diff line number Diff line change 2
2
3
3
Switching to ACMEv2 broke backwards compatibility in a couple ways.
4
4
5
- - You need to change the ` endpoint ` entry in your config to ` v2_endpoint ` and update it to staging or production.
6
- v2_endpoint = "https://acme-staging-v02.api.letsencrypt.org/directory " # Staging
7
- #v2_endpoint = "https://acme-v02.api.letsencrypt.org/directory " # Production
5
+ - You need to change the ` endpoint ` entry in your config to ` directory ` and update it to staging or production.
6
+ directory = "https://acme-staging-v02.api.letsencrypt.org/directory " # Staging
7
+ #directory = "https://acme-v02.api.letsencrypt.org/directory " # Production
8
8
9
9
# Upgrading from v2 to v3
10
10
Original file line number Diff line number Diff line change @@ -157,7 +157,7 @@ def private_key
157
157
end
158
158
159
159
def client
160
- @_client ||= Acme ::Client . new ( private_key : private_key , endpoint : @options . endpoint )
160
+ @_client ||= Acme ::Client . new ( private_key : private_key , directory : @options . directory )
161
161
end
162
162
163
163
def register_key
Original file line number Diff line number Diff line change 5
5
6
6
module LetsencryptWebfaction
7
7
class Options
8
- NON_BLANK_FIELDS = %i[ username password letsencrypt_account_email v2_endpoint api_url servername ] . freeze
8
+ NON_BLANK_FIELDS = %i[ username password letsencrypt_account_email directory api_url servername ] . freeze
9
9
10
10
WEBFACTION_API_URL = 'https://api.webfaction.com/' . freeze
11
11
@@ -39,8 +39,8 @@ def letsencrypt_account_email
39
39
@config [ 'letsencrypt_account_email' ]
40
40
end
41
41
42
- def v2_endpoint
43
- @config [ 'v2_endpoint ' ]
42
+ def directory
43
+ @config [ 'directory ' ]
44
44
end
45
45
46
46
def api_url
@@ -57,7 +57,7 @@ def certificates
57
57
58
58
def errors
59
59
{ } . tap do |e |
60
- e [ :endpoint ] = 'needs to be updated to v2_endpoint . See upgrade documentation.' if @config . key? ( 'endpoint' )
60
+ e [ :endpoint ] = 'needs to be updated to directory . See upgrade documentation.' if @config . key? ( 'endpoint' )
61
61
NON_BLANK_FIELDS . each do |field |
62
62
e [ field ] = "can't be blank" if public_send ( field ) . nil? || public_send ( field ) == ''
63
63
end
Original file line number Diff line number Diff line change 1
1
key_size : 2048
2
- endpoint : ' https://acme.example.com/'
2
+ directory : ' https://acme.example.com/'
3
3
domains :
4
4
- ' example.com'
5
5
- ' www.example.com'
Original file line number Diff line number Diff line change 7
7
8
8
# The ACME endpoint. Use the staging server until you get everything working.
9
9
# Then switch to the production endpoint.
10
- endpoint = " https://acme-staging.api.letsencrypt.org/" # Staging
11
- # endpoint = "https://acme-v01.api.letsencrypt.org/" # Production
10
+ directory = " https://acme-staging.api.letsencrypt.org/" # Staging
11
+ # directory = "https://acme-v01.api.letsencrypt.org/" # Production
12
12
13
13
# The URL to the WebFaction API. You should not change this under normal
14
14
# circumstances.
Original file line number Diff line number Diff line change 1
1
key_size : 2048
2
- endpoint : ' https://acme.example.com/'
2
+ directory : ' https://acme.example.com/'
3
3
domains :
4
4
- ' example.com'
5
5
- ' www.example.com'
Original file line number Diff line number Diff line change 1
1
username = " myusername"
2
2
password = " mypassword"
3
3
letsencrypt_account_email =
" [email protected] "
4
- endpoint = " https://acme-staging.api.letsencrypt.org/" # Staging
4
+ directory = " https://acme-staging.api.letsencrypt.org/" # Staging
5
5
api_url = " https://wfserverapi.example.com/"
6
6
servername = " myservername"
7
7
Original file line number Diff line number Diff line change 4
4
let ( :username ) { 'myusername' }
5
5
let ( :password ) { 'mypassword' }
6
6
let ( :letsencrypt_account_email ) { '[email protected] ' }
7
- let ( :v2_endpoint ) { 'https://acme.example.com/' }
7
+ let ( :directory ) { 'https://acme.example.com/' }
8
8
let ( :additional_config ) { '' }
9
9
let ( :cert_name ) { 'mycertname1' }
10
10
let ( :toml ) do
11
11
<<-TOML
12
12
username = "#{ username } "
13
13
password = "#{ password } "
14
14
letsencrypt_account_email = "#{ letsencrypt_account_email } "
15
- v2_endpoint = "#{ v2_endpoint } "
15
+ directory = "#{ directory } "
16
16
#{ additional_config }
17
17
[[certificate]]
18
18
domains = [
41
41
end
42
42
end
43
43
44
- describe '#v2_endpoint ' do
45
- subject { options . v2_endpoint }
44
+ describe '#directory ' do
45
+ subject { options . directory }
46
46
it { is_expected . to eq 'https://acme.example.com/' }
47
47
end
48
48
106
106
context 'with ACMEv1 endpoint' do
107
107
let ( :additional_config ) { 'endpoint = "blah"' }
108
108
109
- it { is_expected . to eq ( endpoint : 'needs to be updated to v2_endpoint . See upgrade documentation.' ) }
109
+ it { is_expected . to eq ( endpoint : 'needs to be updated to directory . See upgrade documentation.' ) }
110
110
end
111
111
112
- context 'with invalid v2_endpoint ' do
113
- let ( :v2_endpoint ) { '' }
112
+ context 'with invalid directory ' do
113
+ let ( :directory ) { '' }
114
114
115
- it { is_expected . to eq ( v2_endpoint : "can't be blank" ) }
115
+ it { is_expected . to eq ( directory : "can't be blank" ) }
116
116
end
117
117
118
118
context 'with invalid api_url' do
Original file line number Diff line number Diff line change 8
8
# The ACME endpoint. Use the staging server until you get everything working.
9
9
# Then switch to the production endpoint. You may want to run with the --force
10
10
# command after switching to reissue all certificates.
11
- v2_endpoint = " https://acme-staging-v02.api.letsencrypt.org/directory" # Staging
12
- # v2_endpoint = "https://acme-v02.api.letsencrypt.org/directory" # Production
11
+ directory = " https://acme-staging-v02.api.letsencrypt.org/directory" # Staging
12
+ # directory = "https://acme-v02.api.letsencrypt.org/directory" # Production
13
13
14
14
# The URL to the WebFaction API. You should not change this under normal
15
15
# circumstances.
You can’t perform that action at this time.
0 commit comments