Oto Šťáva [Tue, 12 Sep 2023 12:27:09 +0000 (14:27 +0200)]
.gitlab-ci: fix Pages publishing
This commit renames `docs:public` to `pages` as required by GitLab CI to
recognize Pages jobs correctly. It also adds the `public` directory into
`artifacts:paths`.
Vladimír Čunát [Wed, 23 Aug 2023 09:58:39 +0000 (11:58 +0200)]
modules/hints,lib/rules: rework TTL defaults
It was a bit wide, with 5s and 3h, and distinction between
these two "groups" of rules was a bit random wrt. TTL choice.
Now: 5m for user's rules and 1h for RFC-default rules.
I found it relatively hard to choose defaults, but at least for
user-supplied rules it's trivial to configure a different default.
Vladimír Čunát [Fri, 18 Aug 2023 17:13:12 +0000 (19:13 +0200)]
hints: expose as C kr_rule_local_*()
At least the normal non-root hints.
We needed extended API for this functionality, and C API is simpler
for this, thanks to LuaJIT FFI.
However, this required moving code from the separate module.
The moved code is not changed in any way in this commit.
I considered it bad to keep such core code outside the main daemon+lib,
as it's not big. Now LuaJIT FFI forced me to clean this up.
Vladimír Čunát [Wed, 30 Aug 2023 14:36:29 +0000 (16:36 +0200)]
scripts/make-archive.sh: more precise tag detection
This works better in the current case when master branch with the most
recent 5.7.0 tag got merged into the 6.0 branch. In that case we do not
want the most recent *generally* reachable tag, and git-describe has
probably good logic for this (using first-parent jumps I guess).
Oto Šťáva [Tue, 29 Aug 2023 08:38:13 +0000 (10:38 +0200)]
.gitlab-ci.yml: use environments for documentation versioning
This leverages Environments on GitLab to expose different versions of
Knot Resolver docs. The `docs:build` job builds the documentation and
exposes it via job artifacts. Then `docs:develop` (for branches) and
`docs:release` (for tags) take these artifacts and expose them via an
Environment link (an example of this in action may be seen at
[https://gitlab.nic.cz/ostava/knot-resolver/-/environments]).
There is also an optional, manually runnable `docs:public` job, which,
when run, propagates the documentation to the main GitLab Pages of the
project (e.g. [https://knot.pages.nic.cz/knot-resolver]) - this will
probably be mostly used for the latest release, although this setup
pretty much allows us to swap it for whatever version we like at any
time.
Oto Šťáva [Mon, 21 Aug 2023 07:44:10 +0000 (09:44 +0200)]
manager: run kresctl from the executor's working directory
This updates `poethepoet` to version `^0.22.0`
(https://github.com/nat-n/poethepoet/releases/tag/v.0.22.0), which
allows tasks to have a working directory different from the project
path.
This breaks the `poe` script on Python `<3.8`, but discussions took
place on Slack where we came to the conclusion that this is fine. The
script is meant for developers only and does not affect end users on
systems that do not provide newer Python versions.
Oto Šťáva [Tue, 1 Aug 2023 14:36:53 +0000 (16:36 +0200)]
daemon: more avoidance of excessive TCP reconnections
Previously this penalization was only triggered if the remote server
closed TCP. Now it's extended to us closing it when the server
(only) sends back some nonsense. At least for the cases which I could
see immediately.
That's just three trivial one-line additions; the rest is refactoring.
Adapted to 6.0 from commit 6468ab22 by Oto Šťáva <oto.stava@nic.cz>
Co-Authored-By: Vladimír Čunat <vladimir.cunat@nic.cz>
Oto Šťáva [Mon, 21 Aug 2023 13:01:11 +0000 (15:01 +0200)]
manager: use self._type in KresID.__eq__()
Fixes a case where a GC and KRESD KresID with the same `self._id` would
be considered equal. Said behaviour breaks listing of all running
subprocesses, where `kresd0` would be missing, because it has the same
`self._id` as `cache-gc`.
Vladimír Čunát [Sat, 29 Jul 2023 15:53:34 +0000 (17:53 +0200)]
daemon: more avoidance of excessive TCP reconnections
Previously this penalization was only triggered if the remote server
closed TCP. Now it's extended to us closing it when the server
(only) sends back some nonsense. At least for the cases which I could
see immediately.
That's just three trivial one-line additions; the rest is refactoring.
Vladimír Čunát [Sun, 13 Aug 2023 15:34:46 +0000 (17:34 +0200)]
docs: fix padding descriptions
Mentioning just answers is misleading. Padding is very important
for queries as well; for us that applies during forwarding over TLS.
Also describe /tls/auto_discovery as experimental in the
configuration schema. It's a rather dead experiment from long ago.
I hope it can't be confused with more recent things like
https://datatracker.ietf.org/doc/draft-ietf-dprive-unilateral-probing/
Vladimír Čunát [Fri, 4 Aug 2023 17:22:23 +0000 (19:22 +0200)]
hints: merge RRs instead of replacing them
We had this behavior in 5.x.
Lua level: affects hints.set() and hints['name'] and hints.add_hosts()
YAML level: /local-data/addresses and /local-data/addresses-files
I considered various approaches when writing this. This one won because
in /etc/hosts like files a name can be repeated with arbitrary lines
in between, and users can reasonably expect it to collect all addresses.
Oto Šťáva [Fri, 11 Aug 2023 07:17:57 +0000 (09:17 +0200)]
manager/poetry.lock: remove
Lockfiles are generally encouraged to be committed into VCS to ensure
reproducible builds on all machines. Our situation is slightly
different - we are more interested in supporting a wide range of setups
on a wide range of systems.
Our `poetry.lock` also contained some outdated library versions that had
CVEs reported on them, and GitHub did not like that, so this
incidentally also solves that problem for us. Since the lock file was
only used during development, this will not affect end users in any way
(runtime dependencies are managed by each distro's package manager).
Vladimír Čunát [Thu, 3 Aug 2023 15:31:11 +0000 (17:31 +0200)]
lib/rules: when forwarding, avoid resolving NS's name
With "authoritative forwarding" it could happen that NS selection
decided to resolve the virtual ns.invalid name of the NS to get
either A or AAAA (if either was missing in the forwarding rule).