Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add DNS provider for Variomedia #1654

Merged
merged 1 commit into from
Jun 6, 2022
Merged

Conversation

ldez
Copy link
Member

@ldez ldez commented Jun 6, 2022

  • have a homogeneous design with the other providers
  • pass the linter
  • do go mod tidy
  • add tests (units)
  • add tests ("live")
  • add a provider descriptor
  • generate CLI help, documentation, and readme.
  • be able to do: (and put the output of this command to a comment)
rm -rf .lego/

VARIOMEDIA_API_TOKEN=xxx ./lego -m [email protected] --dns variomedia -d *.example.com -d example.com -s https://acme-staging-v02.api.letsencrypt.org/directory run

Note the wildcard domain is important.

@SIMULATAN could you test by running the previous command (you have to use a real domain and email)?

Closes #1637

@ldez ldez added enhancement area/dnsprovider state/need-user-tests Need users to test functionality labels Jun 6, 2022
@ldez ldez added this to the v4.8 milestone Jun 6, 2022
@SIMULATAN
Copy link

SIMULATAN commented Jun 6, 2022

I'll do that real quick!

One quick question: I found some of my placeholder values in the code, is that on purpose?
For example here: https://github.com/go-acme/lego/pull/1654/files#diff-964f1c0847ff2e18a14c04de7e463833ef723fff9e5dd8d6dd399b15cbe4db60R100-R101

EDIT: just read through the code and it seems like it indeed was on purpose, sorry!

@SIMULATAN
Copy link

SIMULATAN commented Jun 6, 2022

It ran through and the last log line includes Server responded with a certificate, so it seems good!
I uploaded the full log here: https://gist.github.com/SIMULATAN/c753f8a225d61d2cbd963c3596609417
The certificates directory contains _.example.com with the extensions .crt, .issuer.crt, .json, .key
Also interesting is that the .json file with the metadata (presumably) contains the following json:

{                                                                                                                                                                                                                  
        "domain": "*.example.com",                                                                                                                                                                             
        "certUrl": "https://acme-staging-v02.api.letsencrypt.org/acme/cert/mycert",                                                                                                  
        "certStableUrl": "https://acme-staging-v02.api.letsencrypt.org/acme/cert/mycert"                                                                                             
}

is it a problem that only the wildcard domain is in there? I couldn't find an entry for the root domain alone somewhere.

2022/06/06 18:52:38 No key found for account [email protected]. Generating a P256 key.
2022/06/06 18:52:38 Saved key to /my/path/.lego/accounts/acme-staging-v02.api.letsencrypt.org/[email protected]/keys/[email protected]
2022/06/06 18:52:39 Please review the TOS at https://letsencrypt.org/documents/LE-SA-v1.2-November-15-2017.pdf
Do you accept the TOS? Y/n
y
2022/06/06 18:52:41 [INFO] acme: Registering account for [email protected]
!!!! HEADS UP !!!!

Your account credentials have been saved in your Let's Encrypt
configuration directory at "/my/path/.lego/accounts".

You should make a secure backup of this folder now. This
configuration directory will also contain certificates and
private keys obtained from Let's Encrypt so making regular
backups of this folder is ideal.
2022/06/06 18:52:41 [INFO] [*.example.com, example.com] acme: Obtaining bundled SAN certificate
2022/06/06 18:52:42 [INFO] [*.example.com] AuthURL: https://acme-staging-v02.api.letsencrypt.org/acme/authz-v3/080808
2022/06/06 18:52:42 [INFO] [example.com] AuthURL: https://acme-staging-v02.api.letsencrypt.org/acme/authz-v3/090909
2022/06/06 18:52:42 [INFO] [*.example.com] acme: use dns-01 solver
2022/06/06 18:52:42 [INFO] [example.com] acme: Could not find solver for: tls-alpn-01
2022/06/06 18:52:42 [INFO] [example.com] acme: Could not find solver for: http-01
2022/06/06 18:52:42 [INFO] [example.com] acme: use dns-01 solver
2022/06/06 18:52:42 [INFO] [*.example.com] acme: Preparing to solve DNS-01
2022/06/06 18:52:43 [INFO] Wait for variomedia: apply change on example.com [timeout: 1m0s, interval: 2s]
2022/06/06 18:52:43 [INFO] variomedia: [example.com] 101010: dns-record%!(EXTRA string=pending)
2022/06/06 18:52:45 [INFO] variomedia: [example.com] 101010: dns-record%!(EXTRA string=done)
2022/06/06 18:52:45 [INFO] [*.example.com] acme: Trying to solve DNS-01
2022/06/06 18:52:45 [INFO] [*.example.com] acme: Checking DNS record propagation using [my-dns:53]
2022/06/06 18:52:47 [INFO] Wait for propagation [timeout: 1m0s, interval: 2s]
2022/06/06 18:52:47 [INFO] [*.example.com] acme: Waiting for DNS record propagation.
2022/06/06 18:52:49 [INFO] [*.example.com] acme: Waiting for DNS record propagation.
2022/06/06 18:52:51 [INFO] [*.example.com] acme: Waiting for DNS record propagation.
2022/06/06 18:52:53 [INFO] [*.example.com] acme: Waiting for DNS record propagation.
2022/06/06 18:52:55 [INFO] [*.example.com] acme: Waiting for DNS record propagation.
2022/06/06 18:52:57 [INFO] [*.example.com] acme: Waiting for DNS record propagation.
2022/06/06 18:52:59 [INFO] [*.example.com] acme: Waiting for DNS record propagation.
2022/06/06 18:53:01 [INFO] [*.example.com] acme: Waiting for DNS record propagation.
2022/06/06 18:53:04 [INFO] [*.example.com] acme: Waiting for DNS record propagation.
2022/06/06 18:53:06 [INFO] [*.example.com] acme: Waiting for DNS record propagation.
2022/06/06 18:53:08 [INFO] [*.example.com] acme: Waiting for DNS record propagation.
2022/06/06 18:53:23 [INFO] [*.example.com] The server validated our request
2022/06/06 18:53:23 [INFO] [*.example.com] acme: Cleaning DNS-01 challenge
2022/06/06 18:53:23 [INFO] Wait for variomedia: apply change on example.com [timeout: 1m0s, interval: 2s]
2022/06/06 18:53:23 [INFO] variomedia: [example.com] 111111: dns-record%!(EXTRA string=pending)
2022/06/06 18:53:25 [INFO] variomedia: [example.com] 111111: dns-record%!(EXTRA string=done)
2022/06/06 18:53:25 [INFO] sequence: wait for 1m0s
2022/06/06 18:54:25 [INFO] [example.com] acme: Preparing to solve DNS-01
2022/06/06 18:54:26 [INFO] Wait for variomedia: apply change on example.com [timeout: 1m0s, interval: 2s]
2022/06/06 18:54:26 [INFO] variomedia: [example.com] 121212: dns-record%!(EXTRA string=pending)
2022/06/06 18:54:28 [INFO] variomedia: [example.com] 121212: dns-record%!(EXTRA string=done)
2022/06/06 18:54:28 [INFO] [example.com] acme: Trying to solve DNS-01
2022/06/06 18:54:28 [INFO] [example.com] acme: Checking DNS record propagation using [my-dns:53]
2022/06/06 18:54:30 [INFO] Wait for propagation [timeout: 1m0s, interval: 2s]
2022/06/06 18:54:51 [INFO] [example.com] The server validated our request
2022/06/06 18:54:51 [INFO] [example.com] acme: Cleaning DNS-01 challenge
2022/06/06 18:54:52 [INFO] Wait for variomedia: apply change on example.com [timeout: 1m0s, interval: 2s]
2022/06/06 18:54:52 [INFO] variomedia: [example.com] 131313: dns-record%!(EXTRA string=pending)
2022/06/06 18:54:54 [INFO] variomedia: [example.com] 131313: dns-record%!(EXTRA string=done)
2022/06/06 18:54:54 [INFO] [*.example.com, example.com] acme: Validations succeeded; requesting certificates
2022/06/06 18:54:54 [INFO] [*.example.com] Server responded with a certificate.

@ldez ldez force-pushed the feat/variomedia branch from 8311464 to 49578a5 Compare June 6, 2022 17:22
@ldez
Copy link
Member Author

ldez commented Jun 6, 2022

I fixed the log problem variomedia: [example.com] 131313: dns-record%!(EXTRA string=done).

The log seems right: I see 2 creates and 2 deletes.

@SIMULATAN
Copy link

I just checked the certificate and it seems like it covers both domains, even though the json only states one.
It seems like the full cert gets stored in a file with the name of the first domain passed via the -d flag. This makes sense, but it just confused me.
cert

@ldez ldez removed the state/need-user-tests Need users to test functionality label Jun 6, 2022
@ldez ldez requested a review from dmke June 6, 2022 17:52
Copy link
Member

@dmke dmke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ldez ldez force-pushed the feat/variomedia branch from 49578a5 to 6b8d2b5 Compare June 6, 2022 20:07
@ldez ldez enabled auto-merge (squash) June 6, 2022 20:12
@ldez ldez merged commit 88a2bab into go-acme:master Jun 6, 2022
@ldez ldez deleted the feat/variomedia branch June 6, 2022 20:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

Support for provider: Variomedia
3 participants