Commit Graph

14 Commits

Author SHA1 Message Date
ThinkChaos 73e5d6ab88 refactor: remove `model.Request.Log` in favor of use `Context` 2024-03-19 19:10:07 -04:00
DerRockWolf c112e86740
feat: add upstream strategy `strict` (#1093) 2023-08-21 09:50:23 +02:00
ThinkChaos 5088c75a78
refactor: configuration rework (usage and printing) (#920)
* 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`
2023-03-12 22:14:10 +01:00
Dimitri Herzog 3e95b12eed feat: caching for empty DNS responses (#700) 2022-11-08 21:45:28 +01:00
Kwitsch dfd46eb9f5 ResponseType SPECIAL added 2022-08-26 23:59:11 +02:00
Dimitri Herzog 3c5b7a20dc
chore: Managing of external tools with go modules (#616) (#617) 2022-08-03 22:10:07 +02:00
Kwitsch c912356740
Option to handle FQDN only requests (#561) 2022-06-20 13:02:51 +02:00
ThinkChaos 62c7816ab3
Support of DoH/DoT as bootstrap DNS (#485) 2022-04-22 22:12:35 +02:00
Dimitri Herzog 28789ee7fe
filtering of queries (#450) (#474) 2022-04-01 08:58:09 +02:00
Dimitri Herzog 476dd7d0eb update go-enum to v0.4.0 2022-03-28 21:35:48 +02:00
FileGo b43c7aa2cb
Enable resolving hosts file (#362)
fixes #362 

Co-authored-by: Dimitri Herzog <dimitri.herzog@gmail.com>
2022-01-04 15:40:09 +01:00
Dimitri Herzog a90fb5d1c2
Extract client name from the URL (DoH and DoT) (#317)
* Extract client name from the URL (DoH and DoT) #304

* improved tests
2021-10-13 22:47:14 +02:00
Dimitri Herzog ee8f041938 refactoring: generate enums 2021-09-11 21:31:03 +02:00
Dimitri Herzog 63735546bb moving model types to the separate package 2021-09-08 21:38:34 +02:00