]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
manager: datamodel: use 'boolean' macro in datamodel
authorAleš Mrázek <ales.mrazek@nic.cz>
Wed, 3 May 2023 10:30:45 +0000 (12:30 +0200)
committerAleš Mrázek <ales.mrazek@nic.cz>
Fri, 9 Jun 2023 11:54:07 +0000 (11:54 +0000)
manager/knot_resolver_manager/datamodel/templates/dnssec.lua.j2
manager/knot_resolver_manager/datamodel/templates/logging.lua.j2
manager/knot_resolver_manager/datamodel/templates/network.lua.j2
manager/knot_resolver_manager/datamodel/templates/options.lua.j2
manager/knot_resolver_manager/datamodel/templates/webmgmt.lua.j2

index b26961bbec010547b7e2893d715803746f7b5d5a..31a29beac75b162ac36a69a40ffd0c8fa0003bc8 100644 (file)
@@ -1,3 +1,5 @@
+{% from 'macros/common_macros.lua.j2' import boolean %}
+
 {% if not cfg.dnssec %}
 -- disable dnssec
 trust_anchors.remove('.')
@@ -51,6 +53,6 @@ trust_anchors.set_insecure({
 {% if cfg.dnssec.trust_anchors_files %}
 -- dnssec.trust-anchors-files
 {% for taf in cfg.dnssec.trust_anchors_files %}
-trust_anchors.add_file('{{ taf.file }}',  readonly = {{ 'true' if taf.read_only else 'false' }})
+trust_anchors.add_file('{{ taf.file }}',  readonly = {{ boolean(taf.read_only) }})
 {% endfor %}
 {% endif %}
\ No newline at end of file
index d7fb845d5f66791a8cb6da903fb0d2c46bd6033d..2fb398e97e5058d3b12f6ce46a375fe6da6cf4a0 100644 (file)
@@ -1,3 +1,5 @@
+{% from 'macros/common_macros.lua.j2' import boolean %}
+
 -- logging.level
 log_level('{{ cfg.logging.level }}')
 
@@ -27,15 +29,15 @@ modules.load('dnstap')
 dnstap.config({
     socket_path = '{{ cfg.logging.dnstap.unix_socket }}',
     client = {
-        log_queries = {{ 'true' if cfg.logging.dnstap.log_queries else 'false' }},
-        log_responses = {{ 'true' if cfg.logging.dnstap.log_responses else 'false' }},
-        log_tcp_rtt = {{ 'true' if cfg.logging.dnstap.log_tcp_rtt else 'false' }}
+        log_queries = {{ boolean(cfg.logging.dnstap.log_queries) }},
+        log_responses = {{ boolean(cfg.logging.dnstap.log_responses) }},
+        log_tcp_rtt = {{ boolean(cfg.logging.dnstap.log_tcp_rtt) }}
     }
 })
 {%- endif %}
 
 -- logging.debugging.assertion-abort
-debugging.assertion_abort = {{ 'true' if cfg.logging.debugging.assertion_abort else 'false' }}
+debugging.assertion_abort = {{ boolean(cfg.logging.debugging.assertion_abort) }}
 
 -- logging.debugging.assertion-fork
 debugging.assertion_fork = {{ cfg.logging.debugging.assertion_fork.millis() }}
index 60b09652c26aaf3ccefacc9a81e5015cc1ef26a9..665ee45430e7a875eebf6dedadc7711a50b1eed3 100644 (file)
@@ -1,8 +1,9 @@
+{% from 'macros/common_macros.lua.j2' import boolean %}
 {% from 'macros/network_macros.lua.j2' import network_listen, http_config %}
 
 -- network.do-ipv4/6
-net.ipv4 = {{ 'true' if cfg.network.do_ipv4 else 'false' }}
-net.ipv6 = {{ 'true' if cfg.network.do_ipv6 else 'false' }}
+net.ipv4 = {{ boolean(cfg.network.do_ipv4) }}
+net.ipv6 = {{ boolean(cfg.network.do_ipv6) }}
 
 {% if cfg.network.out_interface_v4 %}
 -- network.out-interface-v4
index 513f1e2667c271252182016178281214feb9929a..8210fb6d88a8f8c30a412ff2c37e4a8fe2c87a8b 100644 (file)
@@ -1,3 +1,5 @@
+{% from 'macros/common_macros.lua.j2' import boolean %}
+
 -- options.glue-checking
 mode('{{ cfg.options.glue_checking }}')
 
@@ -38,13 +40,13 @@ modules.unload('refuse_nord')
 {% endif %}
 
 -- options.qname-minimisation
-option('NO_MINIMIZE', {{ 'false' if cfg.options.minimize else 'true' }})
+option('NO_MINIMIZE', {{ boolean(cfg.options.minimize,true) }})
 
 -- options.query-loopback
-option('ALLOW_LOCAL', {{ 'true' if cfg.options.query_loopback else 'false' }})
+option('ALLOW_LOCAL', {{ boolean(cfg.options.query_loopback) }})
 
 -- options.reorder-rrset
-option('REORDER_RR', {{ 'true' if cfg.options.reorder_rrset else 'false' }})
+option('REORDER_RR', {{ boolean(cfg.options.reorder_rrset) }})
 
 -- options.query-case-randomization
-option('NO_0X20', {{ 'false' if cfg.options.query_case_randomization else 'true' }})
\ No newline at end of file
+option('NO_0X20', {{ boolean(cfg.options.query_case_randomization,true) }})
\ No newline at end of file
index 1dd0098ccc0f68035a5e2578cec2aac26fc7b780..938ea8da5f467a860fccafcda6483e8db466727b 100644 (file)
@@ -1,7 +1,9 @@
+{% from 'macros/common_macros.lua.j2' import boolean %}
+
 {% if cfg.webmgmt -%}
 -- webmgmt
 modules.load('http')
-http.config({tls = {{ 'true' if cfg.webmgmt.tls else 'false'}},
+http.config({tls = {{ boolean(cfg.webmgmt.tls) }},
 {%- if cfg.webmgmt.cert_file -%}
     cert = '{{ cfg.webmgmt.cert_file }}',
 {%- endif -%}