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 VinylDNS #1384

Merged
merged 7 commits into from
Apr 10, 2021
Merged

Add DNS provider for VinylDNS #1384

merged 7 commits into from
Apr 10, 2021

Conversation

jhg03a
Copy link
Contributor

@jhg03a jhg03a commented Apr 8, 2021

This PR adds DNS-01 provider support for VinylDNS. VinylDNS is an open-source abstraction and governance DNS provider that leverages rfc2136 DNS backends such as BIND.

@ldez
Copy link
Member

ldez commented Apr 8, 2021

Hello, in order for a PR adding a DNS provider to be accepted, you have to:

  • add a description to your PR
  • be able to maintain this provider
  • have a homogeneous design with the other providers
  • add tests (units)
make test
  • add tests ("live")
    func TestLivePresent(t *testing.T) {
    if !envTest.IsLiveTest() {
    t.Skip("skipping live test")
    }
    envTest.RestoreEnv()
    provider, err := NewDNSProvider()
    require.NoError(t, err)
    err = provider.Present(envTest.GetDomain(), "", "123d==")
    require.NoError(t, err)
    }
    func TestLiveCleanUp(t *testing.T) {
    if !envTest.IsLiveTest() {
    t.Skip("skipping live test")
    }
    envTest.RestoreEnv()
    provider, err := NewDNSProvider()
    require.NoError(t, err)
    time.Sleep(2 * time.Second)
    err = provider.CleanUp(envTest.GetDomain(), "", "123d==")
    require.NoError(t, err)
    }
make test
make generate-dns
  • be able to do: (and put the output of this command to a comment in your PR)
rm -rf .lego

./lego -m your@email.com --dns YOUR_PROVIDER_NAME -d *.example.com -d example.com -s https://acme-staging-v02.api.letsencrypt.org/directory run

Note the wildcard domain is important.

make checks
  • do go mod tidy

The VinylDNS backend has an issue with dotted hostname governance when a SOA record matches one of the requested ACME domains.  It will accept the RecordSet changes, but will fail to create them silently in the background.  This solution leverages the native lego functions to obtain the SOA in which the RecordSet should be placed rather than assuming it's always needs to use a dotted hostname.
@jhg03a
Copy link
Contributor Author

jhg03a commented Apr 9, 2021

$ ./lego -m user@example.com -a --dns vinyldns -d *.domain.example.com -d domain.example.com -s https://acme-staging-v02.api.letsencrypt.org/directory run
2021/04/08 17:51:35 No key found for account user@example.com. Generating a P256 key.
2021/04/08 17:51:35 Saved key to /Users/user/go/src/github.com/go-acme/lego/dist/.lego/accounts/acme-staging-v02.api.letsencrypt.org/user@example.com/keys/user@example.com.key
2021/04/08 17:51:36 [INFO] acme: Registering account for user@example.com
!!!! HEADS UP !!!!

Your account credentials have been saved in your Let's Encrypt
configuration directory at "/Users/user/go/src/github.com/go-acme/lego/dist/.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.
2021/04/08 17:51:36 [INFO] [*.domain.example.com, domain.example.com] acme: Obtaining bundled SAN certificate
2021/04/08 17:51:36 [INFO] [*.domain.example.com] AuthURL: https://acme-staging-v02.api.letsencrypt.org/acme/authz-v3/24730502
2021/04/08 17:51:36 [INFO] [domain.example.com] AuthURL: https://acme-staging-v02.api.letsencrypt.org/acme/authz-v3/24730503
2021/04/08 17:51:36 [INFO] [*.domain.example.com] acme: use dns-01 solver
2021/04/08 17:51:36 [INFO] [domain.example.com] acme: Could not find solver for: tls-alpn-01
2021/04/08 17:51:36 [INFO] [domain.example.com] acme: Could not find solver for: http-01
2021/04/08 17:51:36 [INFO] [domain.example.com] acme: use dns-01 solver
2021/04/08 17:51:36 [INFO] [*.domain.example.com] acme: Preparing to solve DNS-01
2021/04/08 17:51:37 [INFO] Wait for vinyldns [timeout: 2m0s, interval: 4s]
2021/04/08 17:51:41 [INFO] [domain.example.com] acme: Preparing to solve DNS-01
2021/04/08 17:51:42 [INFO] Wait for vinyldns [timeout: 2m0s, interval: 4s]
2021/04/08 17:51:46 [INFO] [*.domain.example.com] acme: Trying to solve DNS-01
2021/04/08 17:51:46 [INFO] [*.domain.example.com] acme: Checking DNS record propagation using [8.8.8.8:53 8.8.4.4:53]
2021/04/08 17:51:50 [INFO] Wait for propagation [timeout: 2m0s, interval: 4s]
2021/04/08 17:51:50 [INFO] [*.domain.example.com] acme: Waiting for DNS record propagation.
2021/04/08 17:51:54 [INFO] [*.domain.example.com] acme: Waiting for DNS record propagation.
2021/04/08 17:51:58 [INFO] [*.domain.example.com] acme: Waiting for DNS record propagation.
2021/04/08 17:52:03 [INFO] [*.domain.example.com] acme: Waiting for DNS record propagation.
2021/04/08 17:52:07 [INFO] [*.domain.example.com] acme: Waiting for DNS record propagation.
2021/04/08 17:52:11 [INFO] [*.domain.example.com] acme: Waiting for DNS record propagation.
2021/04/08 17:52:15 [INFO] [*.domain.example.com] acme: Waiting for DNS record propagation.
2021/04/08 17:52:19 [INFO] [*.domain.example.com] acme: Waiting for DNS record propagation.
2021/04/08 17:52:23 [INFO] [*.domain.example.com] acme: Waiting for DNS record propagation.
2021/04/08 17:52:27 [INFO] [*.domain.example.com] acme: Waiting for DNS record propagation.
2021/04/08 17:52:31 [INFO] [*.domain.example.com] acme: Waiting for DNS record propagation.
2021/04/08 17:52:36 [INFO] [*.domain.example.com] acme: Waiting for DNS record propagation.
2021/04/08 17:52:40 [INFO] [*.domain.example.com] acme: Waiting for DNS record propagation.
2021/04/08 17:52:44 [INFO] [*.domain.example.com] acme: Waiting for DNS record propagation.
2021/04/08 17:52:48 [INFO] [*.domain.example.com] acme: Waiting for DNS record propagation.
2021/04/08 17:52:52 [INFO] [*.domain.example.com] acme: Waiting for DNS record propagation.
2021/04/08 17:52:56 [INFO] [*.domain.example.com] acme: Waiting for DNS record propagation.
2021/04/08 17:53:00 [INFO] [*.domain.example.com] acme: Waiting for DNS record propagation.
2021/04/08 17:53:04 [INFO] [*.domain.example.com] acme: Waiting for DNS record propagation.
2021/04/08 17:53:09 [INFO] [*.domain.example.com] acme: Waiting for DNS record propagation.
2021/04/08 17:53:13 [INFO] [*.domain.example.com] acme: Waiting for DNS record propagation.
2021/04/08 17:53:17 [INFO] [*.domain.example.com] acme: Waiting for DNS record propagation.
2021/04/08 17:53:21 [INFO] [*.domain.example.com] acme: Waiting for DNS record propagation.
2021/04/08 17:53:25 [INFO] [*.domain.example.com] acme: Waiting for DNS record propagation.
2021/04/08 17:53:36 [INFO] [*.domain.example.com] The server validated our request
2021/04/08 17:53:36 [INFO] [domain.example.com] acme: Trying to solve DNS-01
2021/04/08 17:53:36 [INFO] [domain.example.com] acme: Checking DNS record propagation using [8.8.8.8:53 8.8.4.4:53]
2021/04/08 17:53:40 [INFO] Wait for propagation [timeout: 2m0s, interval: 4s]
2021/04/08 17:53:50 [INFO] [domain.example.com] acme: Waiting for DNS record propagation.
2021/04/08 17:54:02 [INFO] [domain.example.com] The server validated our request
2021/04/08 17:54:02 [INFO] [*.domain.example.com] acme: Cleaning DNS-01 challenge
2021/04/08 17:54:02 [INFO] Wait for vinyldns [timeout: 2m0s, interval: 4s]
2021/04/08 17:54:07 [INFO] [domain.example.com] acme: Cleaning DNS-01 challenge
2021/04/08 17:54:07 [INFO] Wait for vinyldns [timeout: 2m0s, interval: 4s]
2021/04/08 17:54:11 [INFO] [*.domain.example.com, domain.example.com] acme: Validations succeeded; requesting certificates
2021/04/08 17:54:11 [INFO] [*.domain.example.com] Server responded with a certificate.

@jhg03a
Copy link
Contributor Author

jhg03a commented Apr 9, 2021

When building out this provider, I did use the Route53 provider as a reference for design homogeny.

@ldez ldez force-pushed the vinyldns-provider branch from c495b99 to 3db1fd9 Compare April 10, 2021 02:29
@ldez ldez added this to the v4.4 milestone Apr 10, 2021
Copy link
Member

@ldez ldez left a comment

Choose a reason for hiding this comment

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

Thanks 👍

@ldez ldez changed the title Add support for VinylDNS DNS-01 Provider Add DNS provider for VinylDNS Apr 10, 2021
@ldez ldez merged commit 7f53f88 into go-acme:master Apr 10, 2021
@jhg03a jhg03a deleted the vinyldns-provider branch April 12, 2021 14:38
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.

2 participants