+{% from 'macros/common_macros.lua.j2' import boolean %}
+
{% if not cfg.dnssec %}
-- disable dnssec
trust_anchors.remove('.')
{% 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
+{% from 'macros/common_macros.lua.j2' import boolean %}
+
-- logging.level
log_level('{{ cfg.logging.level }}')
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() }}
+{% 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
+{% from 'macros/common_macros.lua.j2' import boolean %}
+
-- options.glue-checking
mode('{{ cfg.options.glue_checking }}')
{% 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
+{% 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 -%}