]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
manager: datamodel: nsid moved to top-level
authorAleš Mrázek <ales.mrazek@nic.cz>
Thu, 5 May 2022 11:57:30 +0000 (13:57 +0200)
committerAleš Mrázek <ales.mrazek@nic.cz>
Thu, 5 May 2022 11:57:30 +0000 (13:57 +0200)
manager/knot_resolver_manager/datamodel/config_schema.py
manager/knot_resolver_manager/datamodel/options_schema.py
manager/knot_resolver_manager/datamodel/templates/config.lua.j2
manager/knot_resolver_manager/datamodel/templates/options.lua.j2

index 64e528698240193578bc8d0d6d24d78a82238666..d1953ae4e5a865618ba956373b0cc0f6c11c2800 100644 (file)
@@ -86,8 +86,9 @@ class KresConfig(SchemaNode):
 
         ---
         id: System-wide unique identifier of this instance. Used for grouping logs and tagging workers.
-        rundir: Directory where the resolver can create files and which will be it's cwd.
+        nsid: Name Server Identifier (RFC 5001) which allows DNS clients to request resolver to send back its NSID along with the reply to a DNS request.
         hostname: Internal DNS resolver hostname. Default is machine hostname.
+        rundir: Directory where the resolver can create files and which will be it's cwd.
         workers: The number of running kresd (Knot Resolver daemon) workers. If set to 'auto', it is equal to number of CPUs available.
         management: Configuration of management HTTP API.
         webmgmt: Configuration of legacy web management endpoint.
@@ -109,8 +110,9 @@ class KresConfig(SchemaNode):
         """
 
         id: IDPattern
-        rundir: UncheckedPath = UncheckedPath(".")
+        nsid: Optional[str] = None
         hostname: Optional[str] = None
+        rundir: UncheckedPath = UncheckedPath(".")
         workers: Union[Literal["auto"], IntPositive] = IntPositive(1)
         management: ManagementSchema = ManagementSchema({"unix-socket": "./manager.sock"})
         webmgmt: Optional[WebmgmtSchema] = None
@@ -133,8 +135,9 @@ class KresConfig(SchemaNode):
     _PREVIOUS_SCHEMA = Raw
 
     id: IDPattern
-    rundir: UncheckedPath
+    nsid: Optional[str]
     hostname: str
+    rundir: UncheckedPath
     workers: IntPositive
     management: ManagementSchema
     webmgmt: Optional[WebmgmtSchema]
index 8607a2e9f7c0a6c8d529d03f67c9aaec60cf0066..12b99ef28bce8d7e243880940dd31f4e3836deaa 100644 (file)
@@ -1,4 +1,4 @@
-from typing import Any, Optional, Union
+from typing import Any, Union
 
 from typing_extensions import Literal
 
@@ -27,7 +27,6 @@ class OptionsSchema(SchemaNode):
         Fine-tuning global parameters of DNS resolver operation.
 
         ---
-        nsid: Name Server Identifier (RFC 5001) which allows DNS clients to request resolver to send back its NSID along with the reply to a DNS request.
         glue_checking: Glue records scrictness checking level.
         qname_minimisation: Send minimum amount of information in recursive queries to enhance privacy.
         query_loopback: Permits queries to loopback addresses.
@@ -42,7 +41,6 @@ class OptionsSchema(SchemaNode):
         prediction: Helps keep the cache hot by prefetching expiring records and learning usage patterns and repetitive queries.
         """
 
-        nsid: Optional[str] = None
         glue_checking: GlueCheckingEnum = "normal"
         qname_minimisation: bool = True
         query_loopback: bool = False
@@ -58,7 +56,6 @@ class OptionsSchema(SchemaNode):
 
     _PREVIOUS_SCHEMA = Raw
 
-    nsid: Optional[str]
     glue_checking: GlueCheckingEnum
     qname_minimisation: bool
     query_loopback: bool
index 7394e854c8514cacfcd24c1def6064de15cf2f6b..1910f9bb1bdff64a33e48cf5e620212beb1b7b7f 100644 (file)
@@ -3,6 +3,12 @@
 -- hostname
 hostname('{{ cfg.hostname }}')
 
+{% if cfg.nsid %}
+-- nsid
+modules.load('nsid')
+nsid.name('{{ cfg.nsid }}_' .. worker.id)
+{% endif %}
+
 -- LOGGING section
 {% include "logging.lua.j2" %}
 
index 58c93ca7115d5b70c797751d3a9d567e978b9be1..4abe977bb0d74fc9f31f2706e55c06ed2557789e 100644 (file)
@@ -1,9 +1,3 @@
-{% if cfg.options.nsid %}
--- options.nsid
-modules.load('nsid')
-nsid.name('{{ cfg.options.nsid }}_' .. worker.id)
-{% endif %}
-
 -- options.glue-checking
 mode('{{ cfg.options.glue_checking }}')