use acme relay url as true baseurl

This commit is contained in:
AJ ONeal 2020-07-17 08:16:18 +00:00
parent 64d12ec535
commit 58dc369ce1
4 changed files with 18 additions and 8 deletions

View File

@ -61,10 +61,15 @@ func main() {
} }
endpoint := *acmeRelay endpoint := *acmeRelay
if strings.HasSuffix(endpoint, "/") { if !strings.HasSuffix(endpoint, "/") {
endpoint = endpoint[:len(endpoint)-1] endpoint += "/"
} }
endpoint += "/api/dns/" /*
if strings.HasSuffix(endpoint, "/") {
endpoint = endpoint[:len(endpoint)-1]
}
endpoint += "/api/dns/"
*/
if provider, err = newAPIDNSProvider(endpoint, *token); nil != err { if provider, err = newAPIDNSProvider(endpoint, *token); nil != err {
panic(err) panic(err)
} }

View File

@ -516,10 +516,15 @@ func getACMEProvider(acmeRelay, token *string) (challenge.Provider, error) {
return nil, fmt.Errorf("No relay for ACME DNS-01 challenges given to --acme-relay-url") return nil, fmt.Errorf("No relay for ACME DNS-01 challenges given to --acme-relay-url")
} }
endpoint := *acmeRelay endpoint := *acmeRelay
if strings.HasSuffix(endpoint, "/") { if !strings.HasSuffix(endpoint, "/") {
endpoint = endpoint[:len(endpoint)-1] endpoint += "/"
} }
//endpoint += "/api/dns/" /*
if strings.HasSuffix(endpoint, "/") {
endpoint = endpoint[:len(endpoint)-1]
}
endpoint += "/api/dns/"
*/
if provider, err = newAPIDNSProvider(endpoint, *token); nil != err { if provider, err = newAPIDNSProvider(endpoint, *token); nil != err {
return nil, err return nil, err
} }

View File

@ -10,7 +10,7 @@ ACME_AGREE=true
ACME_EMAIL=jon.doe@example.com ACME_EMAIL=jon.doe@example.com
# For Let's Encrypt ACME Challenges (pick one) # For Let's Encrypt ACME Challenges (pick one)
ACME_RELAY_URL=http://localhost:4200 ACME_RELAY_URL=http://localhost:4200/api/dns
SECRET=xxxxxxxxxxxxxxxx SECRET=xxxxxxxxxxxxxxxx
#DUCKDNS_TOKEN=XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX #DUCKDNS_TOKEN=XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
#GODADDY_API_KEY=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx #GODADDY_API_KEY=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

View File

@ -21,7 +21,7 @@ LISTEN="${LISTEN:-":80 :443"}"
AUTH_URL=${AUTH_URL:-"https://devices.example.com/api"} AUTH_URL=${AUTH_URL:-"https://devices.example.com/api"}
# For Let's Encrypt / ACME challenges # For Let's Encrypt / ACME challenges
ACME_RELAY_URL=${ACME_RELAY_URL:-"http://localhost:4200"} ACME_RELAY_URL=${ACME_RELAY_URL:-"http://localhost:4200/api/dns"}
SECRET=${SECRET:-"xxxxxxxxxxxxxxxx"} SECRET=${SECRET:-"xxxxxxxxxxxxxxxx"}
# For Let's Encrypt / ACME registration # For Let's Encrypt / ACME registration