forked from TrueCloudLab/lego
azure: zone name as environment variable (#1433)
This commit is contained in:
parent
6f5f694cd5
commit
a653611dc8
4 changed files with 8 additions and 0 deletions
|
@ -261,6 +261,7 @@ func displayDNSHelp(name string) error {
|
||||||
ew.writeln(` - "AZURE_POLLING_INTERVAL": Time between DNS propagation check`)
|
ew.writeln(` - "AZURE_POLLING_INTERVAL": Time between DNS propagation check`)
|
||||||
ew.writeln(` - "AZURE_PROPAGATION_TIMEOUT": Maximum waiting time for DNS propagation`)
|
ew.writeln(` - "AZURE_PROPAGATION_TIMEOUT": Maximum waiting time for DNS propagation`)
|
||||||
ew.writeln(` - "AZURE_TTL": The TTL of the TXT record used for the DNS challenge`)
|
ew.writeln(` - "AZURE_TTL": The TTL of the TXT record used for the DNS challenge`)
|
||||||
|
ew.writeln(` - "AZURE_ZONE_NAME": Zone name to use inside Azure DNS service to add the TXT record in`)
|
||||||
|
|
||||||
ew.writeln()
|
ew.writeln()
|
||||||
ew.writeln(`More information: https://go-acme.github.io/lego/dns/azure`)
|
ew.writeln(`More information: https://go-acme.github.io/lego/dns/azure`)
|
||||||
|
|
|
@ -49,6 +49,7 @@ More information [here](/lego/dns/#configuration-and-credentials).
|
||||||
| `AZURE_POLLING_INTERVAL` | Time between DNS propagation check |
|
| `AZURE_POLLING_INTERVAL` | Time between DNS propagation check |
|
||||||
| `AZURE_PROPAGATION_TIMEOUT` | Maximum waiting time for DNS propagation |
|
| `AZURE_PROPAGATION_TIMEOUT` | Maximum waiting time for DNS propagation |
|
||||||
| `AZURE_TTL` | The TTL of the TXT record used for the DNS challenge |
|
| `AZURE_TTL` | The TTL of the TXT record used for the DNS challenge |
|
||||||
|
| `AZURE_ZONE_NAME` | Zone name to use inside Azure DNS service to add the TXT record in |
|
||||||
|
|
||||||
The environment variable names can be suffixed by `_FILE` to reference a file instead of a value.
|
The environment variable names can be suffixed by `_FILE` to reference a file instead of a value.
|
||||||
More information [here](/lego/dns/#configuration-and-credentials).
|
More information [here](/lego/dns/#configuration-and-credentials).
|
||||||
|
|
|
@ -33,6 +33,7 @@ const (
|
||||||
EnvTenantID = envNamespace + "TENANT_ID"
|
EnvTenantID = envNamespace + "TENANT_ID"
|
||||||
EnvClientID = envNamespace + "CLIENT_ID"
|
EnvClientID = envNamespace + "CLIENT_ID"
|
||||||
EnvClientSecret = envNamespace + "CLIENT_SECRET"
|
EnvClientSecret = envNamespace + "CLIENT_SECRET"
|
||||||
|
EnvZoneName = envNamespace + "ZONE_NAME"
|
||||||
|
|
||||||
EnvTTL = envNamespace + "TTL"
|
EnvTTL = envNamespace + "TTL"
|
||||||
EnvPropagationTimeout = envNamespace + "PROPAGATION_TIMEOUT"
|
EnvPropagationTimeout = envNamespace + "PROPAGATION_TIMEOUT"
|
||||||
|
@ -242,6 +243,10 @@ func (d *DNSProvider) CleanUp(domain, token, keyAuth string) error {
|
||||||
|
|
||||||
// Checks that azure has a zone for this domain name.
|
// Checks that azure has a zone for this domain name.
|
||||||
func (d *DNSProvider) getHostedZoneID(ctx context.Context, fqdn string) (string, error) {
|
func (d *DNSProvider) getHostedZoneID(ctx context.Context, fqdn string) (string, error) {
|
||||||
|
if zone := env.GetOrFile(EnvZoneName); zone != "" {
|
||||||
|
return zone, nil
|
||||||
|
}
|
||||||
|
|
||||||
authZone, err := dns01.FindZoneByFqdn(fqdn)
|
authZone, err := dns01.FindZoneByFqdn(fqdn)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return "", err
|
return "", err
|
||||||
|
|
|
@ -20,6 +20,7 @@ Example = ''''''
|
||||||
AZURE_PROPAGATION_TIMEOUT = "Maximum waiting time for DNS propagation"
|
AZURE_PROPAGATION_TIMEOUT = "Maximum waiting time for DNS propagation"
|
||||||
AZURE_TTL = "The TTL of the TXT record used for the DNS challenge"
|
AZURE_TTL = "The TTL of the TXT record used for the DNS challenge"
|
||||||
AZURE_METADATA_ENDPOINT = "Metadata Service endpoint URL"
|
AZURE_METADATA_ENDPOINT = "Metadata Service endpoint URL"
|
||||||
|
AZURE_ZONE_NAME = "Zone name to use inside Azure DNS service to add the TXT record in"
|
||||||
|
|
||||||
[Links]
|
[Links]
|
||||||
API = "https://docs.microsoft.com/en-us/go/azure/"
|
API = "https://docs.microsoft.com/en-us/go/azure/"
|
||||||
|
|
Loading…
Reference in a new issue