]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
kresctl: document --config and environment variable
authorOto Šťáva <oto.stava@nic.cz>
Fri, 15 Sep 2023 13:03:52 +0000 (15:03 +0200)
committerOto Šťáva <oto.stava@nic.cz>
Mon, 25 Sep 2023 10:58:17 +0000 (12:58 +0200)
doc/manager-client.rst
doc/requirements.txt
manager/knot_resolver_manager/cli/main.py

index e8e226f5133062bd8f7c3a5038504286b99b0f6d..704c1667bc1a8c3e8ea2a3e232eeb04475e8e368 100644 (file)
@@ -21,21 +21,40 @@ It also provides tooling to work with declarative configuration (:option:`valida
 Connecting to the management API
 ================================
 
-Most :ref:`commands <manager-client-commands>` require connection to the :ref:`management API <manager-api>`.
-With default Knot Resolver configuration, ``kresctl`` should communicate with the resolver withou need to specify :option:`--socket` option.
-If not, this option must be set for each command.
+Most :ref:`commands <manager-client-commands>` require connection to the
+:ref:`management API <manager-api>`. With a standard Knot Resolver installation
+using :ref:`distribution packages <gettingstarted-install>`, ``kresctl``
+should communicate with the running resolver without any additional configuration.
+For nonstandard installations and deployments, you may need to use either
+the :option:`--config <-c <config>, --config <config>>` or
+:option:`--socket <-s <socket>, --socket <socket>>` option to tell
+``kresctl`` where to look for the API.
+
+By default, ``kresctl`` connects to the ``/var/run/knot-resolver/manager.sock``
+Unix-domain socket, or, when specified, reads the ``KRES_MANAGER_CONFIG``
+environment variable to retrieve a path to a configuration file.
 
 .. option:: -s <socket>, --socket <socket>
 
-    :default: "./manager.sock"
-
-    Optional, path to Unix-domain socket or network interface of the :ref:`management API <manager-api>`.
+    Optional, path to Unix-domain socket or network interface of the
+    :ref:`management API <manager-api>`. Cannot be used together with
+    :option:`--socket <-s <socket>, --socket <socket>>`.
 
 .. code-block:: bash
 
-    $ kresctl --socket http://127.0.0.1@5000 {command} # network interface, port 5000
+    $ kresctl --socket http://localhost:5000 {command} # network interface, port 5000
     $ kresctl --socket /path/to/socket.sock {command}  # unix-domain socket location
 
+.. option:: -c <config>, --config <config>
+
+    Optional, path to Knot Resolver declarative configuration to retrieve
+    Unix-domain socket or network interface of the management API from. Cannot
+    be used together with :option:`--socket <-s <socket>, --socket <socket>>`.
+
+.. code-block:: bash
+
+    $ kresctl --config /path/to/config.yaml {command}
+
 .. _manager-client-commands:
 
 ========
index 3fc4d399dd24f1f2de3bb67e05d34ac149cb18b6..6a2487f5f6e1edd88b7a31de2c885265d5c15b61 100644 (file)
@@ -1,4 +1,5 @@
 Sphinx>=3.0.0
 sphinx-tabs
 breathe
-json-schema-for-humans
\ No newline at end of file
+json-schema-for-humans
+sphinx_rtd_theme
index 6c144a14a2ad6f72d7f6d8ed1211de4b34c5148f..301a9539edc1d383c906896edff890dc2eb143ab 100644 (file)
@@ -45,8 +45,8 @@ def create_main_argument_parser() -> argparse.ArgumentParser:
         "--config",
         action="store",
         type=str,
-        help="Optional, path to Knot Resolver declarative configuration to retrieve socket or network "
-        "interface of the management API from. Cannot be used together with '--socket'.",
+        help="Optional, path to Knot Resolver declarative configuration to retrieve Unix-domain socket or "
+        "network interface of the management API from. Cannot be used together with '--socket'.",
         default=[],
         nargs=1,
         required=False,