libdns / digitalocean

MIT License
10 stars 16 forks source link

Convert FQDNs to domain for DO. #2

Closed mtricht closed 4 years ago

mtricht commented 4 years ago

Fixes #1

scoobybejesus commented 4 years ago

I just ran ./xcaddy build --with github.com/caddy-dns/digitalocean and tried again.

Where I used to get acme: error presenting token: POST https://api.digitalocean.com/v2/domains/mydomain.tld./records: 404 The resource you were accessing could not be found., now I get acme: error presenting token: POST https://api.digitalocean.com/v2/domains/tld./records: 404 The resource you were accessing could not be found..

In case it's hard to see, mydomain. is missing from the URL. As well, the trailing . remains.

Perhaps the updated commit(s) fix that. Just wanted to show what I'm seeing. (Thanks very much for this fix, btw.)

mholt commented 4 years ago

@scoobybejesus How can we reproduce that error? What's your code? Edit: nvm, you're using xcaddy... see comment below 🔽 .

mtricht commented 4 years ago

@scoobybejesus @mholt That's because the module has to be updated first in caddy-dns/digitalocean, which I did here: https://github.com/caddy-dns/digitalocean/pull/2

scoobybejesus commented 4 years ago

As an update to my previous comment, when I tail -f ...caddy.log I still get a 404 during the DNS-01 challenge. The trailing . is fixed, but still only the tld is included in the fqdn URL instead of mydomain.tld.

In the xcaddy build's stdout, it reflects I'm on 6517b24 from caddy-dns/digitalocean and f11d70 from libdns/digitalocean, so I believe I'm up to date. Do these changes need to be reflected further upstream in caddyserver/caddy/v2?

mholt commented 4 years ago

@scoobybejesus This change won't truncate the domain like that, can you open an issue on the Caddy repo?

Here's a template, please fill it out completely to be sure there's enough information to reproduce it as minimally as possible:

Template

## 1. Environment

### 1a. Operating system and version

```
paste here
```

### 1b. Caddy version (run `caddy version` or paste commit SHA)

```
paste here
```

### 1c. Go version (if building Caddy from source; run `go version`)

```
paste here
```

## 2. Description

### 2a. What happens (briefly explain what is wrong)

### 2b. Why it's a bug (if it's not obvious)

### 2c. Log output

```
paste terminal output or logs here
```

### 2d. Workaround(s)

### 2e. Relevant links

## 3. Tutorial (minimal steps to reproduce the bug)

Helpful tips

  1. Environment: Please fill out your OS and Caddy versions, even if you don't think they are relevant. (They are always relevant.) If you built Caddy from source, provide the commit SHA and specify your exact Go version.

  2. Description: Describe at a high level what the bug is. What happens? Why is it a bug? Not all bugs are obvious, so convince readers that it's actually a bug.

    • 2c) Log output: Paste terminal output and/or complete logs in a code block. DO NOT REDACT INFORMATION except for credentials.
    • 2d) Workaround: What are you doing to work around the problem in the meantime? This can help others who encounter the same problem, until we implement a fix.
    • 2e) Relevant links: Please link to any related issues, pull requests, docs, and/or discussion. This can add crucial context to your report.
  3. Tutorial: What are the minimum required specific steps someone needs to take in order to experience the same bug? Your goal here is to make sure that anyone else can have the same experience with the bug as you do. You are writing a tutorial, so make sure to carry it out yourself before posting it. Please:

    • Start with an empty config. Add only the lines/parameters that are absolutely required to reproduce the bug.
    • Do not run Caddy inside containers.
    • Run Caddy manually in your terminal; do not use systemd or other init systems.
    • If making HTTP requests, avoid web browsers. Use a simpler HTTP client instead, like curl.
    • Do not redact any information from your config (except credentials). Domain names are public knowledge and often necessary for quick resolution of an issue!
    • Note that ignoring this advice may result in delays, or even in your issue being closed. 😞 Only actionable issues are kept open, and if there is not enough information or clarity to reproduce the bug, then the report is not actionable.

Example of a tutorial:

Create a config file: ``` { ... } ``` Open terminal and run Caddy: ``` $ caddy ... ``` Make an HTTP request: ``` $ curl ... ``` Notice that the result is ___ but it should be ___.