molezz BAR

molezz BAR

记录下那些感想 #book #biotech #software

DNSEXIT Free Subdomain and SSL Certificate Automation API Deployment

image

I saw a free subdomain recommended by @geekbb on X, so I registered to give it a try. Then I found that although it can't be changed to CF resolution, their API features are still quite comprehensive, including DDNS and SSL.

After successful registration, you can click “DNS API Key” in “Settings” to create a new API key, and then you can set up various automated deployments in Linux, mainly for automatic free SSL certificate application and deployment.

First, click "Free SSL Certificates" in the "DOMAINS" menu to enable SSL for the newly registered domain, then create three JSON files in the VPS for automated updates and certificate downloads, for example, in /etc.

  • renew.json
{
   "apikey": "api key",
   "domain": "xx.work.gd",
   "action": "renew",
   "verbose": "true"
}
  • cert.json
{
   "apikey": "api key",
   "domain": "xx.work.gd",
   "action": "download",
   "file": "cert"
}
  • key.json
{
   "apikey": "api key",
   "domain": "xx.work.gd",
   "action": "download",
   "file": "privatekey"
}

Finally, update using bash commands and download to files, which can be set to run monthly in cron. The @/etc/xxx.json needs to be changed to your own path.

# Update certificate
curl -H "Content-Type: application/json" --data @/etc/renew.json https://api.dnsexit.com/dns/lse.jsp

# Download certificate and key and store them in the specified path, such as nginx
curl -H "Content-Type: application/json" --data @/etc/cert.json https://api.dnsexit.com/dns/lse.jsp > /nginx/cert.crt

curl -H "Content-Type: application/json" --data @/etc/key.json https://api.dnsexit.com/dns/lse.jsp > /nginx/key.key

For more commands such as applying for certificates and CA files, please refer to the official documentation, and for DDNS commands, see the documentation.

Loading...
Ownership of this post data is guaranteed by blockchain and smart contracts to the creator alone.