]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
conf: simple files
authorAleš <ales.mrazek@nic.cz>
Fri, 26 Mar 2021 15:33:30 +0000 (16:33 +0100)
committerAleš Mrázek <ales.mrazek@nic.cz>
Fri, 8 Apr 2022 14:17:52 +0000 (16:17 +0200)
- configuration in YAM and JSON
- jinja2 template for kresd Lua config

manager/config/kres-manager.json [new file with mode: 0644]
manager/config/kres-manager.yaml [new file with mode: 0644]
manager/config/kresd-template.j2 [new file with mode: 0644]

diff --git a/manager/config/kres-manager.json b/manager/config/kres-manager.json
new file mode 100644 (file)
index 0000000..6446d3b
--- /dev/null
@@ -0,0 +1,25 @@
+{
+  "server": {
+    "instances": 4
+  },
+  "lua": {
+    "script": [
+      "-- SPDX-License-Identifier: CC0-1.0",
+      "-- vim:syntax=lua:set ts=4 sw=4:",
+      "-- Refer to manual: https://knot-resolver.readthedocs.org/en/stable/",
+      "-- Network interface configuration","net.listen('127.0.0.1', 53, { kind = 'dns' })",
+      "net.listen('127.0.0.1', 853, { kind = 'tls' })",
+      "--net.listen('127.0.0.1', 443, { kind = 'doh2' })",
+      "net.listen('::1', 53, { kind = 'dns', freebind = true })",
+      "net.listen('::1', 853, { kind = 'tls', freebind = true })",
+      "--net.listen('::1', 443, { kind = 'doh2' })",
+      "-- 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"
+    ]
+  }
+}
\ No newline at end of file
diff --git a/manager/config/kres-manager.yaml b/manager/config/kres-manager.yaml
new file mode 100644 (file)
index 0000000..2a7cb2c
--- /dev/null
@@ -0,0 +1,27 @@
+server:
+  instances: 4
+lua:
+  script: |
+    """
+    -- SPDX-License-Identifier: CC0-1.0
+    -- vim:syntax=lua:set ts=4 sw=4:
+    -- Refer to manual: https://knot-resolver.readthedocs.org/en/stable/
+
+    -- Network interface configuration
+    net.listen('127.0.0.1', 53, { kind = 'dns' })
+    net.listen('127.0.0.1', 853, { kind = 'tls' })
+    --net.listen('127.0.0.1', 443, { kind = 'doh2' })
+    net.listen('::1', 53, { kind = 'dns', freebind = true })
+    net.listen('::1', 853, { kind = 'tls', freebind = true })
+    --net.listen('::1', 443, { kind = 'doh2' })
+
+    -- 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
+    """
\ No newline at end of file
diff --git a/manager/config/kresd-template.j2 b/manager/config/kresd-template.j2
new file mode 100644 (file)
index 0000000..eba7159
--- /dev/null
@@ -0,0 +1,4 @@
+-- script from 'Lua' configuration section
+{% if cfg.lua.script -%}
+{{ cfg.lua.script }}
+{% endif -%}
\ No newline at end of file