Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions pkg/ffdns/ffdns_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,19 @@ func TestNewResolverWithConfig(t *testing.T) {
assert.NotNil(t, r.Dial)
}

func TestConfigKeysDocumented(t *testing.T) {
// Initialize the DNS config as a subsection (as ffresty/wsclient do), then generate the
// config markdown for every known key. This panics if any key is missing a translation,
// guarding against the "Translation for config key '...dns.servers' was not found" regression.
config.RootConfigReset()
InitConfig(config.RootSection("backend").SubSection("dns"))

assert.NotPanics(t, func() {
_, err := config.GenerateConfigMarkdown(context.Background(), "", config.GetKnownKeys())
assert.NoError(t, err)
})
}

func TestNewResolverFromConfigSection(t *testing.T) {
resetConf()
utConf.Set(DNSServers, []string{"8.8.8.8", "1.1.1.1:53"})
Expand Down
3 changes: 2 additions & 1 deletion pkg/i18n/en_base_config_descriptions.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,8 @@ var (
ConfigGlobalMaxIdleConns = ffc("config.global.maxIdleConns", "The max number of idle connections to hold pooled", IntType)
ConfigGlobalMaxConnsPerHost = ffc("config.global.maxConnsPerHost", "The max number of connections, per unique hostname. Zero means no limit", IntType)
ConfigGlobalMaxIdleConnsPerHost = ffc("config.global.maxIdleConnsPerHost", "The max number of idle connections, per unique hostname. Zero means net/http uses the default of only 2.", IntType)
ConfigGlobalDNSServers = ffc("config.global.dnsServers", "An optional list of DNS server addresses (host or host:port, port defaults to 53) to use instead of the system resolver. Setting this forces use of Go's built-in DNS resolver.", ArrayStringType)
ConfigGlobalDNSServers = ffc("config.global.dns.servers", "An optional list of DNS server addresses (host or host:port, port defaults to 53) to use instead of the system resolver. Setting this forces use of Go's built-in DNS resolver.", ArrayStringType)
ConfigGlobalDNSTimeout = ffc("config.global.dns.timeout", "The dial timeout when contacting a configured DNS server", TimeDurationType)
ConfigGlobalMethod = ffc("config.global.method", "The HTTP method to use when making requests to the Address Resolver", StringType)
ConfigGlobalAuthType = ffc("config.global.auth.type", "The auth plugin to use for server side authentication of requests", StringType)
ConfigGlobalPassthroughHeadersEnabled = ffc("config.global.passthroughHeadersEnabled", "Enable passing through the set of allowed HTTP request headers", BooleanType)
Expand Down
Loading