diff options
author | micah <micah@riseup.net> | 2022-12-02 17:55:23 +0000 |
---|---|---|
committer | micah <micah@riseup.net> | 2022-12-02 17:55:23 +0000 |
commit | 3f047674f5c07587393a5da81cd7213cceffdc57 (patch) | |
tree | a7ecfa2e68be3b7b53e4fec6c30fc0822a47ee9d | |
parent | d25723bc19fb295001c43945e9ec3726042e206f (diff) | |
parent | 0e1c371b136ca587cef76aee46de17e468f73705 (diff) |
Merge branch 'kresd_template_updates' into 'main'
kresd: Update config template for control path, cache, keys and prom
See merge request leap/container-platform/lilypad!63
-rw-r--r-- | config/roles/kresd/templates/kresd.conf.j2 | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/config/roles/kresd/templates/kresd.conf.j2 b/config/roles/kresd/templates/kresd.conf.j2 index 99e41b8..3b04e88 100644 --- a/config/roles/kresd/templates/kresd.conf.j2 +++ b/config/roles/kresd/templates/kresd.conf.j2 @@ -1,3 +1,21 @@ +local ffi = require('ffi') +local id = os.getenv('SYSTEMD_INSTANCE') +if not id then + log_warn(ffi.C.LOG_GRP_SYSTEM, 'environment variable $SYSTEMD_INSTANCE not set') +else + -- Bind to control socket in run_dir + worker.control_path = '/run/control/' + local path = worker.control_path..id + local ok, err = pcall(net.listen, path, nil, { kind = 'control' }) + if not ok then + log_warn(ffi.C.LOG_GRP_NETWORK, 'bind to '..path..' failed '..err) + end +end + +-- Set cache location +rawset(cache, 'current_storage', 'lmdb:///var/cache/knot-resolver') + + net.listen('10.41.0.1', 53, { kind = 'dns' }) net.listen('10.42.0.1', 53, { kind = 'dns' }) {% if openvpn_udp_network6 is defined and openvpn_udp_network6|length %} @@ -13,4 +31,5 @@ modules = { cache.size = 400 * MB +trust_anchors.add_file('/etc/knot-resolver/root.keys', false) http.config({ geoip = '/var/lib/GeoIP/GeoLite2-Country.mmdb', }) |