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:
AndreKR 2018-06-10 21:51:01 +02:00 committed by Matt Holt
parent 7fedfd1388
commit 5005315fff

View file

@ -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.