RFC 8484 Section 4.2.1:
> A successful HTTP response with a 2xx status code (see
> Section 6.3 of RFC7231) is used for any valid DNS response,
> regardless of the DNS response code. For example, a successful 2xx
> HTTP status code is used even with a DNS message whose DNS response
> code indicates failure, such as SERVFAIL or NXDOMAIN.
https://www.rfc-editor.org/rfc/rfc8484#section-4.2.1
* made Stop context aware
* added error check
* context aware OnRequest
* linter fix
* fixed some flakiness in tests
* made DoGetRequest context aware
* this doesn't belong there and produces flakyness
Move `startVerifyUpstream` to `upstreams.startVerify` so it's accessible
via `UpstreamGroup` and we don't need to pass `startVerify` to all
resolver constructors that call `NewUpstreamResolver`.
Also has the nice benefit of greatly reducing the usage of `GetConfig`.
- `CacheControl.FlushCaches`
- `Querier.Query`
- `Resolver.Resolve`
Besides all the API churn, this leads to `ParallelBestResolver`,
`StrictResolver` and `UpstreamResolver` simplification: timeouts only
need to be setup in one place, `UpstreamResolver`.
We also benefit from using HTTP request contexts, so if the client
closes the connection we stop processing on our side.
* Whietlist dot imports for test packages
* improved generate-lcov script
* moved mock_call_sequence to helpertest
* removed default config for markdown
* generate seperate lcov.info for each directory
* path fix in lcov generation script
* ginkgo -> v2.13.1
* fixed redundant strings
* added exampleComKey
* added folder name to finish message
* hide lcov.info in devcontainer
* coverage plugin is bugged if lcov file is excluded
* moved all lcov files to coverage folder
* added requested toos #1251
* extension cleanup & added ginkgo watch
* added gcov2lcov
* added test explorer and reworked scripts
* go mod tidy
* use package cache volume
* script rework
* defined tasks
* defined launch
* don't try to convert if test was canceld
* generate lcov only in devcontainer
* disable coverage upload on forks
* wip: make lcov
* fixed unit tests for parallel
* parallel test for lists
* fix serve test for parallel
* parallel test fixes
* deleted accident commit
* wip: make lcov
* restructured settings location
* start script refactoring
* added GetProcessPort
* fixed parallel ports
* race fix
* changed port for github runner binding
* fixed local list var in test
* more local vars in tests fix
* less local vars
* run test & race parallel
* removed invalid error check
* fixed error check
* less local variables
* fixed timing problem
* removed gcov2lcov
* added generate-lcov
* added GINKGO_PROCS to makefile
* fixed workflow
* run generate-lcov on save *.go
* added tooltitude
* refactor: make `config.Duration` a struct with `time.Duration` embed
Allows directly calling `time.Duration` methods.
* refactor(HostsFileResolver): don't copy individual config items
The idea is to make adding configuration options easier, and searching
for references straight forward.
* refactor: move config printing to struct and use a logger
Using a logger allows using multiple levels so the whole configuration
can be printed in trace/verbose mode, but only important parts are
shown by default.
* squash: rename `Cast` to `ToDuration`
* squash: revert `Duration` to a simple wrapper ("new type" pattern)
* squash: `Duration.IsZero` tests
* squash: refactor resolvers to rely on their config directly if possible
* squash: implement `IsEnabled` and `LogValues` for all resolvers
* refactor: use go-enum `--values` to simplify getting all log fields
* refactor: simplify `QType` unmarshaling
* squash: rename `ValueLogger` to `Configurable`
* squash: rename `UpstreamConfig` to `ParallelBestConfig`
* squash: rename `RewriteConfig` to `RewriterConfig`
* squash: config tests
* squash: resolver tests
* squash: add `ForEach` test and improve `Chain` ones
* squash: simplify implementing `config.Configurable`
* squash: minor changes for better coverage
* squash: more `UnmarshalYAML` -> `UnmarshalText`
* refactor: move `config.Upstream` into own file
* refactor: add `Resolver.Type` method
* squash: add `log` method to `typed` to use `Resolover.Type` as prefix
* squash: tweak startup config logging
* squash: add `LogResolverConfig` tests
* squash: make sure all options of type `Duration` use `%s`
To declutter the global top level config options i propose the grouping of ports and logging options as child options of top level options.
New structure:
ports:
dns: 43
http: 4000
https: 4443
tls: 853
log:
level: warn
format: json
privacy: true
timestamp: false
* Enable start if one upstream resolver fails
* Will now check if upstream actually works
* Fixed default upstream in some tests
* Increase timeouts in some tests
* change default value of "StartVerifyUpstream" to false
Co-authored-by: Dimitri Herzog <dimitri.herzog@gmail.com>