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 22
33Switching to ACMEv2 broke backwards compatibility in a couple ways.
44
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
88
99# Upgrading from v2 to v3
1010
Original file line number Diff line number Diff line change @@ -157,7 +157,7 @@ def private_key
157157 end
158158
159159 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 )
161161 end
162162
163163 def register_key
Original file line number Diff line number Diff line change 55
66module LetsencryptWebfaction
77 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
99
1010 WEBFACTION_API_URL = 'https://api.webfaction.com/' . freeze
1111
@@ -39,8 +39,8 @@ def letsencrypt_account_email
3939 @config [ 'letsencrypt_account_email' ]
4040 end
4141
42- def v2_endpoint
43- @config [ 'v2_endpoint ' ]
42+ def directory
43+ @config [ 'directory ' ]
4444 end
4545
4646 def api_url
@@ -57,7 +57,7 @@ def certificates
5757
5858 def errors
5959 { } . 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' )
6161 NON_BLANK_FIELDS . each do |field |
6262 e [ field ] = "can't be blank" if public_send ( field ) . nil? || public_send ( field ) == ''
6363 end
Original file line number Diff line number Diff line change 11key_size : 2048
2- endpoint : ' https://acme.example.com/'
2+ directory : ' https://acme.example.com/'
33domains :
44 - ' example.com'
55 - ' www.example.com'
Original file line number Diff line number Diff line change 77
88# The ACME endpoint. Use the staging server until you get everything working.
99# 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
1212
1313# The URL to the WebFaction API. You should not change this under normal
1414# circumstances.
Original file line number Diff line number Diff line change 11key_size : 2048
2- endpoint : ' https://acme.example.com/'
2+ directory : ' https://acme.example.com/'
33domains :
44 - ' example.com'
55 - ' www.example.com'
Original file line number Diff line number Diff line change 11username = " myusername"
22password = " mypassword"
33letsencrypt_account_email =
" [email protected] " 4- endpoint = " https://acme-staging.api.letsencrypt.org/" # Staging
4+ directory = " https://acme-staging.api.letsencrypt.org/" # Staging
55api_url = " https://wfserverapi.example.com/"
66servername = " myservername"
77
Original file line number Diff line number Diff line change 44 let ( :username ) { 'myusername' }
55 let ( :password ) { 'mypassword' }
66 let ( :letsencrypt_account_email ) { '[email protected] ' } 7- let ( :v2_endpoint ) { 'https://acme.example.com/' }
7+ let ( :directory ) { 'https://acme.example.com/' }
88 let ( :additional_config ) { '' }
99 let ( :cert_name ) { 'mycertname1' }
1010 let ( :toml ) do
1111 <<-TOML
1212 username = "#{ username } "
1313 password = "#{ password } "
1414 letsencrypt_account_email = "#{ letsencrypt_account_email } "
15- v2_endpoint = "#{ v2_endpoint } "
15+ directory = "#{ directory } "
1616 #{ additional_config }
1717 [[certificate]]
1818 domains = [
4141 end
4242 end
4343
44- describe '#v2_endpoint ' do
45- subject { options . v2_endpoint }
44+ describe '#directory ' do
45+ subject { options . directory }
4646 it { is_expected . to eq 'https://acme.example.com/' }
4747 end
4848
106106 context 'with ACMEv1 endpoint' do
107107 let ( :additional_config ) { 'endpoint = "blah"' }
108108
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.' ) }
110110 end
111111
112- context 'with invalid v2_endpoint ' do
113- let ( :v2_endpoint ) { '' }
112+ context 'with invalid directory ' do
113+ let ( :directory ) { '' }
114114
115- it { is_expected . to eq ( v2_endpoint : "can't be blank" ) }
115+ it { is_expected . to eq ( directory : "can't be blank" ) }
116116 end
117117
118118 context 'with invalid api_url' do
Original file line number Diff line number Diff line change 88# The ACME endpoint. Use the staging server until you get everything working.
99# Then switch to the production endpoint. You may want to run with the --force
1010# 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
1313
1414# The URL to the WebFaction API. You should not change this under normal
1515# circumstances.
You can’t perform that action at this time.
0 commit comments