]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
meson: add option keyfile_default
authorTomas Krizek <tomas.krizek@nic.cz>
Fri, 25 Jan 2019 13:16:48 +0000 (14:16 +0100)
committerTomas Krizek <tomas.krizek@nic.cz>
Tue, 12 Mar 2019 09:41:49 +0000 (10:41 +0100)
daemon/README.rst
daemon/cache.test/clear.test.lua
daemon/lua/meson.build
daemon/lua/trust_anchors.lua.in
daemon/lua/trust_anchors.test/bootstrap.test.lua
doc/build.rst
doc/kresd.8.in
meson.build
meson_options.txt
tests/config/keyfile/nonexist_keyfile1.test.lua
tests/config/keyfile/nonexist_keyfile2.test.lua

index 12f3ea424301d8e18d060f9f5748cf03e1af75ef..765d2abdcedc046f2f2b6243c0845cab9bab2a53 100644 (file)
@@ -421,9 +421,9 @@ Trust anchors and DNSSEC
 
       [ ta ] key: 19036 state: Valid
 
-.. envvar:: trust_anchors.keyfile_default = KEYFILE_DEFAULT
+.. envvar:: trust_anchors.keyfile_default = keyfile_default
 
-   Set by ``KEYFILE_DEFAULT`` during compilation (by default ``nil``). This can be explicitly
+   Set by ``keyfile_default`` option during compilation (by default ``nil``). This can be explicitly
    set to ``nil`` to override the value set during compilation in order to disable DNSSEC.
 
 .. envvar:: trust_anchors.hold_down_time = 30 * day
index 473103bab5446083b92d47786e59987615f7d378..e7e96fd81c8ae37cdc4bd828bd701799efae9647 100644 (file)
@@ -31,7 +31,7 @@ event.cancel(ev)
 ev = event.after(0, function () return 1 end)
 
 
--- Import fake root zone; avoid interference with configured KEYFILE_DEFAULT.
+-- Import fake root zone; avoid interference with configured keyfile_default.
 trust_anchors.keyfile_default = nil
 trust_anchors.add('. IN DS 48409 8 2 3D63A0C25BCE86621DE63636F11B35B908EFE8E9381E0E3E9DEFD89EA952C27D')
 
index 07259d741e7e3db21fbb8f05fc80a8470697c2fb..d891440e0a00ee36b1c5dd43c34a568d152517ee 100644 (file)
@@ -1,11 +1,19 @@
 lua_modules_daemon = [
   'kres',
   'kres-gen',
-  #'trust_anchors',  # TODO
+  'trust_anchors',
   'zonefile',
 ]
 
 
+# trust_anchors.lua
+configure_file(
+  input: 'trust_anchors.lua.in',
+  output: 'trust_anchors.lua',
+  configuration: config
+)
+
+
 # install lua modules
 foreach mod : lua_modules_daemon
   install_data(
index fdeb143632dd43b3e4126829859d503b8be69c49..6fe8d477534da92bdc8338a5494c93b42b5539ae 100644 (file)
@@ -624,7 +624,7 @@ trust_anchors = {
        bootstrap_url = 'https://data.iana.org/root-anchors/root-anchors.xml',
        bootstrap_ca = '@ETCDIR@/icann-ca.pem',
        -- change empty string to nil
-       keyfile_default = ('@KEYFILE_DEFAULT@' ~= '' and '@KEYFILE_DEFAULT@') or nil,
+       keyfile_default = ('@keyfile_default@' ~= '' and '@keyfile_default@') or nil,
 
        -- Load keys from a file, 5011-managed by default.
        -- If managed and the file doesn't exist, try bootstrapping the root into it.
index 0fad935a18b0470ccce0e0632b0c600e0383e3f9..12b6cc30457b339a88d1d93eceb032f962fb6a7c 100644 (file)
@@ -59,7 +59,7 @@ local function wait_for_webserver()
 end
 
 local host = 'https://localhost:8080/'
--- avoid interference with configured KEYFILE_DEFAULT
+-- avoid interference with configured keyfile_default
 trust_anchors.keyfile_default = nil
 
 local function test_err_cert()
index 4cf427457f663f957285372c248f942df56cfb18..c7e6e02944c4580881f79849148a5db33493d535 100644 (file)
@@ -195,12 +195,12 @@ All paths are prefixed with ``PREFIX`` variable by default if not specified othe
    "daemon",  "``SBINDIR``", "``$(PREFIX)/sbin``", ""
    "configuration", "``ETCDIR``", "``$(PREFIX)/etc/knot-resolver``", "Configuration file, templates."
    "modules", "``MODULEDIR``", "``$(LIBDIR)/kdns_modules``", "Runtime directory for loading dynamic modules [#]_."
-   "trust anchor file", "``KEYFILE_DEFAULT``", "*(none)*", "Path to read-only trust anchor file, which is used as fallback when no other file is specified. [#]_"
+   "trust anchor file", "``keyfile_default``", "*(none)*", "Path to read-only trust anchor file, which is used as fallback when no other file is specified. [#]_"
    "work directory", "", "the current directory", "Run directory for daemon. (Only relevant during run time, not e.g. during installation.)"
 
 .. [#] The ``libkres.pc`` is installed in ``$(LIBDIR)/pkgconfig``.
 .. [#] The default moduledir can be changed with `-m` option to `kresd` daemon or by calling `moduledir()` function from lua.
-.. [#] If no other trust anchor is specified by user, the compiled-in path ``KEYFILE_DEFAULT`` must contain a valid trust anchor. This is typically used by distributions which provide DNSSEC root trust anchors as part of distribution package. Users can disable the built-in trust anchor by adding ``trust_anchors.keyfile_default = nil`` to their configuration.
+.. [#] If no other trust anchor is specified by user, the compiled-in path ``keyfile_default`` must contain a valid trust anchor. This is typically used by distributions which provide DNSSEC root trust anchors as part of distribution package. Users can disable the built-in trust anchor by adding ``trust_anchors.keyfile_default = nil`` to their configuration.
 
 .. note:: Each module is self-contained and may install additional bundled files within ``$(MODULEDIR)/$(modulename)``. These files should be read-only, non-executable.
 
index 0fa8cc95d893c6b78b8f4964b2bd55b0bb722339..a9921f2ea18f5fce9d3926c0678e42175f1c0ccf 100644 (file)
@@ -136,7 +136,7 @@ and is compatible with Unbound and BIND 9 root key files.
 .B \-K\fI keyfile\fR, \fB\-\-keyfile\-ro=\fI<keyfile>
 (Discouraged) Static root trust anchors file. The file is not updated by kresd. Use of this option is discouraged because it will break your installation when the trust anchor key changes!
 
-Default: "@KEYFILE_DEFAULT@" (can be empty if your distribution did not provide one)
+Default: "@keyfile_default@" (can be empty if your distribution did not provide one)
 .TP
 .B \-m\fI path\fR, \fB\-\-moduledir=\fI<path>
 Override the directory that is searched for modules.  Default: @MODULEDIR@
index 6fb958e7a14e3fddfb0a91c4c98dc58eba139e37..734d7c9740ff7d5f37fabdfde6b13141f619d326 100644 (file)
@@ -17,6 +17,8 @@ message('modules_dir: ' + modules_dir)
 
 etc_dir = join_paths(get_option('prefix'), get_option('sysconfdir'), 'knot-resolver')
 
+config = configuration_data()
+config.set('keyfile_default', get_option('keyfile_default'))
 
 # Project-wide dependencies
 
index 2580a5d74e13801b629f71f2776268926333b8a2..037062bac47cc35f8bbc23e617062d287d072b18 100644 (file)
@@ -2,3 +2,4 @@ option('cookies', type: 'boolean', value: false, description: 'Support for DNS C
 option('client', type : 'boolean', value : true, description: 'kresc client binary')
 option('daemon', type: 'boolean', value: true, description: 'kresd daemon binary')
 option('modules_dir', type: 'string', description: 'path to kres modules directory')
+option('keyfile_default', type: 'string', description: 'path to trust anchors file')
index be73f32f460cee0f936a445729cb5bdc3162b914..332919dabbf5dacf692fdc62613505de487d01d5 100644 (file)
@@ -1,2 +1,2 @@
--- simulate building without KEYFILE_DEFAULT
+-- simulate building without keyfile_default
 trust_anchors.keyfile_default = nil
index bb2f98bf14b29837728075987332c8f7647c2b50..6d4fa8fce7699fcb7faa9dfb2640d290064040e8 100644 (file)
@@ -1,2 +1,2 @@
--- simulate building with KEYFILE_DEFAULT
+-- simulate building with keyfile_default
 trust_anchors.keyfile_default = "root1.keys"