Commit Graph

16 Commits

Author SHA1 Message Date
ThinkChaos a6654dcd57 refactor(config): rename `StartStrategyType` to `InitStrategy` 2023-12-05 20:52:46 -05:00
ThinkChaos 270dc178dc refactor(config): add `TLSVersion` type 2023-11-23 08:45:18 -05:00
DerRockWolf 94663eeaeb
feat: add upstream strategy `random` (#1221)
Also simplify code by getting rid of `resolversPerClient` and all surrounding logic.
2023-11-18 15:42:14 -05:00
DerRockWolf c112e86740
feat: add upstream strategy `strict` (#1093) 2023-08-21 09:50:23 +02:00
ThinkChaos cfc3699ab5 feat: support multiple hosts files 2023-07-07 09:16:20 -04: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 2b49c2048f
feat(querylog): define which information should be logged (#765) (#766) 2022-11-26 22:12:56 +01:00
Dimitri Herzog 3e95b12eed feat: caching for empty DNS responses (#700) 2022-11-08 21:45:28 +01:00
Dimitri Herzog 177c20fb96 update: github.com/abice/go-enum 2022-10-10 21:46:53 +02:00
ThinkChaos f48908f7be
Add connectIPVersion to choose how Blocky connects to other hosts (#589)
This impacts both DNS lookups and lists downloading.

Co-authored-by: Dimitri Herzog <dimitri.herzog@gmail.com>
2022-09-19 21:44:12 +02:00
Kwitsch fd93f67899
feat: new parameter "StartStrategy" (#566) (#636)
Blocky should start resolving DNS traffic as soon as possible
2022-09-03 22:12:07 +02:00
Dimitri Herzog d1289e8452 removed deprecated configuration parameters 2022-03-28 21:48:49 +02:00
Dimitri Herzog 476dd7d0eb update go-enum to v0.4.0 2022-03-28 21:35:48 +02:00
FileGo c176b02ac9
Support Postgresql database for query log (#348)
Co-authored-by: Dimitri Herzog <dimitri.herzog@gmail.com>
2022-01-07 21:42:06 +01:00
FileGo 98cf484517
Option to disable the query log (#333) 2021-11-10 21:54:32 +01:00
Dimitri Herzog ee8f041938 refactoring: generate enums 2021-09-11 21:31:03 +02:00