]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
datamodel: remove webmgmt
authorAleš Mrázek <ales.mrazek@nic.cz>
Tue, 25 Mar 2025 12:35:14 +0000 (13:35 +0100)
committerAleš Mrázek <ales.mrazek@nic.cz>
Fri, 31 Oct 2025 14:11:38 +0000 (15:11 +0100)
NEWS
doc/_static/config.schema.json
python/knot_resolver/datamodel/config_schema.py
python/knot_resolver/datamodel/templates/kresd.lua.j2
python/knot_resolver/datamodel/templates/webmgmt.lua.j2 [deleted file]
python/knot_resolver/datamodel/webmgmt_schema.py [deleted file]
python/knot_resolver/manager/manager.py

diff --git a/NEWS b/NEWS
index b20ec8af44880d053255c668c105f7f513700d4f..8906c84d341c60f859de289ba0a1afb0ae40b4e6 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -6,6 +6,7 @@ Incompatible changes
 - Removed options from declarative configuration model (YAML).  
   These are mostly experimental and debugging/testing options that are not useful for general users (remain in Lua):
   - /logging/debugging
+  - /webmgmt
 
 
 Knot Resolver 6.0.16 (2025-10-30)
index 50ef4b74c27cce413be4ba08ca5eae981d363fd0..a39f95785e8ce6a54d06e9b66b2f5c631072b5d7 100644 (file)
                 "interface": null
             }
         },
-        "webmgmt": {
-            "description": "Configuration of legacy web management endpoint.",
-            "type": [
-                "object",
-                "null"
-            ],
-            "properties": {
-                "unix-socket": {
-                    "type": [
-                        "string",
-                        "null"
-                    ],
-                    "description": "Path to unix domain socket to listen to.",
-                    "default": null
-                },
-                "interface": {
-                    "type": [
-                        "string",
-                        "null"
-                    ],
-                    "description": "IP address or interface name with port number to listen to.",
-                    "default": null
-                },
-                "tls": {
-                    "type": "boolean",
-                    "description": "Enable/disable TLS.",
-                    "default": false
-                },
-                "cert-file": {
-                    "type": [
-                        "string",
-                        "null"
-                    ],
-                    "description": "Path to certificate file.",
-                    "default": null
-                },
-                "key-file": {
-                    "type": [
-                        "string",
-                        "null"
-                    ],
-                    "description": "Path to certificate key.",
-                    "default": null
-                }
-            },
-            "default": null
-        },
         "options": {
             "description": "Fine-tuning global parameters of DNS resolver operation.",
             "type": "object",
index 24b83e11d70667498c6f010c42ac82acbb9746ce..68b313b81bee44788592ac3e71b4250e98422394 100644 (file)
@@ -21,7 +21,6 @@ from knot_resolver.datamodel.rate_limiting_schema import RateLimitingSchema
 from knot_resolver.datamodel.templates import KRESD_CONFIG_TEMPLATE, POLICY_LOADER_CONFIG_TEMPLATE
 from knot_resolver.datamodel.types import EscapedStr, IntPositive, WritableDir
 from knot_resolver.datamodel.view_schema import ViewSchema
-from knot_resolver.datamodel.webmgmt_schema import WebmgmtSchema
 from knot_resolver.utils.modeling import ConfigSchema
 from knot_resolver.utils.modeling.base_schema import lazy_default
 from knot_resolver.utils.modeling.exceptions import AggregateDataValidationError, DataValidationError
@@ -96,7 +95,6 @@ class KresConfig(ConfigSchema):
         workers: The number of running kresd (Knot Resolver daemon) workers. If set to 'auto', it is equal to number of CPUs available.
         max_workers: The maximum number of workers allowed. Cannot be changed in runtime.
         management: Configuration of management HTTP API.
-        webmgmt: Configuration of legacy web management endpoint.
         options: Fine-tuning global parameters of DNS resolver operation.
         network: Network connections and protocols configuration.
         views: List of views and its configuration.
@@ -120,7 +118,6 @@ class KresConfig(ConfigSchema):
         workers: Union[Literal["auto"], IntPositive] = IntPositive(1)
         max_workers: IntPositive = IntPositive(WORKERS_MAX)
         management: ManagementSchema = lazy_default(ManagementSchema, {"unix-socket": str(API_SOCK_FILE)})
-        webmgmt: Optional[WebmgmtSchema] = None
         options: OptionsSchema = OptionsSchema()
         network: NetworkSchema = NetworkSchema()
         views: Optional[List[ViewSchema]] = None
@@ -144,7 +141,6 @@ class KresConfig(ConfigSchema):
     workers: IntPositive
     max_workers: IntPositive
     management: ManagementSchema
-    webmgmt: Optional[WebmgmtSchema]
     options: OptionsSchema
     network: NetworkSchema
     views: Optional[List[ViewSchema]]
index be7fe150872823dcce7a5fac8612384dc7e15a9e..14b862913e756bc9506d614cf7ebabdc32faff52 100644 (file)
@@ -22,9 +22,6 @@ nsid.name('{{ cfg.nsid }}' .. worker.id)
 -- MONITORING section -------------------------------
 {% include "monitoring.lua.j2" %}
 
--- WEBMGMT section ----------------------------------
-{% include "webmgmt.lua.j2" %}
-
 -- OPTIONS section ----------------------------------
 {% include "options.lua.j2" %}
 
diff --git a/python/knot_resolver/datamodel/templates/webmgmt.lua.j2 b/python/knot_resolver/datamodel/templates/webmgmt.lua.j2
deleted file mode 100644 (file)
index 938ea8d..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-{% from 'macros/common_macros.lua.j2' import boolean %}
-
-{% if cfg.webmgmt -%}
--- webmgmt
-modules.load('http')
-http.config({tls = {{ boolean(cfg.webmgmt.tls) }},
-{%- if cfg.webmgmt.cert_file -%}
-    cert = '{{ cfg.webmgmt.cert_file }}',
-{%- endif -%}
-{%- if cfg.webmgmt.cert_file -%}
-    key = '{{ cfg.webmgmt.key_file }}',
-{%- endif -%}
-}, 'webmgmt')
-net.listen(
-{%- if cfg.webmgmt.unix_socket -%}
-    '{{ cfg.webmgmt.unix_socket }}',nil,
-{%- elif cfg.webmgmt.interface -%}
-    {%- if cfg.webmgmt.interface.addr -%}
-        '{{ cfg.webmgmt.interface.addr }}',{{ cfg.webmgmt.interface.port }},
-    {%- elif cfg.webmgmt.interface.if_name -%}
-        net.{{ cfg.webmgmt.interface.if_name }},{{ cfg.webmgmt.interface.port }},
-    {%- endif -%}
-{%- endif -%}
-{ kind = 'webmgmt' })
-{%- endif %}
\ No newline at end of file
diff --git a/python/knot_resolver/datamodel/webmgmt_schema.py b/python/knot_resolver/datamodel/webmgmt_schema.py
deleted file mode 100644 (file)
index c39f84d..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-from typing import Optional
-
-from knot_resolver.datamodel.types import InterfacePort, ReadableFile, WritableFilePath
-from knot_resolver.utils.modeling import ConfigSchema
-
-
-class WebmgmtSchema(ConfigSchema):
-    """
-    Configuration of legacy web management endpoint.
-
-    ---
-    unix_socket: Path to unix domain socket to listen to.
-    interface: IP address or interface name with port number to listen to.
-    tls: Enable/disable TLS.
-    cert_file: Path to certificate file.
-    key_file: Path to certificate key.
-    """
-
-    unix_socket: Optional[WritableFilePath] = None
-    interface: Optional[InterfacePort] = None
-    tls: bool = False
-    cert_file: Optional[ReadableFile] = None
-    key_file: Optional[ReadableFile] = None
-
-    def _validate(self) -> None:
-        if bool(self.unix_socket) == bool(self.interface):
-            raise ValueError("One of 'interface' or 'unix-socket' must be configured.")
index 89752a0a4bd7dda45c82146b476bf08e867da84a..55fb125541683ced3cb2af05de8ca08714e64749 100644 (file)
@@ -132,7 +132,6 @@ class KresManager:  # pylint: disable=too-many-instance-attributes
                 config.hostname,
                 config.workers,
                 config.max_workers,
-                config.webmgmt,
                 config.options,
                 config.network,
                 config.forward,