-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Description
I'm trying to make DNS providers with a custom config, but pre-populating default values from environment variables.
For example, take the Cloudflare provider: https://pkg.go.dev/github.com/go-acme/lego/v3@v3.3.0/providers/dns/cloudflare?tab=doc - the env variable logic is split into two places: NewDefaultConfig()
and NewDNSProvider()
. But these functions can't be used together!
Only NewDNSProvider()
fills in default credentials from the environment, but it does not expose the config for further customization. So the config is only half-filled out, and we cannot use NewDefaultConfig()
and NewDNSProvider()
together.
If a default config was pre-populated from the environment and then returned from NewDefaultConfig()
, this would make it possible for us to avoid putting DNS provider credentials in app config files. It'd be nice to call just one function and get a config that is filled out all the way from the environment. Otherwise, we'll have to copy+paste and repeat the env variable logic for every DNS provider that does this in our own applications. 😢
So, could we move all the environment variable logic into NewDefaultConfig()
rather than having it split in two places like it is now? 😁