Skip to content

Commit 83ff393

Browse files
authored
Add DNS provider for CPanel and WHM (#1977)
1 parent 719adc3 commit 83ff393

25 files changed

+1778
-28
lines changed

.golangci.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,3 +237,5 @@ issues:
237237
text: 'Duplicate words \(0\) found'
238238
- path: cmd/cmd_renew.go
239239
text: 'cyclomatic complexity 15 of func `renewForDomains` is high'
240+
- path: providers/dns/cpanel/cpanel.go
241+
text: 'cyclomatic complexity 13 of func `\(\*DNSProvider\)\.CleanUp` is high'

README.md

Lines changed: 27 additions & 27 deletions
Large diffs are not rendered by default.

cmd/zz_gen_cmd_dnshelp.go

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ func allDNSCodes() string {
3535
"cloudxns",
3636
"conoha",
3737
"constellix",
38+
"cpanel",
3839
"derak",
3940
"desec",
4041
"designate",
@@ -611,6 +612,31 @@ func displayDNSHelp(w io.Writer, name string) error {
611612
ew.writeln()
612613
ew.writeln(`More information: https://go-acme.github.io/lego/dns/constellix`)
613614

615+
case "cpanel":
616+
// generated from: providers/dns/cpanel/cpanel.toml
617+
ew.writeln(`Configuration for CPanel/WHM.`)
618+
ew.writeln(`Code: 'cpanel'`)
619+
ew.writeln(`Since: 'v4.16.0'`)
620+
ew.writeln()
621+
622+
ew.writeln(`Credentials:`)
623+
ew.writeln(` - "CPANEL_BASE_URL": API server URL`)
624+
ew.writeln(` - "CPANEL_NAMESERVER": Nameserver`)
625+
ew.writeln(` - "CPANEL_TOKEN": API token`)
626+
ew.writeln(` - "CPANEL_USERNAME": username`)
627+
ew.writeln()
628+
629+
ew.writeln(`Additional Configuration:`)
630+
ew.writeln(` - "CPANEL_HTTP_TIMEOUT": API request timeout`)
631+
ew.writeln(` - "CPANEL_MODE": use cpanel API or WHM API (Default: cpanel)`)
632+
ew.writeln(` - "CPANEL_POLLING_INTERVAL": Time between DNS propagation check`)
633+
ew.writeln(` - "CPANEL_PROPAGATION_TIMEOUT": Maximum waiting time for DNS propagation`)
634+
ew.writeln(` - "CPANEL_REGION": The region`)
635+
ew.writeln(` - "CPANEL_TTL": The TTL of the TXT record used for the DNS challenge`)
636+
637+
ew.writeln()
638+
ew.writeln(`More information: https://go-acme.github.io/lego/dns/cpanel`)
639+
614640
case "derak":
615641
// generated from: providers/dns/derak/derak.toml
616642
ew.writeln(`Configuration for Derak Cloud.`)

docs/content/dns/zz_gen_cpanel.md

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
---
2+
title: "CPanel/WHM"
3+
date: 2019-03-03T16:39:46+01:00
4+
draft: false
5+
slug: cpanel
6+
dnsprovider:
7+
since: "v4.16.0"
8+
code: "cpanel"
9+
url: "https://cpanel.net/"
10+
---
11+
12+
<!-- THIS DOCUMENTATION IS AUTO-GENERATED. PLEASE DO NOT EDIT. -->
13+
<!-- providers/dns/cpanel/cpanel.toml -->
14+
<!-- THIS DOCUMENTATION IS AUTO-GENERATED. PLEASE DO NOT EDIT. -->
15+
16+
17+
Configuration for [CPanel/WHM](https://cpanel.net/).
18+
19+
20+
<!--more-->
21+
22+
- Code: `cpanel`
23+
- Since: v4.16.0
24+
25+
26+
Here is an example bash command using the CPanel/WHM provider:
27+
28+
```bash
29+
### CPANEL (default)
30+
31+
CPANEL_USERNAME = "yyyy"
32+
CPANEL_TOKEN = "xxxx"
33+
CPANEL_BASE_URL = "https://example.com:2083" \
34+
CPANEL_NAMESERVER = "ns1.example.com:53" \
35+
lego --email [email protected] --dns cpanel --domains my.example.org run
36+
37+
## WHM
38+
39+
CPANEL_MODE = whm
40+
CPANEL_USERNAME = "yyyy"
41+
CPANEL_TOKEN = "xxxx"
42+
CPANEL_BASE_URL = "https://example.com:2087" \
43+
CPANEL_NAMESERVER = "ns1.example.com:53" \
44+
lego --email [email protected] --dns cpanel --domains my.example.org run
45+
```
46+
47+
48+
49+
50+
## Credentials
51+
52+
| Environment Variable Name | Description |
53+
|-----------------------|-------------|
54+
| `CPANEL_BASE_URL` | API server URL |
55+
| `CPANEL_NAMESERVER` | Nameserver |
56+
| `CPANEL_TOKEN` | API token |
57+
| `CPANEL_USERNAME` | username |
58+
59+
The environment variable names can be suffixed by `_FILE` to reference a file instead of a value.
60+
More information [here]({{< ref "dns#configuration-and-credentials" >}}).
61+
62+
63+
## Additional Configuration
64+
65+
| Environment Variable Name | Description |
66+
|--------------------------------|-------------|
67+
| `CPANEL_HTTP_TIMEOUT` | API request timeout |
68+
| `CPANEL_MODE` | use cpanel API or WHM API (Default: cpanel) |
69+
| `CPANEL_POLLING_INTERVAL` | Time between DNS propagation check |
70+
| `CPANEL_PROPAGATION_TIMEOUT` | Maximum waiting time for DNS propagation |
71+
| `CPANEL_REGION` | The region |
72+
| `CPANEL_TTL` | The TTL of the TXT record used for the DNS challenge |
73+
74+
The environment variable names can be suffixed by `_FILE` to reference a file instead of a value.
75+
More information [here]({{< ref "dns#configuration-and-credentials" >}}).
76+
77+
78+
79+
80+
## More information
81+
82+
83+
84+
<!-- THIS DOCUMENTATION IS AUTO-GENERATED. PLEASE DO NOT EDIT. -->
85+
<!-- providers/dns/cpanel/cpanel.toml -->
86+
<!-- THIS DOCUMENTATION IS AUTO-GENERATED. PLEASE DO NOT EDIT. -->

docs/data/zz_cli_help.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ To display the documentation for a specific DNS provider, run:
137137
$ lego dnshelp -c code
138138
139139
Supported DNS providers:
140-
acme-dns, alidns, allinkl, arvancloud, auroradns, autodns, azure, azuredns, bindman, bluecat, brandit, bunny, checkdomain, civo, clouddns, cloudflare, cloudns, cloudru, cloudxns, conoha, constellix, derak, desec, designate, digitalocean, dnshomede, dnsimple, dnsmadeeasy, dnspod, dode, domeneshop, dreamhost, duckdns, dyn, dynu, easydns, edgedns, efficientip, epik, exec, exoscale, freemyip, gandi, gandiv5, gcloud, gcore, glesys, godaddy, googledomains, hetzner, hostingde, hosttech, httpnet, httpreq, hurricane, hyperone, ibmcloud, iij, iijdpf, infoblox, infomaniak, internetbs, inwx, ionos, ipv64, iwantmyname, joker, liara, lightsail, linode, liquidweb, loopia, luadns, manual, metaname, mydnsjp, mythicbeasts, namecheap, namedotcom, namesilo, nearlyfreespeech, netcup, netlify, nicmanager, nifcloud, njalla, nodion, ns1, oraclecloud, otc, ovh, pdns, plesk, porkbun, rackspace, rcodezero, regru, rfc2136, rimuhosting, route53, safedns, sakuracloud, scaleway, selectel, servercow, simply, sonic, stackpath, tencentcloud, transip, ultradns, variomedia, vegadns, vercel, versio, vinyldns, vkcloud, vscale, vultr, webnames, websupport, wedos, yandex, yandex360, yandexcloud, zoneee, zonomi
140+
acme-dns, alidns, allinkl, arvancloud, auroradns, autodns, azure, azuredns, bindman, bluecat, brandit, bunny, checkdomain, civo, clouddns, cloudflare, cloudns, cloudru, cloudxns, conoha, constellix, cpanel, derak, desec, designate, digitalocean, dnshomede, dnsimple, dnsmadeeasy, dnspod, dode, domeneshop, dreamhost, duckdns, dyn, dynu, easydns, edgedns, efficientip, epik, exec, exoscale, freemyip, gandi, gandiv5, gcloud, gcore, glesys, godaddy, googledomains, hetzner, hostingde, hosttech, httpnet, httpreq, hurricane, hyperone, ibmcloud, iij, iijdpf, infoblox, infomaniak, internetbs, inwx, ionos, ipv64, iwantmyname, joker, liara, lightsail, linode, liquidweb, loopia, luadns, manual, metaname, mydnsjp, mythicbeasts, namecheap, namedotcom, namesilo, nearlyfreespeech, netcup, netlify, nicmanager, nifcloud, njalla, nodion, ns1, oraclecloud, otc, ovh, pdns, plesk, porkbun, rackspace, rcodezero, regru, rfc2136, rimuhosting, route53, safedns, sakuracloud, scaleway, selectel, servercow, simply, sonic, stackpath, tencentcloud, transip, ultradns, variomedia, vegadns, vercel, versio, vinyldns, vkcloud, vscale, vultr, webnames, websupport, wedos, yandex, yandex360, yandexcloud, zoneee, zonomi
141141
142142
More information: https://go-acme.github.io/lego/dns
143143
"""

0 commit comments

Comments
 (0)