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 mijn.host #2252

Merged
merged 7 commits into from
Aug 29, 2024
Merged

Add DNS provider for mijn.host #2252

merged 7 commits into from
Aug 29, 2024

Conversation

ldez
Copy link
Member

@ldez ldez commented Aug 28, 2024

  • adds a description to your PR
  • have a homogeneous design with the other providers
  • 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)
    make build
    rm -rf .lego
    
    MIJNHOST_API_KEY=yyyy \
    ./dist/lego -m [email protected] --dns mijnhost -d *.example.com -d example.com -s https://acme-staging-v02.api.letsencrypt.org/directory run
    Note the wildcard domain is important.
  • pass the linter
  • do go mod tidy

Ping @shubhamku044, can you run the command (with your domain, email, and credentials)?

-> #2252 (comment)

Closes #2251

@mijnhost
Copy link

I think name should be mijn.host, not just mijn. As it's means "my" but in Dutch.
If a dot is not supported, perhaps one word or with a space in between.

@shubhamku044

This comment has been minimized.

@ldez
Copy link
Member Author

ldez commented Aug 28, 2024

@egogo-nl I updated the implementation and the issue description, feel free to test this PR.

@ldez
Copy link
Member Author

ldez commented Aug 28, 2024

It is surprising that several users of a currently unsupported provider arrive so quickly on a PR freshly opened, so I assume, and this is only an assumption, this is linked to a particular need of a company.

So, sponsoring is a good way to sustain open-source maintainers: sponsor me

@shubhamku044
Copy link

shubhamku044 commented Aug 28, 2024

When I ran the command, I got the below output

Click to view the output
2024/08/28 21:30:08 No key found for account [email protected]. Generating a P256 key.
2024/08/28 21:30:08 Saved key to /Users/shubhamkumar/Developer/lego/.lego/accounts/acme-staging-v02.api.letsencrypt.org/[email protected]/keys/[email protected]
2024/08/28 21:30:10 Please review the TOS at https://letsencrypt.org/documents/LE-SA-v1.4-April-3-2024.pdf
Do you accept the TOS? Y/n
Y
2024/08/28 21:30:14 [INFO] acme: Registering account for [email protected]
!!!! HEADS UP !!!!

Your account credentials have been saved in your Let's Encrypt
configuration directory at "/Users/shubhamkumar/Developer/lego/.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.
2024/08/28 21:30:14 [INFO] [*.testdomein12345.nl, testdomein12345.nl] acme: Obtaining bundled SAN certificate
2024/08/28 21:30:16 [INFO] [*.testdomein12345.nl] AuthURL: https://acme-staging-v02.api.letsencrypt.org/acme/authz-v3/13773253133
2024/08/28 21:30:16 [INFO] [testdomein12345.nl] AuthURL: https://acme-staging-v02.api.letsencrypt.org/acme/authz-v3/13773253143
2024/08/28 21:30:16 [INFO] [*.testdomein12345.nl] acme: use dns-01 solver
2024/08/28 21:30:16 [INFO] [testdomein12345.nl] acme: Could not find solver for: tls-alpn-01
2024/08/28 21:30:16 [INFO] [testdomein12345.nl] acme: Could not find solver for: http-01
2024/08/28 21:30:16 [INFO] [testdomein12345.nl] acme: use dns-01 solver
2024/08/28 21:30:16 [INFO] [*.testdomein12345.nl] acme: Preparing to solve DNS-01
2024/08/28 21:30:27 [INFO] [testdomein12345.nl] acme: Preparing to solve DNS-01
2024/08/28 21:30:38 [INFO] [*.testdomein12345.nl] acme: Trying to solve DNS-01
2024/08/28 21:30:39 [INFO] [*.testdomein12345.nl] acme: Checking DNS record propagation. [nameservers=8.8.8.8:53,4.2.2.2:53]
2024/08/28 21:30:41 [INFO] Wait for propagation [timeout: 1m0s, interval: 2s]
2024/08/28 21:30:45 [INFO] [*.testdomein12345.nl] acme: Waiting for DNS record propagation.
2024/08/28 21:30:49 [INFO] [*.testdomein12345.nl] acme: Waiting for DNS record propagation.
2024/08/28 21:30:54 [INFO] [*.testdomein12345.nl] acme: Waiting for DNS record propagation.
2024/08/28 21:30:59 [INFO] [*.testdomein12345.nl] acme: Waiting for DNS record propagation.
2024/08/28 21:31:01 [INFO] [*.testdomein12345.nl] acme: Waiting for DNS record propagation.
2024/08/28 21:31:04 [INFO] [*.testdomein12345.nl] acme: Waiting for DNS record propagation.
2024/08/28 21:31:08 [INFO] [*.testdomein12345.nl] acme: Waiting for DNS record propagation.
2024/08/28 21:31:10 [INFO] [*.testdomein12345.nl] acme: Waiting for DNS record propagation.
2024/08/28 21:31:13 [INFO] [*.testdomein12345.nl] acme: Waiting for DNS record propagation.
2024/08/28 21:31:24 [INFO] [*.testdomein12345.nl] The server validated our request
2024/08/28 21:31:24 [INFO] [*.testdomein12345.nl] acme: Cleaning DNS-01 challenge
2024/08/28 21:31:34 [INFO] [testdomein12345.nl] acme: Cleaning DNS-01 challenge
2024/08/28 21:31:44 [INFO] Skipping deactivating of valid auth: https://acme-staging-v02.api.letsencrypt.org/acme/authz-v3/13773253133
2024/08/28 21:31:44 [INFO] Deactivating auth: https://acme-staging-v02.api.letsencrypt.org/acme/authz-v3/13773253143
2024/08/28 21:31:44 Could not obtain certificates:
        error: one or more domains had a problem:
[testdomein12345.nl] [testdomein12345.nl] acme: error presenting token: mijnhost: update records: 400: Duplicate RRset _acme-challenge.testdomein12345.nl. IN TXT with changetype: REPLACE

@ldez
Copy link
Member Author

ldez commented Aug 28, 2024

mijnhost: update records: 400: Duplicate RRset _acme-challenge.testdomein12345.nl. IN TXT with changetype: REPLACE

I guess that mijn.host doesn't support multiple TXT records for the same domain, so I will use a sequential approach.

@ldez
Copy link
Member Author

ldez commented Aug 28, 2024

I updated the PR, can you try again?

@shubhamku044
Copy link

I tried it again.

Click here to see the output
2024/08/29 10:12:36 No key found for account [email protected]. Generating a P256 key.
2024/08/29 10:12:36 Saved key to /Users/shubhamkumar/Developer/lego/.lego/accounts/acme-staging-v02.api.letsencrypt.org/[email protected]/keys/[email protected]
2024/08/29 10:12:38 Please review the TOS at https://letsencrypt.org/documents/LE-SA-v1.4-April-3-2024.pdf
Do you accept the TOS? Y/n
Y
2024/08/29 10:12:41 [INFO] acme: Registering account for [email protected]
!!!! HEADS UP !!!!

Your account credentials have been saved in your Let's Encrypt
configuration directory at "/Users/shubhamkumar/Developer/lego/.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.
2024/08/29 10:12:42 [INFO] [*.testdomein12345.nl, testdomein12345.nl] acme: Obtaining bundled SAN certificate
2024/08/29 10:12:43 [INFO] [*.testdomein12345.nl] AuthURL: https://acme-staging-v02.api.letsencrypt.org/acme/authz-v3/13780754553
2024/08/29 10:12:43 [INFO] [testdomein12345.nl] AuthURL: https://acme-staging-v02.api.letsencrypt.org/acme/authz-v3/13780754563
2024/08/29 10:12:43 [INFO] [*.testdomein12345.nl] acme: use dns-01 solver
2024/08/29 10:12:43 [INFO] [testdomein12345.nl] acme: Could not find solver for: tls-alpn-01
2024/08/29 10:12:43 [INFO] [testdomein12345.nl] acme: Could not find solver for: http-01
2024/08/29 10:12:43 [INFO] [testdomein12345.nl] acme: use dns-01 solver
2024/08/29 10:12:43 [INFO] [*.testdomein12345.nl] acme: Preparing to solve DNS-01
2024/08/29 10:12:55 [INFO] [*.testdomein12345.nl] acme: Trying to solve DNS-01
2024/08/29 10:12:56 [INFO] [*.testdomein12345.nl] acme: Checking DNS record propagation. [nameservers=8.8.8.8:53,4.2.2.2:53]
2024/08/29 10:12:58 [INFO] Wait for propagation [timeout: 1m0s, interval: 2s]
2024/08/29 10:13:05 [INFO] [*.testdomein12345.nl] acme: Waiting for DNS record propagation.
2024/08/29 10:13:08 [INFO] [*.testdomein12345.nl] acme: Waiting for DNS record propagation.
2024/08/29 10:13:12 [INFO] [*.testdomein12345.nl] acme: Waiting for DNS record propagation.
2024/08/29 10:13:16 [INFO] [*.testdomein12345.nl] acme: Waiting for DNS record propagation.
2024/08/29 10:13:19 [INFO] [*.testdomein12345.nl] acme: Waiting for DNS record propagation.
2024/08/29 10:13:22 [INFO] [*.testdomein12345.nl] acme: Waiting for DNS record propagation.
2024/08/29 10:13:26 [INFO] [*.testdomein12345.nl] acme: Waiting for DNS record propagation.
2024/08/29 10:13:29 [INFO] [*.testdomein12345.nl] acme: Waiting for DNS record propagation.
2024/08/29 10:13:42 [INFO] [*.testdomein12345.nl] acme: Waiting for DNS record propagation.
2024/08/29 10:13:45 [INFO] [*.testdomein12345.nl] acme: Waiting for DNS record propagation.
2024/08/29 10:13:48 [INFO] [*.testdomein12345.nl] acme: Waiting for DNS record propagation.
2024/08/29 10:14:00 [INFO] [*.testdomein12345.nl] The server validated our request
2024/08/29 10:14:00 [INFO] [*.testdomein12345.nl] acme: Cleaning DNS-01 challenge
2024/08/29 10:14:12 [INFO] sequence: wait for 1m0s
2024/08/29 10:15:12 [INFO] [testdomein12345.nl] acme: Preparing to solve DNS-01
2024/08/29 10:15:23 [INFO] [testdomein12345.nl] acme: Trying to solve DNS-01
2024/08/29 10:15:23 [INFO] [testdomein12345.nl] acme: Checking DNS record propagation. [nameservers=8.8.8.8:53,4.2.2.2:53]
2024/08/29 10:15:25 [INFO] Wait for propagation [timeout: 1m0s, interval: 2s]
2024/08/29 10:15:26 [INFO] [testdomein12345.nl] acme: Waiting for DNS record propagation.
2024/08/29 10:15:28 [INFO] [testdomein12345.nl] acme: Waiting for DNS record propagation.
2024/08/29 10:15:32 [INFO] [testdomein12345.nl] acme: Waiting for DNS record propagation.
2024/08/29 10:15:35 [INFO] [testdomein12345.nl] acme: Waiting for DNS record propagation.
2024/08/29 10:15:38 [INFO] [testdomein12345.nl] acme: Waiting for DNS record propagation.
2024/08/29 10:15:40 [INFO] [testdomein12345.nl] acme: Waiting for DNS record propagation.
2024/08/29 10:15:43 [INFO] [testdomein12345.nl] acme: Waiting for DNS record propagation.
2024/08/29 10:15:46 [INFO] [testdomein12345.nl] acme: Waiting for DNS record propagation.
2024/08/29 10:15:49 [INFO] [testdomein12345.nl] acme: Waiting for DNS record propagation.
2024/08/29 10:15:52 [INFO] [testdomein12345.nl] acme: Waiting for DNS record propagation.
2024/08/29 10:15:55 [INFO] [testdomein12345.nl] acme: Waiting for DNS record propagation.
2024/08/29 10:16:00 [INFO] [testdomein12345.nl] acme: Waiting for DNS record propagation.
2024/08/29 10:16:02 [INFO] [testdomein12345.nl] acme: Waiting for DNS record propagation.
2024/08/29 10:16:05 [INFO] [testdomein12345.nl] acme: Waiting for DNS record propagation.
2024/08/29 10:16:07 [INFO] [testdomein12345.nl] acme: Waiting for DNS record propagation.
2024/08/29 10:16:10 [INFO] [testdomein12345.nl] acme: Waiting for DNS record propagation.
2024/08/29 10:16:13 [INFO] [testdomein12345.nl] acme: Waiting for DNS record propagation.
2024/08/29 10:16:15 [INFO] [testdomein12345.nl] acme: Waiting for DNS record propagation.
2024/08/29 10:16:20 [INFO] [testdomein12345.nl] acme: Waiting for DNS record propagation.
2024/08/29 10:16:22 [INFO] [testdomein12345.nl] acme: Waiting for DNS record propagation.
2024/08/29 10:16:32 [INFO] [testdomein12345.nl] The server validated our request
2024/08/29 10:16:32 [INFO] [testdomein12345.nl] acme: Cleaning DNS-01 challenge
2024/08/29 10:16:42 [INFO] [*.testdomein12345.nl, testdomein12345.nl] acme: Validations succeeded; requesting certificates
2024/08/29 10:16:43 [INFO] Wait for certificate [timeout: 30s, interval: 500ms]
2024/08/29 10:16:45 [INFO] [*.testdomein12345.nl] Server responded with a certificate.

@ldez
Copy link
Member Author

ldez commented Aug 29, 2024

So it's working.

I will just reduce the sequence interval.

@ldez ldez removed the state/need-user-tests Need users to test functionality label Aug 29, 2024
@ldez ldez marked this pull request as ready for review August 29, 2024 13:48
@ldez ldez requested a review from dmke August 29, 2024 13:48
@dmke
Copy link
Member

dmke commented Aug 29, 2024

(Will review later, when the current heat wave has passed a bit. Superficially, this looks OK.)

@ldez ldez added this to the v4.18 milestone Aug 29, 2024
@ldez ldez merged commit f93651a into go-acme:master Aug 29, 2024
4 checks passed
@ldez ldez deleted the feat/mijn branch August 29, 2024 19:07
@mijnhost
Copy link

Thank you both.
@ldez Are you willing to release a new version soon? We would like to become compatible with Traefik.

@ldez
Copy link
Member Author

ldez commented Aug 30, 2024

I will merge some PRs before creating a release (so in a few days), after that I will update Traefik.

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: mijn.host
4 participants