]> 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>
Tue, 5 Aug 2025 09:10:29 +0000 (11:10 +0200)
NEWS
doc/_static/config.schema.json
python/knot_resolver/datamodel/config_schema.py
python/knot_resolver/datamodel/templates/webmgmt.lua.j2 [deleted file]
python/knot_resolver/datamodel/templates/worker-config.lua.j2
python/knot_resolver/datamodel/webmgmt_schema.py [deleted file]
python/knot_resolver/manager/manager.py

diff --git a/NEWS b/NEWS
index e76b20765dd1eabee7a80ef6c0701c64091cfbee..960c4cee66cba7ff4eb875591c8935bd1dc5a24d 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -10,6 +10,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.15 (2025-07-17)
index 4fc731f77c233029acdbc28b9a97d6c73bd73104..24c3c10f48d24cad2c1a287429fc544d17fb60b6 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 2cc2680c9203cc15d6dad21f0633f0a1ac7ecdf8..dc51abfa762a9a939c947a0e75e30e8a69e49c17 100644 (file)
@@ -21,7 +21,6 @@ from knot_resolver.datamodel.rate_limiting_schema import RateLimitingSchema
 from knot_resolver.datamodel.templates import POLICY_CONFIG_TEMPLATE, WORKER_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.
@@ -119,7 +117,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
@@ -142,7 +139,6 @@ class KresConfig(ConfigSchema):
     workers: IntPositive
     max_workers: IntPositive
     management: ManagementSchema
-    webmgmt: Optional[WebmgmtSchema]
     options: OptionsSchema
     network: NetworkSchema
     views: Optional[List[ViewSchema]]
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
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/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 dcd14b537859d1a62007876328c6ad227955cb67..70e8a8e08b2f73c4d139806b5e1d712961e813eb 100644 (file)
@@ -130,7 +130,6 @@ class KresManager:  # pylint: disable=too-many-instance-attributes
                 config.hostname,
                 config.workers,
                 config.max_workers,
-                config.webmgmt,
                 config.options,
                 config.network,
                 config.forward,