diff --git a/cmd/dnsclient/dnsclient.go b/cmd/dnsclient/dnsclient.go index c662fcb..87bb29e 100644 --- a/cmd/dnsclient/dnsclient.go +++ b/cmd/dnsclient/dnsclient.go @@ -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) } diff --git a/cmd/telebit/telebit.go b/cmd/telebit/telebit.go index a161155..90d15b4 100644 --- a/cmd/telebit/telebit.go +++ b/cmd/telebit/telebit.go @@ -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 } diff --git a/examples/relay.env b/examples/relay.env index 5142b91..b265974 100644 --- a/examples/relay.env +++ b/examples/relay.env @@ -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 diff --git a/examples/run-as-relay.sh b/examples/run-as-relay.sh index 4edd2ec..fa79a05 100644 --- a/examples/run-as-relay.sh +++ b/examples/run-as-relay.sh @@ -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