]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
meson: etc/config - move and unify configs
authorTomas Krizek <tomas.krizek@nic.cz>
Wed, 6 Feb 2019 17:48:46 +0000 (18:48 +0100)
committerTomas Krizek <tomas.krizek@nic.cz>
Tue, 12 Mar 2019 09:43:23 +0000 (10:43 +0100)
daemon/README.rst
distro/common/kresd.conf [deleted file]
distro/common/kresd.no_ta.conf [deleted file]
etc/config.personal [deleted file]
etc/config/config.cluster.in [moved from etc/config.cluster with 71% similarity]
etc/config/config.docker.in [moved from etc/config.docker with 83% similarity]
etc/config/config.isp.in [moved from etc/config.isp with 75% similarity]
etc/config/config.personal.in [new file with mode: 0644]
etc/config/config.splitview.in [moved from etc/config.splitview with 72% similarity]
etc/config/meson.build [new file with mode: 0644]
etc/meson.build

index 765d2abdcedc046f2f2b6243c0845cab9bab2a53..3243b584117070a0f4fa55da57d74188364b8d11 100644 (file)
@@ -498,6 +498,9 @@ Trust anchors and DNSSEC
 Enabling DNSSEC
 ===============
 
+TODO - change section to disabling DNSSEC
+-- trust_anchors.keyfile_default = nil
+
 The resolver supports DNSSEC including :rfc:`5011` automated DNSSEC TA updates and :rfc:`7646` negative trust anchors.
 To enable it, you need to provide trusted root keys. Bootstrapping of the keys is automated, and kresd fetches root trust anchors set `over a secure channel <http://jpmens.net/2015/01/21/opendnssec-rfc-5011-bind-and-unbound/>`_ from IANA. From there, it can perform :rfc:`5011` automatic updates for you.
 
diff --git a/distro/common/kresd.conf b/distro/common/kresd.conf
deleted file mode 100644 (file)
index a82a893..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
--- vim:syntax=lua:
--- Refer to manual: http://knot-resolver.readthedocs.org/en/latest/daemon.html#configuration
-
--- Load useful modules
-modules = {
-       'hints > iterate',  -- Load /etc/hosts and allow custom root hints
-       'stats',            -- Track internal statistics
-       'predict',          -- Prefetch expiring/frequent records
-}
-
--- See kresd.systemd(7) about configuring network interfaces when using systemd
--- Listen on localhost (default)
--- net = { '127.0.0.1', '::1' }
-
--- Enable DNSSEC validation
-trust_anchors.file = '/etc/knot-resolver/root.keys'
-
--- Cache size
-cache.size = 100 * MB
diff --git a/distro/common/kresd.no_ta.conf b/distro/common/kresd.no_ta.conf
deleted file mode 100644 (file)
index e452f0e..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
--- vim:syntax=lua:
--- Refer to manual: http://knot-resolver.readthedocs.org/en/latest/daemon.html#configuration
-
--- Load useful modules
-modules = {
-       'hints > iterate',    -- Load /etc/hosts and allow custom root hints
-       'stats',              -- Track internal statistics
-       'predict',            -- Prefetch expiring/frequent records
-}
-
--- See kresd.systemd(7) about configuring network interfaces when using systemd
--- Listen on localhost (default)
--- net = { '127.0.0.1', '::1' }
-
--- To disable DNSSEC validation, uncomment the following line (not recommended)
--- trust_anchors.keyfile_default = nil
-
--- Cache size
-cache.size = 100 * MB
diff --git a/etc/config.personal b/etc/config.personal
deleted file mode 100644 (file)
index 74bdd0e..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
--- Config file example useable for personal resolver.
--- The goal is to have a validating resolver with tiny memory footprint,
--- while actively tracking and refreshing frequent records to lower user latency.
--- Refer to manual: https://knot-resolver.readthedocs.io/en/latest/daemon.html#configuration
-
--- Listen on localhost (default)
--- net = { '127.0.0.1', '::1' }
-
--- Drop root privileges
-user('knot-resolver', 'knot-resolver')
-
--- Auto-maintain root TA
-trust_anchors.file = 'root.keys'
-
--- Load Useful modules
-modules = {
-       'hints > iterate', -- Load /etc/hosts and allow custom root hints
-       'stats',    -- Track internal statistics
-       'predict',  -- Prefetch expiring/frequent records
-}
-
--- Smaller cache size
-cache.size = 10 * MB
similarity index 71%
rename from etc/config.cluster
rename to etc/config/config.cluster.in
index 86475873645a05ff4739c07f9cb1987700e56d66..467285bf9c28a653e08333e1b6b423f5f56eb95c 100644 (file)
@@ -1,18 +1,11 @@
+-- vim:syntax=lua:set ts=4 sw=4:
 -- Config file example useable for larger resolver farms
 -- In this case cache should be made as large as possible, and prefetching turned off
 -- as the resolver is busy most of the time.
 -- Alternative is using `etcd` as a configuration backend.
--- Refer to manual: https://knot-resolver.readthedocs.io/en/latest/daemon.html#configuration
-
--- Listen on localhost and external interface
-net = { '127.0.0.1', '::1', '192.168.1.1' }
-
--- Drop root privileges
-user('knot-resolver', 'knot-resolver')
-
--- Auto-maintain root TA
-trust_anchors.file = 'root.keys'
-
+-- Refer to manual: https://knot-resolver.readthedocs.io/en/stable/daemon.html#configuration
+@config_defaults@
+@config_managed_ta@
 -- Large cache size, so we don't need to flush ever
 -- This can be larger than available RAM, least frequently accessed
 -- records will be paged out as long as there's enough disk space to back it
@@ -32,9 +25,8 @@ modules = {
 
 -- Use local root server copy for performance reasons
 hints.root({
-  ['j.root-servers.net.'] = { '192.168.1.4', '2001:503:c27::2:30', '192.58.128.30' }
+       ['j.root-servers.net.'] = { '192.168.1.4', '2001:503:c27::2:30', '192.58.128.30' }
 })
 
 -- Apply RPZ for all clients, default rule is DENY
 policy.add(policy.rpz(policy.DENY, 'blacklist.rpz'))
-
similarity index 83%
rename from etc/config.docker
rename to etc/config/config.docker.in
index d239dba80480611cab8269e24858e8dc9b44b261..a7aa6edfe205f97fd92a0d0dfcbc2acf4fe369df 100644 (file)
@@ -1,11 +1,10 @@
--- Refer to manual: https://knot-resolver.readthedocs.io/en/latest/daemon.html#configuration
+-- vim:syntax=lua:set ts=4 sw=4:
+-- Refer to manual: https://knot-resolver.readthedocs.io/en/stable/daemon.html#configuration
 
 -- Listen on all interfaces (localhost would not work in Docker)
 net.listen('0.0.0.0')
 net.listen('0.0.0.0', 853, {tls=true})
-
--- Auto-maintain root TA
-trust_anchors.file = '/etc/knot-resolver/root.keys'
+@config_managed_ta@
 
 -- Load Useful modules
 modules = {
similarity index 75%
rename from etc/config.isp
rename to etc/config/config.isp.in
index 27dc76e3eea52af66f1d8def109a7758b08de8c6..8ed834e87d86c011e9baa425887b1fcb326a753a 100644 (file)
@@ -1,15 +1,8 @@
+-- vim:syntax=lua:set ts=4 sw=4:
 -- Config file example useable for multi-user ISP resolver
--- Refer to manual: https://knot-resolver.readthedocs.io/en/latest/daemon.html#configuration
-
--- Listen on localhost and external interface
-net = { '127.0.0.1', '::1', '192.168.1.1' }
-
--- Drop root privileges
-user('knot-resolver', 'knot-resolver')
-
--- Auto-maintain root TA
-trust_anchors.file = 'root.keys'
-
+-- Refer to manual: https://knot-resolver.readthedocs.io/en/stable/daemon.html#configuration
+@config_defaults@
+@config_managed_ta@
 -- Large cache size, so we don't need to flush often
 -- This can be larger than available RAM, least frequently accessed
 -- records will be paged out
diff --git a/etc/config/config.personal.in b/etc/config/config.personal.in
new file mode 100644 (file)
index 0000000..31e7724
--- /dev/null
@@ -0,0 +1,13 @@
+-- vim:syntax=lua:set ts=4 sw=4:
+-- Refer to manual: http://knot-resolver.readthedocs.org/en/stable/daemon.html#configuration
+@config_defaults@
+@config_managed_ta@
+-- Load useful modules
+modules = {
+       'hints > iterate',  -- Load /etc/hosts and allow custom root hints
+       'stats',            -- Track internal statistics
+       'predict',          -- Prefetch expiring/frequent records
+}
+
+-- Cache size
+cache.size = 100 * MB
similarity index 72%
rename from etc/config.splitview
rename to etc/config/config.splitview.in
index fbd0140216a72b4aac5879f1ff23ea9890214ba2..797002ac09d25dcd7c6d758bf8823fbbce98cb2d 100644 (file)
@@ -1,15 +1,8 @@
+-- vim:syntax=lua:set ts=4 sw=4:
 -- Config file with split-view for internal zone
--- Refer to manual: https://knot-resolver.readthedocs.io/en/latest/daemon.html#configuration
-
--- Listen on localhost and external interface
-net = { '127.0.0.1', '::1', '192.168.1.1' }
-
--- Drop root privileges
-user('knot-resolver', 'knot-resolver')
-
--- Auto-maintain root TA
-trust_anchors.file = 'root.keys'
-
+-- Refer to manual: https://knot-resolver.readthedocs.io/en/stable/daemon.html#configuration
+@config_defaults@
+@config_managed_ta@
 -- Load Useful modules
 modules = {
        'hints > iterate', -- Load /etc/hosts and allow custom root hints
diff --git a/etc/config/meson.build b/etc/config/meson.build
new file mode 100644 (file)
index 0000000..aade9b1
--- /dev/null
@@ -0,0 +1,40 @@
+# etc: config examples
+
+# Config snippets (build-dependant)
+if true  # TODO systemd.nosocket, systemd=no
+  config_defaults = '''
+-- Network interface configuration: see kresd.systemd(7)'''
+else
+  config_defaults = '''
+-- Listen on localhost (default) and external interface
+-- net = { '127.0.0.1', '::1', '192.0.2.1' }
+
+-- Drop root privileges
+user('knot-resolver', 'knot-resolver')'''  # TODO user, group
+endif
+
+if true  # TODO managed_ta = false
+  config_managed_ta = '''
+-- Auto-manage DNSSEC trust anchors (RFC 5011)
+trust_anchors.file = '@0@/root.keys'
+'''.format(etc_dir)
+else
+  config_managed_ta = ''
+endif
+
+
+example_configs = [
+  'config.cluster.in',
+  'config.docker.in',
+  'config.isp.in',
+  'config.personal.in',
+  'config.splitview.in',
+]
+
+# TODO kresd.conf
+
+# TODO configure, install
+#install_data(
+#  sources: example_configs,
+#  install_dir: join_paths(doc_dir, 'examples'),
+#)
index 241e8bbdd1a6c0dcb12ab3a1563c5e88397a177d..d921b874f951bc376d568c7d902e47c2b746f56b 100644 (file)
@@ -1,23 +1,13 @@
 # etc
 
-example_configs = [
-  'config.cluster',
-  'config.docker',
-  'config.isp',
-  'config.personal',
-  'config.splitview',
-]
-
 etc_files = [
   'icann-ca.pem',
   'root.hints',
 ]
 
 
-install_data(
-  sources: example_configs,
-  install_dir: join_paths(doc_dir, 'examples'),
-)
+subdir('config')
+
 
 install_data(
   sources: etc_files,