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 Baidu Cloud #2505

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

Conversation

ldez
Copy link
Member

@ldez ldez commented Apr 11, 2025

  • 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
    
    BAIDUCLOUD_ACCESS_KEY_ID="xxx" \
    BAIDUCLOUD_SECRET_ACCESS_KEY="yyy" \
    ./dist/lego --email [email protected] --dns baiducloud -d '*.example.com' -d example.com -s https://acme-staging-v02.api.letsencrypt.org/directory  run
    Note that the wildcard domain is important.
  • pass the linter
  • do go mod tidy

Ping @hgc357341051, can you run the command (with your domain, email, credentials, etc.)?

Closes #2504

How to test this PR?
  1. You need Go
  2. Check out the PR:
    git clone https://github.com/ldez/lego.git
    cd lego
    git checkout feat/baiducloud
  3. Compile lego:
    • if you have make: make build
    • if you don't make make: go build -o dist/lego ./cmd/lego
  4. Run the following command with your information (email, domain, credentials):
    BAIDUCLOUD_ACCESS_KEY_ID="xxx" \
    BAIDUCLOUD_SECRET_ACCESS_KEY="yyy" \
    ./dist/lego --email [email protected] --dns baiducloud -d '*.example.com' -d example.com -s https://acme-staging-v02.api.letsencrypt.org/directory run
    The wildcard domain is important
  5. Before each run of the command, you should clean your local environment:
    rm -rf .lego

@ldez

This comment was marked as outdated.

@ldez
Copy link
Member Author

ldez commented Apr 11, 2025

First, the comments are public; are you sure to want to publish the access key and secret key publicly?

You must also provide a domain.

@hgc357341051
Copy link

First, the comments are public; are you sure to want to publish the access key and secret key publicly?

You must also provide a domain.

Yes, it's okay. I'll delete it later. Domain: 0559ah.top

@hgc357341051
Copy link

First, the comments are public; are you sure to want to publish the access key and secret key publicly?
You must also provide a domain.

Yes, it's okay. I'll delete it later. Domain: 0559ah.top

Please let me know when the test is over and I will delete it

@ldez
Copy link
Member Author

ldez commented Apr 11, 2025

It works:

$ rm -rf .lego 
$ BAIDUCLOUD_ACCESS_KEY_ID=""xxx"\
BAIDUCLOUD_SECRET_ACCESS_KEY="xxx" \
./dist/lego --email [email protected] --dns baiducloud -d '*.0559ah.top' -d 0559ah.top -s https://acme-staging-v02.api.letsencrypt.org/directory run
2025/04/11 05:16:50 No key found for account [email protected]. Generating a P256 key.
2025/04/11 05:16:50 Saved key to /home/ldez/sources/go-acme/lego/.lego/accounts/acme-staging-v02.api.letsencrypt.org/[email protected]/keys/[email protected]
2025/04/11 05:16:50 Please review the TOS at https://letsencrypt.org/documents/LE-SA-v1.5-February-24-2025.pdf
Do you accept the TOS? Y/n
y
2025/04/11 05:16:52 [INFO] acme: Registering account for [email protected]
!!!! HEADS UP !!!!

Your account credentials have been saved in your
configuration directory at "/home/ldez/sources/go-acme/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 the ACME server so making regular
backups of this folder is ideal.
2025/04/11 05:16:53 [INFO] [*.0559ah.top, 0559ah.top] acme: Obtaining bundled SAN certificate
2025/04/11 05:16:53 [INFO] [*.0559ah.top] AuthURL: https://acme-staging-v02.api.letsencrypt.org/acme/authz/194659574/16759259784
2025/04/11 05:16:53 [INFO] [0559ah.top] AuthURL: https://acme-staging-v02.api.letsencrypt.org/acme/authz/194659574/16759259794
2025/04/11 05:16:53 [INFO] [*.0559ah.top] acme: use dns-01 solver
2025/04/11 05:16:53 [INFO] [0559ah.top] acme: Could not find solver for: tls-alpn-01
2025/04/11 05:16:53 [INFO] [0559ah.top] acme: Could not find solver for: http-01
2025/04/11 05:16:53 [INFO] [0559ah.top] acme: use dns-01 solver
2025/04/11 05:16:53 [INFO] [*.0559ah.top] acme: Preparing to solve DNS-01
2025/04/11 05:16:56 [INFO] [0559ah.top] acme: Preparing to solve DNS-01
2025/04/11 05:16:57 [INFO] [*.0559ah.top] acme: Trying to solve DNS-01
2025/04/11 05:16:57 [INFO] [*.0559ah.top] acme: Checking DNS record propagation. [nameservers=192.168.1.1:53,[2a02:842b:5a8:b601:ce19:a8ff:fe05:c8ff]:53]
2025/04/11 05:16:59 [INFO] Wait for propagation [timeout: 1m0s, interval: 2s]
2025/04/11 05:17:06 [INFO] [*.0559ah.top] The server validated our request
2025/04/11 05:17:06 [INFO] [0559ah.top] acme: Trying to solve DNS-01
2025/04/11 05:17:06 [INFO] [0559ah.top] acme: Checking DNS record propagation. [nameservers=192.168.1.1:53,[2a02:842b:5a8:b601:ce19:a8ff:fe05:c8ff]:53]
2025/04/11 05:17:08 [INFO] Wait for propagation [timeout: 1m0s, interval: 2s]
2025/04/11 05:17:13 [INFO] [0559ah.top] The server validated our request
2025/04/11 05:17:13 [INFO] [*.0559ah.top] acme: Cleaning DNS-01 challenge
2025/04/11 05:17:15 [INFO] [0559ah.top] acme: Cleaning DNS-01 challenge
2025/04/11 05:17:17 [INFO] [*.0559ah.top, 0559ah.top] acme: Validations succeeded; requesting certificates
2025/04/11 05:17:17 [INFO] Wait for certificate [timeout: 30s, interval: 500ms]
2025/04/11 05:17:20 [INFO] [*.0559ah.top] Server responded with a certificate.

Thank you for the account and the domain. You can delete it now.

@ldez ldez removed the state/need-user-tests Need users to test functionality label Apr 11, 2025
@ldez ldez added this to the v4.23 milestone Apr 11, 2025
@ldez ldez requested a review from dmke April 11, 2025 03:21
@ldez ldez mentioned this pull request Apr 11, 2025
5 tasks
@ldez
Copy link
Member Author

ldez commented Apr 11, 2025

The PR will be reviewed and merged in a few days.

@ldez ldez modified the milestones: v4.23, unreleased Apr 12, 2025
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: Baidu Cloud
2 participants