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 g-core labs #1456

Merged
merged 4 commits into from Jul 22, 2021
Merged

Add DNS provider for g-core labs #1456

merged 4 commits into from Jul 22, 2021

Conversation

shubinmi
Copy link
Contributor

@shubinmi shubinmi commented Jul 22, 2021

Extending of DNS providers with G-Core DNS Service https://gcorelabs.com/dns/

related to #1455 (comment)

$ GCORE_PERMANENT_API_TOKEN="myToken" ./dist/lego -m my@gmail.com --dns gcore -d '*.g-core.tk' -d g-core.tk -s https://acme-staging-v02.api.letsencrypt.org/directory run
2021/07/20 12:05:04 No key found for account my@gmail.com. Generating a P256 key.
2021/07/20 12:05:04 Saved key to /Users/maxim/develope/local/gcore/lego-gcore/.lego/accounts/acme-staging-v02.api.letsencrypt.org/my@gmail.com/keys/my@gmail.com.key
2021/07/20 12:05:05 Please review the TOS at https://letsencrypt.org/documents/LE-SA-v1.2-November-15-2017.pdf
Do you accept the TOS? Y/n
н
Your input was invalid. Please answer with one of Y/y, n/N or by pressing enter.
Do you accept the TOS? Y/n
y
2021/07/20 12:05:12 [INFO] acme: Registering account for shubinmi@gmail.com
!!!! HEADS UP !!!!

Your account credentials have been saved in your Let's Encrypt
configuration directory at "/Users/maxim/develope/local/gcore/lego-gcore/.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/07/20 12:05:12 [INFO] [*.g-core.tk, g-core.tk] acme: Obtaining bundled SAN certificate
2021/07/20 12:05:13 [INFO] [*.g-core.tk] AuthURL: https://acme-staging-v02.api.letsencrypt.org/acme/authz-v3/93175922
2021/07/20 12:05:13 [INFO] [g-core.tk] AuthURL: https://acme-staging-v02.api.letsencrypt.org/acme/authz-v3/93175923
2021/07/20 12:05:13 [INFO] [*.g-core.tk] acme: use dns-01 solver
2021/07/20 12:05:13 [INFO] [g-core.tk] acme: Could not find solver for: tls-alpn-01
2021/07/20 12:05:13 [INFO] [g-core.tk] acme: Could not find solver for: http-01
2021/07/20 12:05:13 [INFO] [g-core.tk] acme: use dns-01 solver
2021/07/20 12:05:13 [INFO] [*.g-core.tk] acme: Preparing to solve DNS-01
2021/07/20 12:05:13 [INFO] [g-core.tk] acme: Preparing to solve DNS-01
2021/07/20 12:05:14 [INFO] [*.g-core.tk] acme: Trying to solve DNS-01
2021/07/20 12:05:14 [INFO] [*.g-core.tk] acme: Checking DNS record propagation using [10.254.1.140:53 10.254.0.140:53]
2021/07/20 12:05:34 [INFO] Wait for propagation [timeout: 6m0s, interval: 20s]
2021/07/20 12:05:34 [INFO] [*.g-core.tk] acme: Waiting for DNS record propagation.
2021/07/20 12:05:54 [INFO] [*.g-core.tk] acme: Waiting for DNS record propagation.
2021/07/20 12:06:14 [INFO] [*.g-core.tk] acme: Waiting for DNS record propagation.
2021/07/20 12:06:36 [INFO] [*.g-core.tk] The server validated our request
2021/07/20 12:06:36 [INFO] [g-core.tk] acme: Trying to solve DNS-01
2021/07/20 12:06:36 [INFO] [g-core.tk] acme: Checking DNS record propagation using [10.254.1.140:53 10.254.0.140:53]
2021/07/20 12:06:56 [INFO] Wait for propagation [timeout: 6m0s, interval: 20s]
2021/07/20 12:07:02 [INFO] [g-core.tk] The server validated our request
2021/07/20 12:07:02 [INFO] [*.g-core.tk] acme: Cleaning DNS-01 challenge
2021/07/20 12:07:02 [INFO] [g-core.tk] acme: Cleaning DNS-01 challenge
2021/07/20 12:07:03 [INFO] [*.g-core.tk, g-core.tk] acme: Validations succeeded; requesting certificates
2021/07/20 12:07:03 [INFO] [*.g-core.tk] Server responded with a certificate.

I am a member of g-core labs.

@ldez
Copy link
Member

ldez commented Jul 22, 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

@ldez ldez changed the title Add G-Core Labs as new DNS provider Add DNS provider for g-core labs Jul 22, 2021
@ldez ldez added this to the v4.5 milestone Jul 22, 2021
@ldez ldez self-requested a review July 22, 2021 10:03
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 71a3bbc into go-acme:master Jul 22, 2021
@shubinmi
Copy link
Contributor Author

shubinmi commented Aug 5, 2021

@ldez hey,
what is the estimated date of the next release with GCore provider?

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.

None yet

2 participants