]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
doc: various fixes
authorOto Šťáva <oto.stava@nic.cz>
Fri, 15 Mar 2024 13:24:29 +0000 (14:24 +0100)
committerOto Šťáva <oto.stava@nic.cz>
Fri, 15 Mar 2024 14:51:04 +0000 (15:51 +0100)
Fix cross-references, heading levels, etc.

17 files changed:
daemon/bindings/cache.rst
daemon/bindings/net_dns_tweaks.rst
daemon/scripting.rst
doc/dev/architecture-manager.rst
doc/dev/architecture.rst
doc/dev/build.rst
doc/dev/config-lua-logging-monitoring.rst
doc/dev/config-lua-network.rst
doc/dev/index.rst
doc/dev/lib.rst
doc/dev/logging_api.rst [new file with mode: 0644]
doc/user/config-forward.rst
doc/user/config-logging-monitoring.rst
lib/README.rst
modules/stats/README.rst
systemd/multiinst.rst
tests/README.rst

index 36114d226b65b32537d21f43def1ab569e57c9db..879bc6e32922737b9a3ed6d2ad48f71f4f0b2c82 100644 (file)
@@ -51,9 +51,9 @@ to leave some free space for special files, such as locks.:
 
    cache.size = cache.fssize() - 10*MB
 
-.. note:: The :ref:`garbage-collector` can be used to periodically trim the
-   cache. It is enabled and configured by default when running kresd with
-   systemd integration.
+.. note:: The `cache garbage collector <../deployment-advanced-no-systemd-processes.html#garbage-collector>`_
+   can be used to periodically trim the cache. It is enabled and configured by
+   default when running kresd with systemd integration.
 
 .. _`cache_persistence`:
 
index 4cfeba64df6eded5a3393693341b256f014c4446..b1f67139f98ffa5c07b7b9aa231761d36656c64a 100644 (file)
@@ -32,4 +32,4 @@ Default values should not be changed except for very special cases.
        4096    -- result # 1
        1232    -- result # 2
 
-.. include:: ../modules/workarounds/README.rst
+.. include:: ../../modules/workarounds/README.rst
index 742aa955e3d7716a234f9286b23a060f87767420..3861fb42239d4581c2a990988339f64a3751ba12 100644 (file)
@@ -30,9 +30,9 @@ another program, e.g. a maintenance script.
    :ref:`systemd-multiple-instances`.
 
 When Knot Resolver is started using Systemd (see section
-:ref:`gettingstarted-startup`) it creates a control socket in path
-``/run/knot-resolver/control/$ID``. Connection to the socket can
-be made from command line using e.g. ``socat``:
+`Startup <../gettingstarted-startup.html>`_) it creates a control socket in path
+``/run/knot-resolver/control/$ID``. Connection to the socket can be made from
+command line using e.g. ``socat``:
 
 .. code-block:: bash
 
@@ -389,9 +389,9 @@ see the cqueues documentation for more information. Here is an simple example:
     end
   end)
 
-.. include:: ../daemon/bindings/event.rst
+.. include:: ../../daemon/bindings/event.rst
 
-.. include:: ../modules/etcd/README.rst
+.. include:: ../../modules/etcd/README.rst
 
 .. _closures: https://www.lua.org/pil/6.1.html
 .. _cqueues: https://25thandclement.com/~william/projects/cqueues.html
index 1a0381af4bd4b235544e858144b41bedf5ce1481..4e3371a923c403be038ff4e23a629de3892cc64a 100644 (file)
@@ -2,14 +2,11 @@
 ``kres-manager``
 ****************
 
-.. note::
-    This guide is intended for advanced users and developers. You don't have to know and understand any of this to use Knot Resolver.
-
 The manager is a component written in Python and a bit of C used for native extension modules. The main goal of the manager is to ensure the system is set up according to a given configuration, provide a user-friendly interface. Performance is only secondary to correctness.
 
 The manager is mostly modelled around config processing pipeline:
 
-.. image:: ../architecture-config.svg
+.. image:: ../architecture-manager.svg
     :width: 100%
     :alt: Diagram showing a configuration change request processing pipeline inside of the manager. The request goes first through an API server, then through parsing, validation and normalization steps, then into an actual system manager, which commands supervisord and other system components such as kresd.
 
@@ -19,7 +16,7 @@ API
 
 The API server is implemented using `aiohttp <https://docs.aiohttp.org/en/stable>`_. This framework provides the application skeleton and manages application runtime. The manager is actually a normal web application with the slight difference that we don't save the data in a database but rather modify state of other processes.
 
-Code of the API server is located only in a `single source code file <https://gitlab.nic.cz/knot/knot-resolver/-/blob/manager/manager/knot_resolver_manager/server.py>`_. It also contains description of the manager's startup procedure.
+Code of the API server is located only in a `single server.py source code file <https://gitlab.nic.cz/knot/knot-resolver/-/blob/manager/manager/knot_resolver_manager/server.py>`_. It also contains description of the manager's startup procedure.
 
 Config processing
 =================
@@ -36,7 +33,7 @@ Actual manager
 
 The actual core of the whole application is originally named the manager. It keeps a high-level view of the systems state and performs all necessary operations to change the state to the desired one. In other words, manager is the component handling rolling restarts, config update logic and more.
 
-The code is contained mainly in a `single source code file <https://gitlab.nic.cz/knot/knot-resolver/-/blob/manager/manager/knot_resolver_manager/kres_manager.py>`_.
+The code is contained mainly in a `single kres_manager.py source code file <https://gitlab.nic.cz/knot/knot-resolver/-/blob/manager/manager/knot_resolver_manager/kres_manager.py>`_.
 
 
 Interactions with supervisord
@@ -49,9 +46,9 @@ Communication with supervisord happens on pretty much all possible levels. We ed
 
 First, we `generate supervisord's configuration file <https://gitlab.nic.cz/knot/knot-resolver/-/blob/manager/manager/knot_resolver_manager/kresd_controller/supervisord/supervisord.conf.j2>`_. The configuration file sets stage for further communication by specifying location of the pidfile and API Unix socket. It prepares configuration for subprocesses and most significantly, it loads our custom extensions.
 
-`The extensions <https://gitlab.nic.cz/knot/knot-resolver/-/tree/manager/manager/knot_resolver_manager/kresd_controller/supervisord/plugin>`_ don't use a lot of code. There are four of them - the simplest one provides a speedier XMLRPC API for starting processes, it removes delays that are not necessary for our usecase. Another one implements systemd's ``sd_notify()`` API for supervisord, so we can track the lifecycle of ``kresd``s more precisely. Another extension changes the way logging works and the last extension monitors the lifecycle of the manager and forwards some signals.
+`The extensions <https://gitlab.nic.cz/knot/knot-resolver/-/tree/manager/manager/knot_resolver_manager/kresd_controller/supervisord/plugin>`_ don't use a lot of code. There are four of them - the simplest one provides a speedier XMLRPC API for starting processes, it removes delays that are not necessary for our usecase. Another one implements systemd's ``sd_notify()`` API for supervisord, so we can track the lifecycle of ``kresd`` instances more precisely. Another extension changes the way logging works and the last extension monitors the lifecycle of the manager and forwards some signals.
 
 .. note::
     The extensions mentioned above use monkeypatching to achieve their design goals. We settled for this approach, because supervisord's codebase appears mostly stable. The code we patch has not been changed for years. Other option would be forking supervisord and vendoring it. We decided against that mainly due to packaging complications it would cause with major Linux distributions.
 
-For executing subprocesses, we don't actually change the configuration file, we only use XMLRPC API and tell supervisord to start already configured programs. For one specific call though, we use our extension instead of the build-in method of starting processes as it is significantly faster.
\ No newline at end of file
+For executing subprocesses, we don't actually change the configuration file, we only use XMLRPC API and tell supervisord to start already configured programs. For one specific call though, we use our extension instead of the build-in method of starting processes as it is significantly faster.
index ba281f9d35f36bb93435c1018827c17536ff3dac..79084e5b28bc3c1aaa4177417c4b79ce21c5befc 100644 (file)
@@ -4,7 +4,7 @@ System architecture
 
 Knot Resolver is split into several components, namely the manager, ``kresd`` and the garbage collector. In addition to these custom components, we also rely on `supervisord <http://supervisord.org/>`_.
 
-.. image:: architecture-supervisor.svg
+.. image:: ../architecture-schema.svg
     :width: 100%
     :alt: Diagram showing process tree and contol relationship between Knot Resolver components. Supervisord is a parent to all processes, namely manager, kresd instances and gc. Manager on the other hand controls every other component and what it does.
 
@@ -45,4 +45,4 @@ You can learn more about architecture of individual Resolver components in the f
 
     architecture-manager
     architecture-kresd
-    architecture-gc
\ No newline at end of file
+    architecture-gc
index 4e2156e0831427f3dc9224d8b32e1626474eda79..b6bfd9f43cb07ecfdbfa2206a72eef42a4d9d6e4 100644 (file)
@@ -228,7 +228,7 @@ For complete control over the build flags, use ``--buildtype=plain`` and set
 ``CFLAGS``, ``LDFLAGS`` when creating the build directory with ``meson``
 command.
 
-.. include:: ../tests/README.rst
+.. include:: ../../tests/README.rst
 
 .. _build-html-doc:
 
index 8a2a25b650d5c846b4a5c5ebcbd9cdcba3ebe9a4..c0b026b33926e6d4650b981a6349f1d993f9b452 100644 (file)
@@ -22,7 +22,7 @@ For debugging purposes it is possible to use the very verbose ``debug`` level,
 but that is generally not usable unless restricted in some way (see below).
 
 In addition to levels, logging is also divided into the
-:ref:`groups <config_log_groups>`. All groups
+:ref:`log groups <config_log_groups>`. All groups
 are logged by default, but you can enable ``debug`` level for selected groups using
 :func:`log_groups` function. Other groups are logged to the log level
 set by :func:`log_level`.
@@ -97,5 +97,3 @@ Additional monitoring and debugging methods are described below. If none of thes
    modules-ta_signal_query
    modules-detect_time_skew
    modules-detect_time_jump
-   config-debugging
-   config-logging-header
index 8bd67eefb88db0dd0f21d1fa2aef4a268874c347..241b67ff70f58d3696e72482688dff2ede936f48 100644 (file)
@@ -53,7 +53,6 @@ Following chapters describe basic configuration of how resolver retrieves data f
    :maxdepth: 2
 
    daemon-bindings-net_client
-   config-network-forwarding
 
 DNS protocol tweaks
 ===================
index 406c68441cc85728bed4dfa0fc0e1bfbb0a82ef8..389876f2831d182df18b50e03acc773eefcac9c4 100644 (file)
@@ -36,12 +36,13 @@ Welcome to Knot Resolver's documentation for developers and advanced users!
 
 .. toctree::
    :caption: Modules and worker API, Lib
-   :name: configuration-lua-chapter
+   :name: modules-api-lib-chapter
    :maxdepth: 1
 
    lib
    modules_api
    worker_api
+   logging_api
 
 .. toctree::
    :caption: Architecture
index 2378f5668a199ad2e06d29db8c4b12188f239c7e..89e29df56902c97d2bddc6e2a27a7a367dee7dae 100644 (file)
@@ -73,4 +73,4 @@ Utilities
 
 .. _lib_generics:
 
-.. include:: ../lib/generic/README.rst
+.. include:: ../../lib/generic/README.rst
diff --git a/doc/dev/logging_api.rst b/doc/dev/logging_api.rst
new file mode 100644 (file)
index 0000000..09b705c
--- /dev/null
@@ -0,0 +1,9 @@
+.. SPDX-License-Identifier: GPL-3.0-or-later
+
+Logging API reference
+=====================
+
+.. _config_log_groups:
+
+.. doxygenfile:: lib/log.h
+    :project: libkres
index 051f7119c7953354527e1a347d2bd1126cc11a12..5e4bf14c0839416316e19a7339f96eba063572ac 100644 (file)
@@ -19,13 +19,12 @@ Forwarding implementation in Knot Resolver has following properties:
   * Answers from *upstream* servers are cached.
   * Answers from *upstream* servers are locally DNSSEC-validated, unless dnssec is disabled.
   * Resolver automatically selects which IP address from given set of IP addresses will be used (based on performance characteristics).
-  * :ref:`Forwarding <config-forward>` can use either encrypted or unencrypted DNS protocol.
+  * Forwarding can use either encrypted or unencrypted DNS protocol.
 
 .. warning::
 
         We strongly discourage use of "fake top-level domains" like ``corp.`` because these made-up domains are indistinguishable from an attack, so DNSSEC validation will prevent such domains from working.
-        If you *really* need a variant of forwarding which does not DNSSEC-validate received data please see chapter :ref:`dns-graft`.
-        In long-term it is better to migrate data into a legitimate, properly delegated domains which do not suffer from these security problems.
+        In the long-term it is better to migrate data into a legitimate, properly delegated domains which do not suffer from these security problems.
 
 .. code-block:: yaml
 
index 081fac75bf91b3945890c3afb99660faa28f5c7f..a181f05ba38dc0ac5b30872d03f183cfd2064de0 100644 (file)
@@ -34,7 +34,7 @@ E.g. on distributions using systemd-journald use command ``journalctl -eu knot-r
 
    .. option:: groups: <list of logging groups>
 
-      Use to turn-on ``debug`` logging for the selected `groups <./dev/config-logging-header.html>`_
+      Use to turn-on ``debug`` logging for the selected `groups <./dev/logging_api.html>`_
       regardless of the global log level. Other groups are logged to the log based on the initial level.
 
       .. It is also possible to enable ``debug`` logging level for particular requests,
index 1c8cf7b22622b44406e599cfdaf8d9ad0534ef6a..b631fe7b9dfc249c1c75de8835966e289d0d02fb 100644 (file)
@@ -30,7 +30,11 @@ The resolution process starts with the functions in :ref:`resolve.c <lib_api_rpl
 
 This is the *driver*. The driver is not meant to know *"how"* the query resolves, but rather *"when"* to execute *"what"*.
 
-.. image:: ../doc/resolution.png
+..
+   Paths are resolved relative to the document that includes this, so this is
+   kind of a mess. (This is included in `/doc/dev/lib.rst`)
+
+.. image:: ../resolution.png
    :align: center
 
 On the other side are *layers*. They are responsible for dissecting the packets and informing the driver about the results. For example, a *produce* layer generates query, a *consume* layer validates answer.
index 014c9f06fac0f9140d844bf6a619081d79eb9bc7..1def925c418b4d2c8f26b6630c583beec925a19e 100644 (file)
@@ -209,5 +209,5 @@ and include subrequests. The list maximum size is 5000 entries, make diffs if yo
 
 Clear the list of most frequent iterative queries.
 
-.. include:: ../modules/graphite/README.rst
-.. include:: ../modules/http/prometheus.rst
+.. include:: ../../modules/graphite/README.rst
+.. include:: ../../modules/http/prometheus.rst
index 00b1802921beb714c0449ea3c3da635c4b98cf3a..9884f5b7d6b252171dc95796668c651e5ed38230 100644 (file)
@@ -5,8 +5,8 @@
 Multiple instances
 ==================
 
-.. note:: This section describes the usage of kresd when running under systemd.
-   For other uses, please refer to :ref:`deployment-no-systemd`.
+.. note:: This section describes the usage of kresd when running under systemd
+   without Manager.
 
 Knot Resolver can utilize multiple CPUs running in multiple independent instances (processes), where each process utilizes at most single CPU core on your machine. If your machine handles a lot of DNS traffic run multiple instances.
 
index 69393dcc01725f02ea3de9d446990b9f9ea6230c..37867b3890f27e75206ecbd690bd7037eb4d5a02 100644 (file)
@@ -1,13 +1,13 @@
 .. SPDX-License-Identifier: GPL-3.0-or-later
 
 Tests
------
+=====
 
 The following is a non-comprehensitve lists of various tests that can be found
 in this repo. These can be enabled by the build system.
 
 Unit tests
-~~~~~~~~~~
+----------
 
 The unit tests depend on cmocka_ and can easily be executed after compilation.
 They are enabled by default (if ``cmocka`` is found).
@@ -18,7 +18,7 @@ They are enabled by default (if ``cmocka`` is found).
         $ meson test -C build_dir --suite unit
 
 Postinstall tests
-~~~~~~~~~~~~~~~~~
+-----------------
 
 There following tests require a working installation of kresd.  The
 binary ``kresd`` found in ``$PATH`` will be tested. When testing through meson,
@@ -30,7 +30,7 @@ kresd first.
         $ ninja install -C build_dir
 
 Config tests
-~~~~~~~~~~~~
+------------
 
 Config tests utilize the kresd's lua config file to execute arbitrary tests,
 typically testing various modules, their API etc.
@@ -46,7 +46,7 @@ the build dir).
         $ meson test -C build_dir --suite config
 
 Extra tests
-~~~~~~~~~~~
+-----------
 
 The extra tests require a large set of additional dependencies and executing
 them outside of upstream development is probably redundant.
@@ -82,7 +82,7 @@ example TCP, TLS and its connection management.
         $ meson test -C build_dir --suite pytests
 
 Useful meson commands
-~~~~~~~~~~~~~~~~~~~~~
+---------------------
 
 It's possible to run only specific test suite or a test.