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
if strings.HasSuffix(endpoint, "/") {
endpoint = endpoint[:len(endpoint)-1]
if !strings.HasSuffix(endpoint, "/") {
endpoint += "/"
}
endpoint += "/api/dns/"
/*
if strings.HasSuffix(endpoint, "/") {
endpoint = endpoint[:len(endpoint)-1]
}
endpoint += "/api/dns/"
*/
if provider, err = newAPIDNSProvider(endpoint, *token); nil != 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")
}
endpoint := *acmeRelay
if strings.HasSuffix(endpoint, "/") {
endpoint = endpoint[:len(endpoint)-1]
if !strings.HasSuffix(endpoint, "/") {
endpoint += "/"
}
//endpoint += "/api/dns/"
/*
if strings.HasSuffix(endpoint, "/") {
endpoint = endpoint[:len(endpoint)-1]
}
endpoint += "/api/dns/"
*/
if provider, err = newAPIDNSProvider(endpoint, *token); nil != err {
return nil, err
}

View File

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

View File

@ -21,7 +21,7 @@ LISTEN="${LISTEN:-":80 :443"}"
AUTH_URL=${AUTH_URL:-"https://devices.example.com/api"}
# 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"}
# For Let's Encrypt / ACME registration