forked from TrueCloudLab/lego
dns/exec: Allow passing the program to the provider directly (#573)
This adds a function NewDNSProviderProgram() to the exec provider that allows to set the program to run directly instead of via the environment variable. This is similar to how other providers allow to set their credentials.
This commit is contained in:
parent
7fedfd1388
commit
5005315fff
1 changed files with 7 additions and 1 deletions
|
@ -48,7 +48,13 @@ func NewDNSProvider() (*DNSProvider, error) {
|
||||||
return nil, errors.New("environment variable EXEC_PATH not set")
|
return nil, errors.New("environment variable EXEC_PATH not set")
|
||||||
}
|
}
|
||||||
|
|
||||||
return &DNSProvider{program: s}, nil
|
return NewDNSProviderProgram(s)
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewDNSProviderProgram returns a new DNS provider which runs the given program
|
||||||
|
// for adding and removing the DNS record.
|
||||||
|
func NewDNSProviderProgram(program string) (*DNSProvider, error) {
|
||||||
|
return &DNSProvider{program: program}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// Present creates a TXT record to fulfil the dns-01 challenge.
|
// Present creates a TXT record to fulfil the dns-01 challenge.
|
||||||
|
|
Loading…
Reference in a new issue