From 5005315fff0eef3ce12511b61ebfba52b5b21185 Mon Sep 17 00:00:00 2001 From: AndreKR Date: Sun, 10 Jun 2018 21:51:01 +0200 Subject: [PATCH] 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. --- providers/dns/exec/exec.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/providers/dns/exec/exec.go b/providers/dns/exec/exec.go index ee140ae7..9bd97d03 100644 --- a/providers/dns/exec/exec.go +++ b/providers/dns/exec/exec.go @@ -48,7 +48,13 @@ func NewDNSProvider() (*DNSProvider, error) { 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.