Commit Graph

7 Commits

Author SHA1 Message Date
Dimitri Herzog 5a5ba550d5
fix: configuration error if customDNS.mappings contains multiple entries with whitespace (#1496) 2024-05-26 19:49:50 +02:00
Ben 9f633f18d0
feat: Support defining records by dns zone format (#1360)
* feat: Support zonefile configuration for custom dns mapping

* docs: Update configuration.md

* Rename var to ok

* Linter fixes

* Remove hashes in test describe description

* Implement PR comments; zoneFileMapping -> zone, initialize with proper sizes

* Remove custom CNAME parsing

* Utilize TTL defined in zone file

* Link to wikipedia's example file

* Test to confirm that a relative zone entry without an $ORIGIN returns an error

* Write a test covering the $INCLUDE directive

* Write a test confirming that a dns zone can result in more than 1 RR

* Linting

* fix: Use proper matchers in CustomDNS Zone tests; Update configuration.md description

* Pull in config directory to support relative $INCLUDE

* Added tests to ensure the ability to use both bare filenames as well as relative filenames when using the $INCLUDE directive

* Shorten test description (Linting error)

* Move Assignment of z.RRs to the end of the UnmarshallYAML function

* Moved tests for relative $INCLUDE zones to config_test. Added test case when config param passed to blocky is a directory

* Corrected test case to _actually_ test againt bare file names
2024-02-09 17:28:58 +01:00
Ben b8b4dc323a
feat: support CNAME records in customDNS mappings (#1352)
Co-authored-by: Ben McHone <ben@mchone.dev>
2024-01-29 11:22:03 -05:00
ThinkChaos f371857150 style(tests): use `ContainElements` where possible 2023-12-01 15:53:11 -05:00
Kwitsch 26d5f6215f CustomDNSConfig -> CustomDNS 2023-11-21 21:35:41 -05:00
Kwitsch 68a8476e48
chore(build): Automation workflows (#972)
* Added fork sync workflow(syncs the main branch with upstream every 30 minutes)
* Added monthly workflow run deletion(all skipped or canceld and runs older than 30days will be deleted)
* Removed Docker image build for main branch on forks
* Added documentation how to enable sync and docker build workflows
2023-04-03 16:33:16 +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