aboutsummaryrefslogtreecommitdiffstats
path: root/testing
diff options
context:
space:
mode:
authorJakub Jirutka <jakub@jirutka.cz>2016-10-02 20:57:00 +0200
committerJakub Jirutka <jakub@jirutka.cz>2016-10-02 20:57:44 +0200
commita75feeec3757b022d7666c1d1f9489d5531b0c7e (patch)
treef4f253cbc6b26d6ae4c6a530ead2cc10d37d3166 /testing
parentc1530a4a6b2beae6294f038befd5eb67c6f3b2f6 (diff)
downloadaports-a75feeec3757b022d7666c1d1f9489d5531b0c7e.tar.bz2
aports-a75feeec3757b022d7666c1d1f9489d5531b0c7e.tar.xz
testing/knot-resolver: new aport
https://www.knot-resolver.cz/ A minimalistic caching resolver implementation
Diffstat (limited to 'testing')
-rw-r--r--testing/knot-resolver/APKBUILD84
-rw-r--r--testing/knot-resolver/config23
-rw-r--r--testing/knot-resolver/knot-resolver.confd10
-rw-r--r--testing/knot-resolver/knot-resolver.initd25
-rw-r--r--testing/knot-resolver/knot-resolver.logrotate7
-rw-r--r--testing/knot-resolver/knot-resolver.pre-install6
-rw-r--r--testing/knot-resolver/root.keys1
7 files changed, 156 insertions, 0 deletions
diff --git a/testing/knot-resolver/APKBUILD b/testing/knot-resolver/APKBUILD
new file mode 100644
index 0000000000..2921a247cf
--- /dev/null
+++ b/testing/knot-resolver/APKBUILD
@@ -0,0 +1,84 @@
+# Contributor: Jakub Jirutka <jakub@jirutka.cz>
+# Maintainer: Jakub Jirutka <jakub@jirutka.cz>
+pkgname=knot-resolver
+pkgver=1.1.1
+pkgrel=0
+pkgdesc="Minimalistic caching DNS resolver implementation"
+url="https://www.knot-resolver.cz/"
+arch="all"
+license="GPLv3"
+depends="lua5.1-sec lua5.1-socket"
+depends_dev="knot-dev libuv-dev luajit-dev"
+makedepends="$depends_dev"
+install="$pkgname.pre-install"
+pkgusers="kresd"
+pkggroups="kresd"
+subpackages="$pkgname-mod-http:http $pkgname-dev $pkgname-doc"
+source="https://secure.nic.cz/files/$pkgname/$pkgname-$pkgver.tar.xz
+ $pkgname.initd
+ $pkgname.confd
+ $pkgname.logrotate
+ config
+ root.keys"
+builddir="$srcdir/$pkgname-$pkgver"
+
+_flags="PREFIX=/usr
+ ETCDIR=/etc/$pkgname"
+
+build() {
+ cd "$builddir"
+ make $_flags
+}
+
+package() {
+ make -C "$builddir" $_flags DESTDIR="$pkgdir" install || return 1
+
+ cd "$pkgdir"
+
+ # Move sample configs to -doc.
+ mkdir -p ./usr/share/doc/$pkgname
+ mv ./etc/$pkgname/* ./usr/share/doc/$pkgname/ || return 1
+ chmod 644 ./usr/share/doc/$pkgname/* || return 1
+
+ install -m 640 -o root -g kresd "$srcdir"/config \
+ ./etc/$pkgname/config || return 1
+
+ install -m 755 -o kresd -g kresd -d ./var/lib/$pkgname || return 1
+ install -m 644 -o kresd -D "$srcdir"/root.keys \
+ ./var/lib/$pkgname/root.keys || return 1
+
+ install -m 755 -D "$srcdir"/$pkgname.initd ./etc/init.d/$pkgname || return 1
+ install -m 644 -D "$srcdir"/$pkgname.confd ./etc/conf.d/$pkgname || return 1
+
+ install -m 644 -D "$srcdir"/$pkgname.logrotate ./etc/logrotate.d/$pkgname
+}
+
+# TODO: depends on https://github.com/daurnimator/lua-http!
+http() {
+ pkgdesc="Knot DNS resolver - HTTP/2 services"
+ depends="$pkgname"
+ arch="noarch"
+ local moddir="usr/lib/kdns_modules"
+
+ mkdir -p "$subpkgdir"/$moddir
+ mv "$pkgdir"/$moddir/http* "$subpkgdir"/$moddir/
+}
+
+md5sums="e4a81beeaac80c75395d0ac8bc67efcb knot-resolver-1.1.1.tar.xz
+b81cf13d877474bd79d7dfd7d7bbc417 knot-resolver.initd
+5d75949a98df66a29d095f6df5ecb51e knot-resolver.confd
+86266e55201cf87374a1e1d037e85dd8 knot-resolver.logrotate
+8e3afb5d40b7f9181b0bc5aa0e0c4d82 config
+4344dd99bb1122d3a45eee6704b14fd0 root.keys"
+sha256sums="f848f6dd2c7a2c1a5067d3bd95dacb752d1f3d8dc9d5ccc0c34a4540d00ab54a knot-resolver-1.1.1.tar.xz
+2212a096f33f14a0aeeaaddc0557e82fa4adea6392d313b3b54fce00240e1aea knot-resolver.initd
+b63417af260565696f6085c0ad6dc127f24a12b183c7dbd8c9cf13342cc4a5db knot-resolver.confd
+1907cad39d355c03f84997272271933476d335b0e84c4f71490c98b7a2631f20 knot-resolver.logrotate
+cb4fa78a37355a26819168cf953be17e768ef98a1cf2dd8df58c3a97b6c6a6a1 config
+bc0453fcf9667eaf6343b3cb26a4e0fcc8208288fb1a2f23641ea7d2546b5b00 root.keys"
+sha512sums="8697284d528e590e60cc979753ea3723f30faec8e2eb4c12cc8cb732e1688292373454f4ac7651188829fc460cab46995188749d5f73e83feb2bc6ceacfef799 knot-resolver-1.1.1.tar.xz
+0e9b947ed0fe39a600ba8fe3cdeacf07521cdd6c371007dd15524f67c75ea024994a8c11820d70c57ef180c90f492eae69ef167152ad84c24a47c885710a7974 knot-resolver.initd
+9d0d629405df243dc0f782abd6fcaaaf13fbce78d881f7ce213cfd2a55cfbfd87af2ba976061bf7b5d3d055edec98b42632395390f2a469648c27f96124997a6 knot-resolver.confd
+688aeacb0c1f21c7e532533b402e67068897217713fb668636df7533000b493981ddfa0497f8dba7da7c804ee4ab8d587a4f52155b4e2bf1f4025d2588d314bb knot-resolver.logrotate
+913a557dde84e9dac7c7300ab093285865fa57f3875fc357e680f04a0e85af6610a0e33da6262431cbb06a2c5a115952e742e48c8568d4eb82182906170b4a73 config
+d8b7bab857937372fc66853387eb8783eba3783513ac545016acafb7e8659d0412d883d6a217d80512860c5b265b8b5cc981cbe7bbe59eefc2bf18fb17ef4f83 root.keys"
diff --git a/testing/knot-resolver/config b/testing/knot-resolver/config
new file mode 100644
index 0000000000..1731f0c591
--- /dev/null
+++ b/testing/knot-resolver/config
@@ -0,0 +1,23 @@
+-- vim:syntax=lua:
+--
+-- 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('kresd', 'kresd')
+
+-- Load Useful modules
+modules = {
+ 'policy', -- Block queries to local zones/bad sites
+ 'hints', -- Load /etc/hosts and allow custom root hints
+ 'stats', -- Track internal statistics
+ 'predict', -- Prefetch expiring/frequent records
+}
+
+-- Smaller cache size
+cache.size = 10 * MB
diff --git a/testing/knot-resolver/knot-resolver.confd b/testing/knot-resolver/knot-resolver.confd
new file mode 100644
index 0000000000..ccc2e995fd
--- /dev/null
+++ b/testing/knot-resolver/knot-resolver.confd
@@ -0,0 +1,10 @@
+# Config file for /etc/init.d/knot-resolver
+
+# Config file path.
+#config="/etc/knot-resolver/config"
+
+# Cache (working) directory.
+#cachedir="/var/cache/knot-resolver"
+
+# Path to the logging file.
+#logfile="/var/log/knot-resolver.log"
diff --git a/testing/knot-resolver/knot-resolver.initd b/testing/knot-resolver/knot-resolver.initd
new file mode 100644
index 0000000000..7a4ef61eaf
--- /dev/null
+++ b/testing/knot-resolver/knot-resolver.initd
@@ -0,0 +1,25 @@
+#!/sbin/openrc-run
+
+: ${config:="/etc/knot-resolver/config"}
+: ${cachedir:="/var/cache/knot-resolver"}
+: ${keyfile:="/var/lib/knot-resolver/root.keys"}
+: ${logfile:="/var/log/knot-resolver.log"}
+
+command="/usr/sbin/kresd"
+# Note: Do not change forks=1, it's buggy.
+command_args="--config=$config --keyfile=$keyfile --forks=1 $cachedir"
+command_background="yes"
+pidfile="/run/$RC_SVCNAME.pid"
+start_stop_daemon_args="
+ --chdir=$cachedir
+ --stdout=$logfile
+ --stderr=$logfile"
+required_files="$config"
+
+depend() {
+ need net
+}
+
+start_pre() {
+ checkpath -d -m 750 -o kresd:kresd "$cachedir"
+}
diff --git a/testing/knot-resolver/knot-resolver.logrotate b/testing/knot-resolver/knot-resolver.logrotate
new file mode 100644
index 0000000000..a1b0fb4d4b
--- /dev/null
+++ b/testing/knot-resolver/knot-resolver.logrotate
@@ -0,0 +1,7 @@
+/var/log/knot-resolver.log {
+ notifempty
+ missingok
+ postrotate
+ /etc/init.d/knot-resolver --quiet --ifstarted restart
+ endscript
+}
diff --git a/testing/knot-resolver/knot-resolver.pre-install b/testing/knot-resolver/knot-resolver.pre-install
new file mode 100644
index 0000000000..638c4c7310
--- /dev/null
+++ b/testing/knot-resolver/knot-resolver.pre-install
@@ -0,0 +1,6 @@
+#!/bin/sh
+
+addgroup -S kresd 2>/dev/null
+adduser -S -D -H -h /var/lib/knot-resolver -s /sbin/nologin -G kresd -g kresd kresd 2>/dev/null
+
+exit 0
diff --git a/testing/knot-resolver/root.keys b/testing/knot-resolver/root.keys
new file mode 100644
index 0000000000..aeadb854a6
--- /dev/null
+++ b/testing/knot-resolver/root.keys
@@ -0,0 +1 @@
+. 11579 IN TYPE48 \# 264 0101030803010001A80020A95566BA42E886BB804CDA84E47EF56DBD7AEC612615552CEC906D2116D0EF207028C51554144DFEAFE7C7CB8F005DD18234133AC0710A81182CE1FD14AD2283BC83435F9DF2F6313251931A176DF0DA51E54F42E604860DFB359580250F559CC543C4FFD51CBE3DE8CFD06719237F9FC47EE729DA06835FA452E825E9A18EBC2ECBCF563474652C33CF56A9033BCDF5D973121797EC8089041B6E03A1B72D0A735B984E03687309332324F27C2DBA85E9DB15E83A0143382E974B0621C18E625ECEC907577D9E7BADE95241A81EBBE8A901D4D3276E40B114C0A2E6FC38D19C2E6AAB02644B2813F575FC21601E0DEE49CD9EE96A43103E524D62873D ; Valid