mirror of
https://github.com/go-acme/lego.git
synced 2026-01-25 05:06:16 +00:00
chore: cleaning (#2811)
This commit is contained in:
committed by
GitHub
parent
dd80d8b77b
commit
12a393888c
@@ -182,7 +182,7 @@ If your DNS provider is not supported, please open an [issue](https://github.com
|
||||
<td><a href="https://go-acme.github.io/lego/dns/jdcloud/">JD Cloud</a></td>
|
||||
</tr><tr>
|
||||
<td><a href="https://go-acme.github.io/lego/dns/joker/">Joker</a></td>
|
||||
<td><a href="https://go-acme.github.io/lego/dns/acme-dns/">Joohoi's ACME-DNS</a></td>
|
||||
<td><a href="https://go-acme.github.io/lego/dns/acmedns/">Joohoi's ACME-DNS</a></td>
|
||||
<td><a href="https://go-acme.github.io/lego/dns/keyhelp/">KeyHelp</a></td>
|
||||
<td><a href="https://go-acme.github.io/lego/dns/liara/">Liara</a></td>
|
||||
</tr><tr>
|
||||
@@ -278,7 +278,7 @@ If your DNS provider is not supported, please open an [issue](https://github.com
|
||||
</tr><tr>
|
||||
<td><a href="https://go-acme.github.io/lego/dns/vultr/">Vultr</a></td>
|
||||
<td><a href="https://go-acme.github.io/lego/dns/webnamesca/">webnames.ca</a></td>
|
||||
<td><a href="https://go-acme.github.io/lego/dns/webnames/">webnames.ru</a></td>
|
||||
<td><a href="https://go-acme.github.io/lego/dns/webnamesru/">webnames.ru</a></td>
|
||||
<td><a href="https://go-acme.github.io/lego/dns/websupport/">Websupport</a></td>
|
||||
</tr><tr>
|
||||
<td><a href="https://go-acme.github.io/lego/dns/wedos/">WEDOS</a></td>
|
||||
|
||||
@@ -30,12 +30,7 @@ type OrderOptions struct {
|
||||
type OrderService service
|
||||
|
||||
// New Creates a new order.
|
||||
func (o *OrderService) New(ctx context.Context, domains []string) (acme.ExtendedOrder, error) {
|
||||
return o.NewWithOptions(ctx, domains, nil)
|
||||
}
|
||||
|
||||
// NewWithOptions Creates a new order.
|
||||
func (o *OrderService) NewWithOptions(ctx context.Context, domains []string, opts *OrderOptions) (acme.ExtendedOrder, error) {
|
||||
func (o *OrderService) New(ctx context.Context, domains []string, opts *OrderOptions) (acme.ExtendedOrder, error) {
|
||||
orderReq := acme.Order{Identifiers: createIdentifiers(domains)}
|
||||
|
||||
if opts != nil {
|
||||
|
||||
@@ -93,7 +93,7 @@ func TestOrderService_NewWithOptions(t *testing.T) {
|
||||
t.Run(test.desc, func(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
order, err := core.Orders.NewWithOptions(t.Context(), []string{"example.com"}, test.opts)
|
||||
order, err := core.Orders.New(t.Context(), []string{"example.com"}, test.opts)
|
||||
require.NoError(t, err)
|
||||
|
||||
assert.Equal(t, test.expected, order)
|
||||
|
||||
@@ -138,15 +138,6 @@ func GeneratePrivateKey(keyType KeyType) (crypto.PrivateKey, error) {
|
||||
return nil, fmt.Errorf("invalid KeyType: %s", keyType)
|
||||
}
|
||||
|
||||
// Deprecated: uses [CreateCSR] instead.
|
||||
func GenerateCSR(privateKey crypto.PrivateKey, domain string, san []string, mustStaple bool) ([]byte, error) {
|
||||
return CreateCSR(privateKey, CSROptions{
|
||||
Domain: domain,
|
||||
SAN: san,
|
||||
MustStaple: mustStaple,
|
||||
})
|
||||
}
|
||||
|
||||
type CSROptions struct {
|
||||
Domain string
|
||||
SAN []string
|
||||
|
||||
@@ -177,7 +177,7 @@ func (c *Certifier) Obtain(ctx context.Context, request ObtainRequest) (*Resourc
|
||||
ReplacesCertID: request.ReplacesCertID,
|
||||
}
|
||||
|
||||
order, err := c.core.Orders.NewWithOptions(ctx, domains, orderOpts)
|
||||
order, err := c.core.Orders.New(ctx, domains, orderOpts)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -245,7 +245,7 @@ func (c *Certifier) ObtainForCSR(ctx context.Context, request ObtainForCSRReques
|
||||
ReplacesCertID: request.ReplacesCertID,
|
||||
}
|
||||
|
||||
order, err := c.core.Orders.NewWithOptions(ctx, domains, orderOpts)
|
||||
order, err := c.core.Orders.New(ctx, domains, orderOpts)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -472,7 +472,7 @@ func (c *Certifier) RevokeWithReason(ctx context.Context, cert []byte, reason *u
|
||||
return c.core.Certificates.Revoke(ctx, revokeMsg)
|
||||
}
|
||||
|
||||
// RenewOptions options used by Certifier.RenewWithOptions.
|
||||
// RenewOptions options used by [Certifier.Renew].
|
||||
type RenewOptions struct {
|
||||
NotBefore time.Time
|
||||
NotAfter time.Time
|
||||
@@ -498,27 +498,7 @@ type RenewOptions struct {
|
||||
// If bundle is true, the []byte contains both the issuer certificate and your issued certificate as a bundle.
|
||||
//
|
||||
// For private key reuse the PrivateKey property of the passed in Resource should be non-nil.
|
||||
//
|
||||
// Deprecated: use RenewWithOptions instead.
|
||||
func (c *Certifier) Renew(ctx context.Context, certRes Resource, bundle, mustStaple bool, preferredChain string) (*Resource, error) {
|
||||
return c.RenewWithOptions(ctx, certRes, &RenewOptions{
|
||||
Bundle: bundle,
|
||||
PreferredChain: preferredChain,
|
||||
MustStaple: mustStaple,
|
||||
})
|
||||
}
|
||||
|
||||
// RenewWithOptions takes a Resource and tries to renew the certificate.
|
||||
//
|
||||
// If the renewal process succeeds, the new certificate will be returned in a new CertResource.
|
||||
// Please be aware that this function will return a new certificate in ANY case that is not an error.
|
||||
// If the server does not provide us with a new cert on a GET request to the CertURL
|
||||
// this function will start a new-cert flow where a new certificate gets generated.
|
||||
//
|
||||
// If bundle is true, the []byte contains both the issuer certificate and your issued certificate as a bundle.
|
||||
//
|
||||
// For private key reuse the PrivateKey property of the passed in Resource should be non-nil.
|
||||
func (c *Certifier) RenewWithOptions(ctx context.Context, certRes Resource, options *RenewOptions) (*Resource, error) {
|
||||
func (c *Certifier) Renew(ctx context.Context, certRes Resource, options *RenewOptions) (*Resource, error) {
|
||||
// Input certificate is PEM encoded.
|
||||
// Decode it here as we may need the decoded cert later on in the renewal process.
|
||||
// The input may be a bundle or a single certificate.
|
||||
|
||||
@@ -15,9 +15,17 @@ func (c *Client) lookupCNAME(ctx context.Context, fqdn string) string {
|
||||
for range 50 {
|
||||
// Keep following CNAMEs
|
||||
r, err := c.sendQuery(ctx, fqdn, dns.TypeCNAME, true)
|
||||
if err != nil {
|
||||
log.Debug("Lookup CNAME.",
|
||||
slog.String("fqdn", fqdn),
|
||||
log.ErrorAttr(err),
|
||||
)
|
||||
|
||||
if err != nil || r.Rcode != dns.RcodeSuccess {
|
||||
// TODO(ldez): logs the error in v5
|
||||
// No more CNAME records to follow, exit
|
||||
break
|
||||
}
|
||||
|
||||
if r.Rcode != dns.RcodeSuccess {
|
||||
// No more CNAME records to follow, exit
|
||||
break
|
||||
}
|
||||
|
||||
50
cmd/zz_gen_cmd_dnshelp.go
generated
50
cmd/zz_gen_cmd_dnshelp.go
generated
@@ -12,7 +12,7 @@ import (
|
||||
|
||||
func allDNSCodes() string {
|
||||
providers := []string{
|
||||
"acme-dns",
|
||||
"acmedns",
|
||||
"active24",
|
||||
"alidns",
|
||||
"aliesa",
|
||||
@@ -185,8 +185,8 @@ func allDNSCodes() string {
|
||||
"volcengine",
|
||||
"vscale",
|
||||
"vultr",
|
||||
"webnames",
|
||||
"webnamesca",
|
||||
"webnamesru",
|
||||
"websupport",
|
||||
"wedos",
|
||||
"westcn",
|
||||
@@ -206,10 +206,10 @@ func displayDNSHelp(w io.Writer, name string) error {
|
||||
ew := &errWriter{w: w}
|
||||
|
||||
switch name {
|
||||
case "acme-dns":
|
||||
case "acmedns":
|
||||
// generated from: providers/dns/acmedns/acmedns.toml
|
||||
ew.writeln(`Configuration for Joohoi's ACME-DNS.`)
|
||||
ew.writeln(`Code: 'acme-dns'`)
|
||||
ew.writeln(`Code: 'acmedns'`)
|
||||
ew.writeln(`Since: 'v1.1.0'`)
|
||||
ew.writeln()
|
||||
|
||||
@@ -223,7 +223,7 @@ func displayDNSHelp(w io.Writer, name string) error {
|
||||
ew.writeln(` - "ACME_DNS_ALLOWLIST": Source networks using CIDR notation (multiple values should be separated with a comma).`)
|
||||
|
||||
ew.writeln()
|
||||
ew.writeln(`More information: https://go-acme.github.io/lego/dns/acme-dns`)
|
||||
ew.writeln(`More information: https://go-acme.github.io/lego/dns/acmedns`)
|
||||
|
||||
case "active24":
|
||||
// generated from: providers/dns/active24/active24.toml
|
||||
@@ -3350,7 +3350,6 @@ func displayDNSHelp(w io.Writer, name string) error {
|
||||
ew.writeln()
|
||||
|
||||
ew.writeln(`Additional Configuration:`)
|
||||
ew.writeln(` - "SELECTEL_BASE_URL": API endpoint URL`)
|
||||
ew.writeln(` - "SELECTEL_HTTP_TIMEOUT": API request timeout in seconds (Default: 30)`)
|
||||
ew.writeln(` - "SELECTEL_POLLING_INTERVAL": Time between DNS propagation check in seconds (Default: 2)`)
|
||||
ew.writeln(` - "SELECTEL_PROPAGATION_TIMEOUT": Maximum waiting time for DNS propagation in seconds (Default: 120)`)
|
||||
@@ -3890,7 +3889,6 @@ func displayDNSHelp(w io.Writer, name string) error {
|
||||
ew.writeln()
|
||||
|
||||
ew.writeln(`Additional Configuration:`)
|
||||
ew.writeln(` - "VSCALE_BASE_URL": API endpoint URL`)
|
||||
ew.writeln(` - "VSCALE_HTTP_TIMEOUT": API request timeout in seconds (Default: 30)`)
|
||||
ew.writeln(` - "VSCALE_POLLING_INTERVAL": Time between DNS propagation check in seconds (Default: 2)`)
|
||||
ew.writeln(` - "VSCALE_PROPAGATION_TIMEOUT": Maximum waiting time for DNS propagation in seconds (Default: 120)`)
|
||||
@@ -3919,25 +3917,6 @@ func displayDNSHelp(w io.Writer, name string) error {
|
||||
ew.writeln()
|
||||
ew.writeln(`More information: https://go-acme.github.io/lego/dns/vultr`)
|
||||
|
||||
case "webnames":
|
||||
// generated from: providers/dns/webnames/webnames.toml
|
||||
ew.writeln(`Configuration for webnames.ru.`)
|
||||
ew.writeln(`Code: 'webnames'`)
|
||||
ew.writeln(`Since: 'v4.15.0'`)
|
||||
ew.writeln()
|
||||
|
||||
ew.writeln(`Credentials:`)
|
||||
ew.writeln(` - "WEBNAMESRU_API_KEY": Domain API key`)
|
||||
ew.writeln()
|
||||
|
||||
ew.writeln(`Additional Configuration:`)
|
||||
ew.writeln(` - "WEBNAMESRU_HTTP_TIMEOUT": API request timeout in seconds (Default: 30)`)
|
||||
ew.writeln(` - "WEBNAMESRU_POLLING_INTERVAL": Time between DNS propagation check in seconds (Default: 2)`)
|
||||
ew.writeln(` - "WEBNAMESRU_PROPAGATION_TIMEOUT": Maximum waiting time for DNS propagation in seconds (Default: 60)`)
|
||||
|
||||
ew.writeln()
|
||||
ew.writeln(`More information: https://go-acme.github.io/lego/dns/webnames`)
|
||||
|
||||
case "webnamesca":
|
||||
// generated from: providers/dns/webnamesca/webnamesca.toml
|
||||
ew.writeln(`Configuration for webnames.ca.`)
|
||||
@@ -3959,6 +3938,25 @@ func displayDNSHelp(w io.Writer, name string) error {
|
||||
ew.writeln()
|
||||
ew.writeln(`More information: https://go-acme.github.io/lego/dns/webnamesca`)
|
||||
|
||||
case "webnamesru":
|
||||
// generated from: providers/dns/webnamesru/webnamesru.toml
|
||||
ew.writeln(`Configuration for webnames.ru.`)
|
||||
ew.writeln(`Code: 'webnamesru'`)
|
||||
ew.writeln(`Since: 'v4.15.0'`)
|
||||
ew.writeln()
|
||||
|
||||
ew.writeln(`Credentials:`)
|
||||
ew.writeln(` - "WEBNAMESRU_API_KEY": Domain API key`)
|
||||
ew.writeln()
|
||||
|
||||
ew.writeln(`Additional Configuration:`)
|
||||
ew.writeln(` - "WEBNAMESRU_HTTP_TIMEOUT": API request timeout in seconds (Default: 30)`)
|
||||
ew.writeln(` - "WEBNAMESRU_POLLING_INTERVAL": Time between DNS propagation check in seconds (Default: 2)`)
|
||||
ew.writeln(` - "WEBNAMESRU_PROPAGATION_TIMEOUT": Maximum waiting time for DNS propagation in seconds (Default: 60)`)
|
||||
|
||||
ew.writeln()
|
||||
ew.writeln(`More information: https://go-acme.github.io/lego/dns/webnamesru`)
|
||||
|
||||
case "websupport":
|
||||
// generated from: providers/dns/websupport/websupport.toml
|
||||
ew.writeln(`Configuration for Websupport.`)
|
||||
|
||||
@@ -2,10 +2,10 @@
|
||||
title: "Joohoi's ACME-DNS"
|
||||
date: 2019-03-03T16:39:46+01:00
|
||||
draft: false
|
||||
slug: acme-dns
|
||||
slug: acmedns
|
||||
dnsprovider:
|
||||
since: "v1.1.0"
|
||||
code: "acme-dns"
|
||||
code: "acmedns"
|
||||
url: "https://github.com/joohoi/acme-dns"
|
||||
---
|
||||
|
||||
@@ -19,7 +19,7 @@ Configuration for [Joohoi's ACME-DNS](https://github.com/joohoi/acme-dns).
|
||||
|
||||
<!--more-->
|
||||
|
||||
- Code: `acme-dns`
|
||||
- Code: `acmedns`
|
||||
- Since: v1.1.0
|
||||
|
||||
|
||||
1
docs/content/dns/zz_gen_selectel.md
generated
1
docs/content/dns/zz_gen_selectel.md
generated
@@ -47,7 +47,6 @@ More information [here]({{% ref "dns#configuration-and-credentials" %}}).
|
||||
|
||||
| Environment Variable Name | Description |
|
||||
|--------------------------------|-------------|
|
||||
| `SELECTEL_BASE_URL` | API endpoint URL |
|
||||
| `SELECTEL_HTTP_TIMEOUT` | API request timeout in seconds (Default: 30) |
|
||||
| `SELECTEL_POLLING_INTERVAL` | Time between DNS propagation check in seconds (Default: 2) |
|
||||
| `SELECTEL_PROPAGATION_TIMEOUT` | Maximum waiting time for DNS propagation in seconds (Default: 120) |
|
||||
|
||||
1
docs/content/dns/zz_gen_vscale.md
generated
1
docs/content/dns/zz_gen_vscale.md
generated
@@ -47,7 +47,6 @@ More information [here]({{% ref "dns#configuration-and-credentials" %}}).
|
||||
|
||||
| Environment Variable Name | Description |
|
||||
|--------------------------------|-------------|
|
||||
| `VSCALE_BASE_URL` | API endpoint URL |
|
||||
| `VSCALE_HTTP_TIMEOUT` | API request timeout in seconds (Default: 30) |
|
||||
| `VSCALE_POLLING_INTERVAL` | Time between DNS propagation check in seconds (Default: 2) |
|
||||
| `VSCALE_PROPAGATION_TIMEOUT` | Maximum waiting time for DNS propagation in seconds (Default: 120) |
|
||||
|
||||
@@ -2,15 +2,15 @@
|
||||
title: "webnames.ru"
|
||||
date: 2019-03-03T16:39:46+01:00
|
||||
draft: false
|
||||
slug: webnames
|
||||
slug: webnamesru
|
||||
dnsprovider:
|
||||
since: "v4.15.0"
|
||||
code: "webnames"
|
||||
code: "webnamesru"
|
||||
url: "https://www.webnames.ru/"
|
||||
---
|
||||
|
||||
<!-- THIS DOCUMENTATION IS AUTO-GENERATED. PLEASE DO NOT EDIT. -->
|
||||
<!-- providers/dns/webnames/webnames.toml -->
|
||||
<!-- providers/dns/webnamesru/webnamesru.toml -->
|
||||
<!-- THIS DOCUMENTATION IS AUTO-GENERATED. PLEASE DO NOT EDIT. -->
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ Configuration for [webnames.ru](https://www.webnames.ru/).
|
||||
|
||||
<!--more-->
|
||||
|
||||
- Code: `webnames`
|
||||
- Code: `webnamesru`
|
||||
- Since: v4.15.0
|
||||
|
||||
|
||||
@@ -67,5 +67,5 @@ The API key can be found: Personal account / My domains and services / Select th
|
||||
- [API documentation](https://github.com/regtime-ltd/certbot-dns-webnames)
|
||||
|
||||
<!-- THIS DOCUMENTATION IS AUTO-GENERATED. PLEASE DO NOT EDIT. -->
|
||||
<!-- providers/dns/webnames/webnames.toml -->
|
||||
<!-- providers/dns/webnamesru/webnamesru.toml -->
|
||||
<!-- THIS DOCUMENTATION IS AUTO-GENERATED. PLEASE DO NOT EDIT. -->
|
||||
2
docs/data/zz_cli_help.toml
generated
2
docs/data/zz_cli_help.toml
generated
@@ -152,7 +152,7 @@ To display the documentation for a specific DNS provider, run:
|
||||
$ lego dnshelp -c code
|
||||
|
||||
Supported DNS providers:
|
||||
acme-dns, active24, alidns, aliesa, allinkl, alwaysdata, anexia, arvancloud, auroradns, autodns, axelname, azion, azure, azuredns, baiducloud, beget, binarylane, bindman, bluecat, bookmyname, brandit, bunny, checkdomain, civo, clouddns, cloudflare, cloudns, cloudru, cloudxns, com35, conoha, conohav3, constellix, corenetworks, cpanel, ddnss, derak, desec, designate, digitalocean, directadmin, dnsexit, dnshomede, dnsimple, dnsmadeeasy, dnspod, dode, domeneshop, dreamhost, duckdns, dyn, dyndnsfree, dynu, easydns, edgecenter, edgedns, edgeone, efficientip, epik, exec, exoscale, f5xc, freemyip, gandi, gandiv5, gcloud, gcore, gigahostno, glesys, godaddy, googledomains, gravity, hetzner, hostingde, hostinger, hostingnl, hosttech, httpnet, httpreq, huaweicloud, hurricane, hyperone, ibmcloud, iij, iijdpf, infoblox, infomaniak, internetbs, inwx, ionos, ionoscloud, ipv64, ispconfig, ispconfigddns, iwantmyname, jdcloud, joker, keyhelp, liara, lightsail, limacity, linode, liquidweb, loopia, luadns, mailinabox, manageengine, manual, metaname, metaregistrar, mijnhost, mittwald, myaddr, mydnsjp, mythicbeasts, namecheap, namedotcom, namesilo, nearlyfreespeech, neodigit, netcup, netlify, nicmanager, nicru, nifcloud, njalla, nodion, ns1, octenium, oraclecloud, otc, ovh, pdns, plesk, porkbun, rackspace, rainyun, rcodezero, regfish, regru, rfc2136, rimuhosting, route53, safedns, sakuracloud, scaleway, selectel, selectelv2, selfhostde, servercow, shellrent, simply, sonic, spaceship, stackpath, syse, technitium, tencentcloud, timewebcloud, todaynic, transip, ultradns, uniteddomains, variomedia, vegadns, vercel, versio, vinyldns, virtualname, vkcloud, volcengine, vscale, vultr, webnames, webnamesca, websupport, wedos, westcn, yandex, yandex360, yandexcloud, zoneedit, zoneee, zonomi
|
||||
acmedns, active24, alidns, aliesa, allinkl, alwaysdata, anexia, arvancloud, auroradns, autodns, axelname, azion, azure, azuredns, baiducloud, beget, binarylane, bindman, bluecat, bookmyname, brandit, bunny, checkdomain, civo, clouddns, cloudflare, cloudns, cloudru, cloudxns, com35, conoha, conohav3, constellix, corenetworks, cpanel, ddnss, derak, desec, designate, digitalocean, directadmin, dnsexit, dnshomede, dnsimple, dnsmadeeasy, dnspod, dode, domeneshop, dreamhost, duckdns, dyn, dyndnsfree, dynu, easydns, edgecenter, edgedns, edgeone, efficientip, epik, exec, exoscale, f5xc, freemyip, gandi, gandiv5, gcloud, gcore, gigahostno, glesys, godaddy, googledomains, gravity, hetzner, hostingde, hostinger, hostingnl, hosttech, httpnet, httpreq, huaweicloud, hurricane, hyperone, ibmcloud, iij, iijdpf, infoblox, infomaniak, internetbs, inwx, ionos, ionoscloud, ipv64, ispconfig, ispconfigddns, iwantmyname, jdcloud, joker, keyhelp, liara, lightsail, limacity, linode, liquidweb, loopia, luadns, mailinabox, manageengine, manual, metaname, metaregistrar, mijnhost, mittwald, myaddr, mydnsjp, mythicbeasts, namecheap, namedotcom, namesilo, nearlyfreespeech, neodigit, netcup, netlify, nicmanager, nicru, nifcloud, njalla, nodion, ns1, octenium, oraclecloud, otc, ovh, pdns, plesk, porkbun, rackspace, rainyun, rcodezero, regfish, regru, rfc2136, rimuhosting, route53, safedns, sakuracloud, scaleway, selectel, selectelv2, selfhostde, servercow, shellrent, simply, sonic, spaceship, stackpath, syse, technitium, tencentcloud, timewebcloud, todaynic, transip, ultradns, uniteddomains, variomedia, vegadns, vercel, versio, vinyldns, virtualname, vkcloud, volcengine, vscale, vultr, webnamesca, webnamesru, websupport, wedos, westcn, yandex, yandex360, yandexcloud, zoneedit, zoneee, zonomi
|
||||
|
||||
More information: https://go-acme.github.io/lego/dns
|
||||
"""
|
||||
|
||||
@@ -113,25 +113,6 @@ func NewDNSProviderConfig(config *Config) (*DNSProvider, error) {
|
||||
}, nil
|
||||
}
|
||||
|
||||
// NewDNSProviderClient creates an ACME-DNS DNSProvider with the given acmeDNSClient and [goacmedns.Storage].
|
||||
//
|
||||
// Deprecated: use [NewDNSProviderConfig] instead.
|
||||
func NewDNSProviderClient(client acmeDNSClient, store goacmedns.Storage) (*DNSProvider, error) {
|
||||
if client == nil {
|
||||
return nil, errors.New("acme-dns: Client must be not nil")
|
||||
}
|
||||
|
||||
if store == nil {
|
||||
return nil, errors.New("acme-dns: Storage must be not nil")
|
||||
}
|
||||
|
||||
return &DNSProvider{
|
||||
config: NewDefaultConfig(),
|
||||
client: client,
|
||||
storage: store,
|
||||
}, nil
|
||||
}
|
||||
|
||||
// ErrCNAMERequired is returned by Present when the Domain indicated had no
|
||||
// existing ACME-DNS account in the Storage and additional setup is required.
|
||||
// The user must create a CNAME in the DNS zone for Domain that aliases FQDN
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
Name = "Joohoi's ACME-DNS"
|
||||
Description = ''''''
|
||||
URL = "https://github.com/joohoi/acme-dns"
|
||||
Code = "acme-dns"
|
||||
Aliases = ["acmedns"] # TODO(ldez): remove "-" in v5
|
||||
Code = "acmedns"
|
||||
Aliases = ["acme-dns"] # "acme-dns" is for compatibility with v4, must be dropped in the future.
|
||||
Since = "v1.1.0"
|
||||
|
||||
Example = '''
|
||||
|
||||
@@ -131,7 +131,7 @@ func (d *DNSProvider) Present(ctx context.Context, domain, token, keyAuth string
|
||||
return fmt.Errorf("allinkl: authentication: %w", err)
|
||||
}
|
||||
|
||||
ctx = internal.WithContext(ctx, credential)
|
||||
ctxAuth := internal.WithContext(ctx, credential)
|
||||
|
||||
subDomain, err := dns01.ExtractSubDomain(info.EffectiveFQDN, authZone)
|
||||
if err != nil {
|
||||
@@ -145,7 +145,7 @@ func (d *DNSProvider) Present(ctx context.Context, domain, token, keyAuth string
|
||||
RecordData: info.Value,
|
||||
}
|
||||
|
||||
recordID, err := d.client.AddDNSSettings(ctx, record)
|
||||
recordID, err := d.client.AddDNSSettings(ctxAuth, record)
|
||||
if err != nil {
|
||||
return fmt.Errorf("allinkl: add DNS settings: %w", err)
|
||||
}
|
||||
@@ -166,7 +166,7 @@ func (d *DNSProvider) CleanUp(ctx context.Context, domain, token, keyAuth string
|
||||
return fmt.Errorf("allinkl: authentication: %w", err)
|
||||
}
|
||||
|
||||
ctx = internal.WithContext(ctx, credential)
|
||||
ctxAuth := internal.WithContext(ctx, credential)
|
||||
|
||||
// gets the record's unique ID from when we created it
|
||||
d.recordIDsMu.Lock()
|
||||
@@ -177,7 +177,7 @@ func (d *DNSProvider) CleanUp(ctx context.Context, domain, token, keyAuth string
|
||||
return fmt.Errorf("allinkl: unknown record ID for '%s' '%s'", info.EffectiveFQDN, token)
|
||||
}
|
||||
|
||||
_, err = d.client.DeleteDNSSettings(ctx, recordID)
|
||||
_, err = d.client.DeleteDNSSettings(ctxAuth, recordID)
|
||||
if err != nil {
|
||||
return fmt.Errorf("allinkl: delete DNS settings: %w", err)
|
||||
}
|
||||
|
||||
@@ -31,8 +31,8 @@ const (
|
||||
EnvPollingInterval = envNamespace + "POLLING_INTERVAL"
|
||||
)
|
||||
|
||||
// Test Environment variables names (unused).
|
||||
// TODO(ldez): must be moved into test files.
|
||||
// Managed by the Akamai EdgeGrid client.
|
||||
// The constants are only helpers.
|
||||
const (
|
||||
EnvHost = envNamespace + "HOST"
|
||||
EnvClientToken = envNamespace + "CLIENT_TOKEN"
|
||||
|
||||
@@ -4,7 +4,7 @@ Akamai edgedns supersedes FastDNS; implementing a DNS provider for solving the D
|
||||
'''
|
||||
URL = "https://www.akamai.com/us/en/products/security/edge-dns.jsp"
|
||||
Code = "edgedns"
|
||||
Aliases = ["fastdns"] # "fastdns" is for compatibility with v3, must be dropped in v5
|
||||
Aliases = ["fastdns"] # "fastdns" is for compatibility with v3, must be dropped in the future.
|
||||
Since = "v3.9.0"
|
||||
|
||||
Example = '''
|
||||
|
||||
@@ -120,9 +120,9 @@ func (d *DNSProvider) Present(ctx context.Context, domain, token, keyAuth string
|
||||
return fmt.Errorf("gigahostno: %w", err)
|
||||
}
|
||||
|
||||
ctx = internal.WithContext(ctx, d.token.Token)
|
||||
ctxAuth := internal.WithContext(ctx, d.token.Token)
|
||||
|
||||
zone, err := d.findZone(ctx, info.EffectiveFQDN)
|
||||
zone, err := d.findZone(ctxAuth, info.EffectiveFQDN)
|
||||
if err != nil {
|
||||
return fmt.Errorf("gigahostno: %w", err)
|
||||
}
|
||||
@@ -139,7 +139,7 @@ func (d *DNSProvider) Present(ctx context.Context, domain, token, keyAuth string
|
||||
TTL: d.config.TTL,
|
||||
}
|
||||
|
||||
err = d.client.CreateNewRecord(ctx, zone.ID, record)
|
||||
err = d.client.CreateNewRecord(ctxAuth, zone.ID, record)
|
||||
if err != nil {
|
||||
return fmt.Errorf("gigahostno: create new record: %w", err)
|
||||
}
|
||||
@@ -156,9 +156,9 @@ func (d *DNSProvider) CleanUp(ctx context.Context, domain, token, keyAuth string
|
||||
return fmt.Errorf("gigahostno: %w", err)
|
||||
}
|
||||
|
||||
ctx = internal.WithContext(ctx, d.token.Token)
|
||||
ctxAuth := internal.WithContext(ctx, d.token.Token)
|
||||
|
||||
zone, err := d.findZone(ctx, info.EffectiveFQDN)
|
||||
zone, err := d.findZone(ctxAuth, info.EffectiveFQDN)
|
||||
if err != nil {
|
||||
return fmt.Errorf("gigahostno: %w", err)
|
||||
}
|
||||
@@ -168,14 +168,14 @@ func (d *DNSProvider) CleanUp(ctx context.Context, domain, token, keyAuth string
|
||||
return fmt.Errorf("gigahostno: %w", err)
|
||||
}
|
||||
|
||||
records, err := d.client.GetZoneRecords(ctx, zone.ID)
|
||||
records, err := d.client.GetZoneRecords(ctxAuth, zone.ID)
|
||||
if err != nil {
|
||||
return fmt.Errorf("gigahostno: get zone records: %w", err)
|
||||
}
|
||||
|
||||
for _, record := range records {
|
||||
if record.Type == "TXT" && record.Name == subDomain && record.Value == info.Value {
|
||||
err := d.client.DeleteRecord(ctx, zone.ID, record.ID, record.Name, record.Type)
|
||||
err := d.client.DeleteRecord(ctxAuth, zone.ID, record.ID, record.Name, record.Type)
|
||||
if err != nil {
|
||||
return fmt.Errorf("gigahostno: delete record: %w", err)
|
||||
}
|
||||
|
||||
@@ -26,9 +26,6 @@ type Config struct {
|
||||
PollingInterval time.Duration
|
||||
TTL int
|
||||
HTTPClient *http.Client
|
||||
|
||||
// TODO(ldez): remove in v5?
|
||||
BaseURL string
|
||||
}
|
||||
|
||||
// DNSProvider implements the challenge.Provider interface.
|
||||
@@ -38,7 +35,7 @@ type DNSProvider struct {
|
||||
}
|
||||
|
||||
// NewDNSProviderConfig return a DNSProvider instance configured for selectel.
|
||||
func NewDNSProviderConfig(config *Config) (*DNSProvider, error) {
|
||||
func NewDNSProviderConfig(config *Config, baseURL string) (*DNSProvider, error) {
|
||||
if config == nil {
|
||||
return nil, errors.New("the configuration of the DNS provider is nil")
|
||||
}
|
||||
@@ -59,11 +56,13 @@ func NewDNSProviderConfig(config *Config) (*DNSProvider, error) {
|
||||
|
||||
client.HTTPClient = clientdebug.Wrap(client.HTTPClient)
|
||||
|
||||
var err error
|
||||
if baseURL != "" {
|
||||
var err error
|
||||
|
||||
client.BaseURL, err = url.Parse(config.BaseURL)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("%w", err)
|
||||
client.BaseURL, err = url.Parse(baseURL)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
|
||||
return &DNSProvider{config: config, client: client}, nil
|
||||
|
||||
@@ -40,7 +40,7 @@ func TestNewDNSProviderConfig(t *testing.T) {
|
||||
config.TTL = test.ttl
|
||||
config.Token = test.token
|
||||
|
||||
p, err := NewDNSProviderConfig(config)
|
||||
p, err := NewDNSProviderConfig(config, "")
|
||||
|
||||
if test.expected == "" {
|
||||
require.NoError(t, err)
|
||||
|
||||
@@ -36,7 +36,6 @@ type Config struct {
|
||||
PropagationTimeout time.Duration
|
||||
PollingInterval time.Duration
|
||||
HTTPClient *http.Client
|
||||
SequenceInterval time.Duration // Deprecated: unused, will be removed in v5.
|
||||
}
|
||||
|
||||
// NewDefaultConfig returns a default configuration for the DNSProvider.
|
||||
|
||||
@@ -2,7 +2,7 @@ Name = "Linode (v4)"
|
||||
Description = ''''''
|
||||
URL = "https://www.linode.com/"
|
||||
Code = "linode"
|
||||
Aliases = ["linodev4"] # "linodev4" is for compatibility with v3, must be dropped in v5
|
||||
Aliases = ["linodev4"] # "linodev4" is for compatibility with v3, must be dropped in the future.
|
||||
Since = "v1.1.0"
|
||||
|
||||
Example = '''
|
||||
|
||||
@@ -26,9 +26,6 @@ const (
|
||||
EnvAPIKey = envNamespace + "API_KEY"
|
||||
EnvAPIPassword = envNamespace + "API_PASSWORD"
|
||||
|
||||
// Deprecated: the TTL is not configurable on record.
|
||||
EnvTTL = envNamespace + "TTL"
|
||||
|
||||
EnvPropagationTimeout = envNamespace + "PROPAGATION_TIMEOUT"
|
||||
EnvPollingInterval = envNamespace + "POLLING_INTERVAL"
|
||||
EnvHTTPTimeout = envNamespace + "HTTP_TIMEOUT"
|
||||
@@ -44,9 +41,6 @@ type Config struct {
|
||||
PropagationTimeout time.Duration
|
||||
PollingInterval time.Duration
|
||||
HTTPClient *http.Client
|
||||
|
||||
// Deprecated: the TTL is not configurable on record.
|
||||
TTL int
|
||||
}
|
||||
|
||||
// NewDefaultConfig returns a default configuration for the DNSProvider.
|
||||
|
||||
@@ -52,7 +52,7 @@ var _ challenge.ProviderTimeout = (*DNSProvider)(nil)
|
||||
// Config is used to configure the creation of the DNSProvider.
|
||||
type Config struct {
|
||||
ProjectID string
|
||||
Token string // TODO(ldez) rename to SecretKey in the next major.
|
||||
SecretKey string
|
||||
AccessKey string
|
||||
|
||||
PropagationTimeout time.Duration
|
||||
@@ -90,7 +90,7 @@ func NewDNSProvider() (*DNSProvider, error) {
|
||||
}
|
||||
|
||||
config := NewDefaultConfig()
|
||||
config.Token = values[EnvSecretKey]
|
||||
config.SecretKey = values[EnvSecretKey]
|
||||
config.AccessKey = env.GetOrDefaultString(EnvAccessKey, dumpAccessKey)
|
||||
config.ProjectID = env.GetOrFile(EnvProjectID)
|
||||
|
||||
@@ -103,7 +103,7 @@ func NewDNSProviderConfig(config *Config) (*DNSProvider, error) {
|
||||
return nil, errors.New("scaleway: the configuration of the DNS provider is nil")
|
||||
}
|
||||
|
||||
if config.Token == "" {
|
||||
if config.SecretKey == "" {
|
||||
return nil, errors.New("scaleway: credentials missing")
|
||||
}
|
||||
|
||||
@@ -112,7 +112,7 @@ func NewDNSProviderConfig(config *Config) (*DNSProvider, error) {
|
||||
}
|
||||
|
||||
configuration := []scw.ClientOption{
|
||||
scw.WithAuth(config.AccessKey, config.Token),
|
||||
scw.WithAuth(config.AccessKey, config.SecretKey),
|
||||
scw.WithUserAgent(useragent.Get()),
|
||||
}
|
||||
|
||||
|
||||
@@ -84,7 +84,7 @@ func TestNewDNSProviderConfig(t *testing.T) {
|
||||
t.Run(test.desc, func(t *testing.T) {
|
||||
config := NewDefaultConfig()
|
||||
config.TTL = test.ttl
|
||||
config.Token = test.token
|
||||
config.SecretKey = test.token
|
||||
|
||||
p, err := NewDNSProviderConfig(config)
|
||||
|
||||
|
||||
@@ -20,7 +20,6 @@ import (
|
||||
const (
|
||||
envNamespace = "SELECTEL_"
|
||||
|
||||
EnvBaseURL = envNamespace + "BASE_URL"
|
||||
EnvAPIToken = envNamespace + "API_TOKEN"
|
||||
|
||||
EnvTTL = envNamespace + "TTL"
|
||||
@@ -29,6 +28,8 @@ const (
|
||||
EnvHTTPTimeout = envNamespace + "HTTP_TIMEOUT"
|
||||
)
|
||||
|
||||
const defaultBaseURL = "https://api.selectel.ru/domains/v1"
|
||||
|
||||
var _ challenge.ProviderTimeout = (*DNSProvider)(nil)
|
||||
|
||||
// Config is used to configure the creation of the DNSProvider.
|
||||
@@ -37,7 +38,6 @@ type Config = selectel.Config
|
||||
// NewDefaultConfig returns a default configuration for the DNSProvider.
|
||||
func NewDefaultConfig() *Config {
|
||||
return &Config{
|
||||
BaseURL: env.GetOrDefaultString(EnvBaseURL, ""),
|
||||
TTL: env.GetOrDefaultInt(EnvTTL, selectel.MinTTL),
|
||||
PropagationTimeout: env.GetOrDefaultSecond(EnvPropagationTimeout, 120*time.Second),
|
||||
PollingInterval: env.GetOrDefaultSecond(EnvPollingInterval, dns01.DefaultPollingInterval),
|
||||
@@ -72,7 +72,7 @@ func NewDNSProviderConfig(config *Config) (*DNSProvider, error) {
|
||||
return nil, errors.New("selectel: the configuration of the DNS provider is nil")
|
||||
}
|
||||
|
||||
provider, err := selectel.NewDNSProviderConfig(config)
|
||||
provider, err := selectel.NewDNSProviderConfig(config, defaultBaseURL)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("selectel: %w", err)
|
||||
}
|
||||
|
||||
@@ -13,7 +13,6 @@ lego --dns selectel -d '*.example.com' -d example.com run
|
||||
[Configuration.Credentials]
|
||||
SELECTEL_API_TOKEN = "API token"
|
||||
[Configuration.Additional]
|
||||
SELECTEL_BASE_URL = "API endpoint URL"
|
||||
SELECTEL_POLLING_INTERVAL = "Time between DNS propagation check in seconds (Default: 2)"
|
||||
SELECTEL_PROPAGATION_TIMEOUT = "Maximum waiting time for DNS propagation in seconds (Default: 120)"
|
||||
SELECTEL_TTL = "The TTL of the TXT record used for the DNS challenge in seconds (Default: 60)"
|
||||
|
||||
@@ -106,9 +106,6 @@ func NewDNSProviderConfig(config *Config) (*DNSProvider, error) {
|
||||
|
||||
if config.HTTPClient != nil {
|
||||
client.HTTPClient = config.HTTPClient
|
||||
} else {
|
||||
// For compatibility, it should be removed in v5.
|
||||
client.HTTPClient.Timeout = 30 * time.Second
|
||||
}
|
||||
|
||||
client.HTTPClient = clientdebug.Wrap(client.HTTPClient)
|
||||
|
||||
@@ -20,7 +20,6 @@ import (
|
||||
const (
|
||||
envNamespace = "VSCALE_"
|
||||
|
||||
EnvBaseURL = envNamespace + "BASE_URL"
|
||||
EnvAPIToken = envNamespace + "API_TOKEN"
|
||||
|
||||
EnvTTL = envNamespace + "TTL"
|
||||
@@ -39,7 +38,6 @@ type Config = selectel.Config
|
||||
// NewDefaultConfig returns a default configuration for the DNSProvider.
|
||||
func NewDefaultConfig() *Config {
|
||||
return &Config{
|
||||
BaseURL: env.GetOrDefaultString(EnvBaseURL, defaultBaseURL),
|
||||
TTL: env.GetOrDefaultInt(EnvTTL, selectel.MinTTL),
|
||||
PropagationTimeout: env.GetOrDefaultSecond(EnvPropagationTimeout, 120*time.Second),
|
||||
PollingInterval: env.GetOrDefaultSecond(EnvPollingInterval, dns01.DefaultPollingInterval),
|
||||
@@ -74,11 +72,7 @@ func NewDNSProviderConfig(config *Config) (*DNSProvider, error) {
|
||||
return nil, errors.New("vscale: the configuration of the DNS provider is nil")
|
||||
}
|
||||
|
||||
if config.BaseURL == "" {
|
||||
config.BaseURL = defaultBaseURL
|
||||
}
|
||||
|
||||
provider, err := selectel.NewDNSProviderConfig(config)
|
||||
provider, err := selectel.NewDNSProviderConfig(config, defaultBaseURL)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("vscale: %w", err)
|
||||
}
|
||||
|
||||
@@ -13,7 +13,6 @@ lego --dns vscale -d '*.example.com' -d example.com run
|
||||
[Configuration.Credentials]
|
||||
VSCALE_API_TOKEN = "API token"
|
||||
[Configuration.Additional]
|
||||
VSCALE_BASE_URL = "API endpoint URL"
|
||||
VSCALE_POLLING_INTERVAL = "Time between DNS propagation check in seconds (Default: 2)"
|
||||
VSCALE_PROPAGATION_TIMEOUT = "Maximum waiting time for DNS propagation in seconds (Default: 120)"
|
||||
VSCALE_TTL = "The TTL of the TXT record used for the DNS challenge in seconds (Default: 60)"
|
||||
|
||||
@@ -39,7 +39,6 @@ type Config struct {
|
||||
PollingInterval time.Duration
|
||||
TTL int
|
||||
HTTPClient *http.Client
|
||||
HTTPTimeout time.Duration // TODO(ldez): remove in v5
|
||||
}
|
||||
|
||||
// NewDefaultConfig returns a default configuration for the DNSProvider.
|
||||
@@ -48,7 +47,9 @@ func NewDefaultConfig() *Config {
|
||||
TTL: env.GetOrDefaultInt(EnvTTL, dns01.DefaultTTL),
|
||||
PropagationTimeout: env.GetOrDefaultSecond(EnvPropagationTimeout, dns01.DefaultPropagationTimeout),
|
||||
PollingInterval: env.GetOrDefaultSecond(EnvPollingInterval, dns01.DefaultPollingInterval),
|
||||
HTTPTimeout: env.GetOrDefaultSecond(EnvHTTPTimeout, 30*time.Second),
|
||||
HTTPClient: &http.Client{
|
||||
Timeout: env.GetOrDefaultSecond(EnvHTTPTimeout, 30*time.Second),
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
@@ -83,7 +84,6 @@ func NewDNSProviderConfig(config *Config) (*DNSProvider, error) {
|
||||
}
|
||||
|
||||
authClient := OAuthStaticAccessToken(config.HTTPClient, config.APIKey)
|
||||
authClient.Timeout = config.HTTPTimeout
|
||||
|
||||
client := govultr.NewClient(clientdebug.Wrap(authClient))
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// Package webnames implements a DNS provider for solving the DNS-01 challenge using webnames.ru DNS.
|
||||
package webnames
|
||||
// Package webnamesru implements a DNS provider for solving the DNS-01 challenge using webnames.ru DNS.
|
||||
package webnamesru
|
||||
|
||||
import (
|
||||
"context"
|
||||
@@ -13,7 +13,7 @@ import (
|
||||
"github.com/go-acme/lego/v5/challenge/dns01"
|
||||
"github.com/go-acme/lego/v5/platform/config/env"
|
||||
"github.com/go-acme/lego/v5/providers/dns/internal/clientdebug"
|
||||
"github.com/go-acme/lego/v5/providers/dns/webnames/internal"
|
||||
"github.com/go-acme/lego/v5/providers/dns/webnamesru/internal"
|
||||
)
|
||||
|
||||
// Environment variables names.
|
||||
@@ -1,8 +1,8 @@
|
||||
Name = "webnames.ru"
|
||||
Description = ''''''
|
||||
URL = "https://www.webnames.ru/"
|
||||
Code = "webnames"
|
||||
Aliases = ["webnamesru"]
|
||||
Code = "webnamesru"
|
||||
Aliases = ["webnames"] # "webnames" is for compatibility with v4, must be dropped in the future.
|
||||
Since = "v4.15.0"
|
||||
|
||||
Example = '''
|
||||
@@ -1,4 +1,4 @@
|
||||
package webnames
|
||||
package webnamesru
|
||||
|
||||
import (
|
||||
"testing"
|
||||
8
providers/dns/zz_gen_dns_providers.go
generated
8
providers/dns/zz_gen_dns_providers.go
generated
@@ -179,8 +179,8 @@ import (
|
||||
"github.com/go-acme/lego/v5/providers/dns/volcengine"
|
||||
"github.com/go-acme/lego/v5/providers/dns/vscale"
|
||||
"github.com/go-acme/lego/v5/providers/dns/vultr"
|
||||
"github.com/go-acme/lego/v5/providers/dns/webnames"
|
||||
"github.com/go-acme/lego/v5/providers/dns/webnamesca"
|
||||
"github.com/go-acme/lego/v5/providers/dns/webnamesru"
|
||||
"github.com/go-acme/lego/v5/providers/dns/websupport"
|
||||
"github.com/go-acme/lego/v5/providers/dns/wedos"
|
||||
"github.com/go-acme/lego/v5/providers/dns/westcn"
|
||||
@@ -195,7 +195,7 @@ import (
|
||||
// NewDNSChallengeProviderByName Factory for DNS providers.
|
||||
func NewDNSChallengeProviderByName(name string) (challenge.Provider, error) {
|
||||
switch name {
|
||||
case "acme-dns", "acmedns":
|
||||
case "acmedns", "acme-dns":
|
||||
return acmedns.NewDNSProvider()
|
||||
case "active24":
|
||||
return active24.NewDNSProvider()
|
||||
@@ -541,10 +541,10 @@ func NewDNSChallengeProviderByName(name string) (challenge.Provider, error) {
|
||||
return vscale.NewDNSProvider()
|
||||
case "vultr":
|
||||
return vultr.NewDNSProvider()
|
||||
case "webnames", "webnamesru":
|
||||
return webnames.NewDNSProvider()
|
||||
case "webnamesca":
|
||||
return webnamesca.NewDNSProvider()
|
||||
case "webnamesru", "webnames":
|
||||
return webnamesru.NewDNSProvider()
|
||||
case "websupport":
|
||||
return websupport.NewDNSProvider()
|
||||
case "wedos":
|
||||
|
||||
Reference in New Issue
Block a user