From: Tomas Krizek Date: Fri, 12 Jan 2018 09:29:53 +0000 (+0100) Subject: use common convention for configuration path and user name X-Git-Tag: v2.0.0~15^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=564c46735a1377db6ab1ca5ba020c3b5dce03fe6;p=thirdparty%2Fknot-resolver.git use common convention for configuration path and user name --- diff --git a/ci/respdiff/kresd.config b/ci/respdiff/kresd.config index e7827b00c..98d62f17f 100644 --- a/ci/respdiff/kresd.config +++ b/ci/respdiff/kresd.config @@ -6,7 +6,7 @@ net.listen('127.0.0.1', 8853, { tls = true }) net.listen('::1', 8853, { tls = true }) -- Auto-maintain root TA -trust_anchors.file = '.local/etc/kresd/root.keys' +trust_anchors.file = '.local/etc/knot-resolver/root.keys' -- Large cache size, so we don't need to flush often -- This can be larger than available RAM, least frequently accessed diff --git a/client/kresc.c b/client/kresc.c index 5f38d4f83..42dba3454 100644 --- a/client/kresc.c +++ b/client/kresc.c @@ -90,7 +90,7 @@ const char *get_type_name(const char *value) static void complete_function(EditLine * el) { - //Add left parenthesis to function name. + //Add left parenthesis to function name. el_insertstr(el, "("); } @@ -392,7 +392,7 @@ static int interact() //Create necessary folders. char *dirs[3] = { afmt("%s/.local", home), afmt("%s/.local/share", home), - afmt("%s/.local/share/kresd/", home) + afmt("%s/.local/share/knot-resolver/", home) }; bool ok = true; for (int i = 0; i < 3; i++) { @@ -403,12 +403,12 @@ static int interact() } if (ok) { hist_file = - afmt("%s/.local/share/kresd/" HISTORY_FILE, home); + afmt("%s/.local/share/knot-resolver/" HISTORY_FILE, home); } } else { - if (!mkdir(afmt("%s/kresd/", data_home), 0755) + if (!mkdir(afmt("%s/knot-resolver/", data_home), 0755) || errno == EEXIST) { - hist_file = afmt("%s/kresd/" HISTORY_FILE, data_home); + hist_file = afmt("%s/knot-resolver/" HISTORY_FILE, data_home); } } diff --git a/config.mk b/config.mk index f45db58ef..8cb4b3ad4 100644 --- a/config.mk +++ b/config.mk @@ -18,7 +18,7 @@ PKGCONFIGDIR ?= $(LIBDIR)/pkgconfig MANDIR ?= $(PREFIX)/share/man INCLUDEDIR ?= $(PREFIX)/include MODULEDIR ?= $(LIBDIR)/kdns_modules -ETCDIR ?= $(PREFIX)/etc/kresd +ETCDIR ?= $(PREFIX)/etc/knot-resolver ROOTHINTS ?= $(ETCDIR)/root.hints COVERAGE_STAGE ?= gcov COVERAGE_STATSDIR ?= $(CURDIR)/coverage.stats diff --git a/daemon/README.rst b/daemon/README.rst index 1b6108f89..5a7aa75f4 100644 --- a/daemon/README.rst +++ b/daemon/README.rst @@ -434,7 +434,7 @@ Environment > user('baduser') invalid user name - > user('kresd', 'netgrp') + > user('knot-resolver', 'netgrp') true > user('root') Operation not permitted @@ -605,9 +605,9 @@ For when listening on ``localhost`` just doesn't cut it. .. code-block:: lua - > net.tls("/etc/kresd/server-cert.pem", "/etc/kresd/server-key.pem") + > net.tls("/etc/knot-resolver/server-cert.pem", "/etc/knot-resolver/server-key.pem") > net.tls() - ("/etc/kresd/server-cert.pem", "/etc/kresd/server-key.pem") + ("/etc/knot-resolver/server-cert.pem", "/etc/knot-resolver/server-key.pem") > net.listen("::", 853) > net.listen("::", 443, {tls = true}) diff --git a/daemon/lua/kres-gen.sh b/daemon/lua/kres-gen.sh index 3599e9b3a..ff673a517 100755 --- a/daemon/lua/kres-gen.sh +++ b/daemon/lua/kres-gen.sh @@ -6,7 +6,7 @@ # (Avoid typos, accidental mismatches, etc.) # # To regenerate the C definitions for lua: -# - you need to have debugging symbols for knot-dns and kresd; +# - you need to have debugging symbols for knot-dns and knot-resolver; # you get those by compiling with -g; for knot-dns it might be enough # to just install it with debugging symbols included (in your distro way) # - remove file ./kres-gen.lua and run make as usual diff --git a/doc/build.rst b/doc/build.rst index 6ac99ba75..6da43b3a3 100644 --- a/doc/build.rst +++ b/doc/build.rst @@ -108,7 +108,7 @@ Most of the dependencies can be resolved from packages, here's an overview for s brew install pkg-config libuv luajit cmocka -Building from sources +Building from sources --------------------- Initialize git submodules first. @@ -195,7 +195,7 @@ All paths are prefixed with ``PREFIX`` variable by default if not specified othe "library", "``LIBDIR``", "``$(PREFIX)/lib``", "pkg-config is auto-generated [#]_" "daemon", "``SBINDIR``", "``$(PREFIX)/sbin``", "" - "configuration", "``ETCDIR``", "``$(PREFIX)/etc/kresd``", "Configuration file, templates." + "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. [#]_" "work directory", "", "the current directory", "Run directory for daemon. (Only relevant during run time, not e.g. during installation.)" @@ -216,7 +216,7 @@ By default the resolver library is built as a dynamic library with versioned ABI $ make BUILDMODE=dynamic # Default, create dynamic library $ make BUILDMODE=static # Create static library -When the library is linked statically, it usually produces a smaller binary. However linking it to various C modules might violate ODR and increase the size. +When the library is linked statically, it usually produces a smaller binary. However linking it to various C modules might violate ODR and increase the size. Resolving dependencies ~~~~~~~~~~~~~~~~~~~~~~ diff --git a/etc/config.cluster b/etc/config.cluster index f434be8f5..bc1cf60a5 100644 --- a/etc/config.cluster +++ b/etc/config.cluster @@ -8,7 +8,7 @@ net = { '127.0.0.1', '::1', '192.168.1.1' } -- Drop root privileges -user('kresd', 'kresd') +user('knot-resolver', 'knot-resolver') -- Auto-maintain root TA trust_anchors.file = 'root.keys' @@ -16,7 +16,7 @@ trust_anchors.file = 'root.keys' -- 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 -cache.size = 100 * GB +cache.size = 100 * GB -- Load Useful modules modules = { diff --git a/etc/config.isp b/etc/config.isp index 344de7e15..f050bd883 100644 --- a/etc/config.isp +++ b/etc/config.isp @@ -5,7 +5,7 @@ net = { '127.0.0.1', '::1', '192.168.1.1' } -- Drop root privileges -user('kresd', 'kresd') +user('knot-resolver', 'knot-resolver') -- Auto-maintain root TA trust_anchors.file = 'root.keys' @@ -13,7 +13,7 @@ trust_anchors.file = 'root.keys' -- 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 -cache.size = 4 * GB +cache.size = 4 * GB -- Load Useful modules modules = { diff --git a/etc/config.personal b/etc/config.personal index a46af4d84..490798e22 100644 --- a/etc/config.personal +++ b/etc/config.personal @@ -7,7 +7,7 @@ -- net = { '127.0.0.1', '::1' } -- Drop root privileges -user('kresd', 'kresd') +user('knot-resolver', 'knot-resolver') -- Auto-maintain root TA trust_anchors.file = 'root.keys' diff --git a/etc/config.splitview b/etc/config.splitview index 2d5f66d6e..1706a498a 100644 --- a/etc/config.splitview +++ b/etc/config.splitview @@ -5,7 +5,7 @@ net = { '127.0.0.1', '::1', '192.168.1.1' } -- Drop root privileges -user('kresd', 'kresd') +user('knot-resolver', 'knot-resolver') -- Auto-maintain root TA trust_anchors.file = 'root.keys' @@ -28,7 +28,7 @@ modules = { -- 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 -cache.size = 4 * GB +cache.size = 4 * GB -- Forward everything below `company.cz` to `192.168.1.3` policy.add(policy.suffix(policy.FORWARD('192.168.1.3'), {todname('company.cz')})) diff --git a/modules/etcd/README.rst b/modules/etcd/README.rst index d25b369a4..5de55c216 100644 --- a/modules/etcd/README.rst +++ b/modules/etcd/README.rst @@ -4,15 +4,15 @@ Etcd module ----------- The module connects to Etcd peers and watches for configuration change. -By default, the module looks for the subtree under ``/kresd`` directory, +By default, the module looks for the subtree under ``/knot-resolver`` directory, but you can change this `in the configuration `_. The subtree structure corresponds to the configuration variables in the declarative style. .. code-block:: bash - $ etcdctl set /kresd/net/127.0.0.1 53 - $ etcdctl set /kresd/cache/size 10000000 + $ etcdctl set /knot-resolvevr/net/127.0.0.1 53 + $ etcdctl set /knot-resolver/cache/size 10000000 Configures all listening nodes to following configuration: @@ -28,7 +28,7 @@ Example configuration modules = { etcd = { - prefix = '/kresd', + prefix = '/knot-resolver', peer = 'http://127.0.0.1:7001' } } diff --git a/modules/etcd/etcd.lua b/modules/etcd/etcd.lua index 08348529d..4d4bbfba0 100644 --- a/modules/etcd/etcd.lua +++ b/modules/etcd/etcd.lua @@ -27,7 +27,7 @@ end function etcd.init() etcd.Etcd = require('etcd.luasocket') - etcd.defaults = { prefix = '/kresd' } + etcd.defaults = { prefix = '/knot-resolver' } end function etcd.deinit() diff --git a/scripts/kresd.apparmor b/scripts/kresd.apparmor index 2b5b5f7ff..ad6f911a0 100644 --- a/scripts/kresd.apparmor +++ b/scripts/kresd.apparmor @@ -7,7 +7,7 @@ capability net_bind_service, capability setgid, capability setuid, - # seems to be needed during start to read /var/lib/kresd + # seems to be needed during start to read /var/lib/knot-resolver # while we still run as root. capability dac_override, @@ -15,9 +15,9 @@ network udp, /proc/sys/net/core/somaxconn r, - /etc/kresd/* r, - /var/lib/kresd/ r, - /var/lib/kresd/** rwlk, + /etc/knot-resolver/* r, + /var/lib/knot-resolver/ r, + /var/lib/knot-resolver/** rwlk, # modules /usr/lib{,64}/kdns_modules/*.lua r,