Vladimír Čunát [Sat, 23 Sep 2023 15:45:33 +0000 (17:45 +0200)]
/views docs: rewrite again, mostly
- move typical simple examples near the top
- document the two new conditions
- reorganize the text: split conditions and actions
- other minor changes
Vladimír Čunát [Thu, 21 Sep 2023 12:51:42 +0000 (14:51 +0200)]
/views/*/options: fix when used with e.g. tags
The issue is not now; it has always been broken in 6.x.
The model is that at most one view applies on any request.
If we need to do more things, they must happen as one meta-action.
test_view_insert_action(): dropped; can't see a suitable replacement
Vladimír Čunát [Sun, 3 Sep 2023 15:33:39 +0000 (17:33 +0200)]
/views/*/{dst_subnet,protocols}: add, both backend+config
Examples:
- tagging based on dst_subnet is useful for providing different
filtering setting on different resolver addresses
- tagging based on protocols is useful to signal used transport
(change in DNS data that can be read by the final app)
Vladimír Čunát [Mon, 28 Aug 2023 08:32:08 +0000 (10:32 +0200)]
lib/rules: avoid using preallocated LMDB writes
They're a bit more efficient, but they can't work with LMDB multi-sets.
Also, write performance of rules isn't that important and typically
each rule is quite tiny anyway.
Oto Šťáva [Thu, 14 Sep 2023 12:00:28 +0000 (14:00 +0200)]
manager, kresctl: allow environment variables to specify paths
This is a bigger feature commit for development convenience with Knot
Resolver Manager. Firstly, it allows the use of `KRES_MANAGER_CONFIG`
and `KRES_MANAGER_RUNTIME` environment variables to specify the paths to
the configuration file and Knot Resolver runtime directory. This lets us
create local workspace scripts with separate configurations e.g. like
this:
This ties nicely into the second part, which is that `kresctl` is now
able to retrieve the management socket/address directly from the
declarative configuration file of Knot Resolver. This again increases
convenience for developers who may wish to change these often, and not
have to specify/change them every time they want to execute `kresctl`
from the command line.
`kresctl` adds a new `--config` option to specify the path to the
configuration file via command line arguments, and also respects the
same `KRES_MANAGER_CONFIG` environment variable, when the argument is
not specified.
Oto Šťáva [Fri, 15 Sep 2023 12:27:19 +0000 (14:27 +0200)]
doc: drop texinfo
Old legacy. The generated .texi sources cause a huge number of warnings
that we do not have a good way of fixing, and lately it stopped working
completely, without giving us any explanation as to what the problem is
(just exit code 1 and no *error* message).
Oto Šťáva [Thu, 14 Sep 2023 08:07:30 +0000 (10:07 +0200)]
manager/pyproject.toml: correct Python version for poethepoet
The former setup would cause subsequent runs of `poetry install` to
alternate between the `poethepoet` versions. Instead, we just want to
separate them for Python before 3.8 and Python from 3.8 onwards.
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.