Skip to content

Conversation

@nzdjb
Copy link
Contributor

@nzdjb nzdjb commented Jul 15, 2023

Adds Metaname.net as a DNS provider.
Fixes #1586

I'm a customer of Metaname and happy to maintain this.

This implementation is mostly based on the existing ones for Efficient IP and Hosttech.

Tests are added and pass. Linting does as well. Docs are generated.

Sanitised example run including wildcard domain:

$ METANAME_ACCOUNT_REFERENCE=xxxx \
  METANAME_API_KEY=xxxxxxxxxxxxxxxxxxxxxx \
  ./dist/lego -m [email protected] --dns metaname --accept-tos \
  -d test.example.com -d "*.test.example.com" \
  -s https://acme-staging-v02.api.letsencrypt.org/directory run
2023/07/15 09:03:18 No key found for account [email protected]. Generating a P256 key.
2023/07/15 09:03:18 Saved key to /workspaces/lego/.lego/accounts/acme-staging-v02.api.letsencrypt.org/[email protected]/keys/[email protected]
2023/07/15 09:03:19 [INFO] acme: Registering account for [email protected]
!!!! HEADS UP !!!!

Your account credentials have been saved in your Let's Encrypt
configuration directory at "/workspaces/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.
2023/07/15 09:03:19 [INFO] [test.example.com, *.test.example.com] acme: Obtaining bundled SAN certificate
2023/07/15 09:03:20 [INFO] [*.test.example.com] AuthURL: https://acme-staging-v02.api.letsencrypt.org/acme/authz-v3/7312090804
2023/07/15 09:03:20 [INFO] [test.example.com] AuthURL: https://acme-staging-v02.api.letsencrypt.org/acme/authz-v3/7312090814
2023/07/15 09:03:20 [INFO] [*.test.example.com] acme: use dns-01 solver
2023/07/15 09:03:20 [INFO] [test.example.com] acme: Could not find solver for: tls-alpn-01
2023/07/15 09:03:20 [INFO] [test.example.com] acme: Could not find solver for: http-01
2023/07/15 09:03:20 [INFO] [test.example.com] acme: use dns-01 solver
2023/07/15 09:03:20 [INFO] [*.test.example.com] acme: Preparing to solve DNS-01
2023/07/15 09:03:22 [INFO] [test.example.com] acme: Preparing to solve DNS-01
2023/07/15 09:03:23 [INFO] [*.test.example.com] acme: Trying to solve DNS-01
2023/07/15 09:03:23 [INFO] [*.test.example.com] acme: Checking DNS record propagation using [192.168.65.7:53]
2023/07/15 09:03:25 [INFO] Wait for propagation [timeout: 1m0s, interval: 2s]
2023/07/15 09:03:33 [INFO] [*.test.example.com] The server validated our request
2023/07/15 09:03:33 [INFO] [test.example.com] acme: Trying to solve DNS-01
2023/07/15 09:03:33 [INFO] [test.example.com] acme: Checking DNS record propagation using [192.168.65.7:53]
2023/07/15 09:03:35 [INFO] Wait for propagation [timeout: 1m0s, interval: 2s]
2023/07/15 09:03:36 [INFO] [test.example.com] The server validated our request
2023/07/15 09:03:36 [INFO] [*.test.example.com] acme: Cleaning DNS-01 challenge
2023/07/15 09:03:37 [INFO] [test.example.com] acme: Cleaning DNS-01 challenge
2023/07/15 09:03:39 [INFO] [test.example.com, *.test.example.com] acme: Validations succeeded; requesting certificates
2023/07/15 09:03:39 [INFO] Wait for certificate [timeout: 30s, interval: 500ms]
2023/07/15 09:03:40 [INFO] [test.example.com] Server responded with a certificate.

@ldez
Copy link
Member

ldez commented Jul 15, 2023

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 [email protected] --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

@ldez ldez force-pushed the feat/metaname-provider branch from 20e22c7 to 43d1084 Compare July 15, 2023 10:33
@ldez ldez added this to the v4.13 milestone Jul 15, 2023
@ldez ldez self-requested a review July 15, 2023 10:48
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.

LGTM

@ldez ldez merged commit d4f31eb into go-acme:master Jul 15, 2023
@ldez ldez changed the title Add Metaname.net as DNS provider Add DNS provider for Metaname Jul 20, 2023
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: Metaname

2 participants