From bbab28385b9123465ec46a7cf36178b4aed4dc2b Mon Sep 17 00:00:00 2001 From: David Mora Date: Sun, 14 Jan 2018 08:59:16 -0500 Subject: [PATCH] stubby: Initial commit of openwrt package for stubby daemon (This daemon utilizes the getdns library) Signed-off-by: David Mora --- net/stubby/Makefile | 59 ++++++++++++++++++++++++++++++++++++ net/stubby/files/stubby.init | 25 +++++++++++++++ net/stubby/files/stubby.yml | 29 ++++++++++++++++++ 3 files changed, 113 insertions(+) create mode 100644 net/stubby/Makefile create mode 100644 net/stubby/files/stubby.init create mode 100644 net/stubby/files/stubby.yml diff --git a/net/stubby/Makefile b/net/stubby/Makefile new file mode 100644 index 000000000..41e1f57dc --- /dev/null +++ b/net/stubby/Makefile @@ -0,0 +1,59 @@ +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=stubby +PKG_VERSION:=0.2.1 +PKG_RELEASE:=1 + +PKG_LICENSE:=BSD-3-Clause +PKG_LICENSE_FILES:=COPYING +PKG_MAINTAINER:=David Mora + +PKG_SOURCE:=v$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=https://github.com/getdnsapi/stubby/archive/ +PKG_HASH:=adf030a55426918933870f2d49a0caed93023bb1ec806efb255c3e7494985821 + +PKG_FIXUP:=autoreconf + +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/stubby/Default + TITLE:=stubby + URL:=https://dnsprivacy.org/wiki/display/DP/DNS+Privacy+Daemon+-+Stubby +endef + +define Package/stubby/description + This package contains the Stubby daemon (which utilizes the getdns library). +endef + +define Package/stubby + $(call Package/stubby/Default) + SECTION:=net + CATEGORY:=Network + SUBMENU:=IP Addresses and Names + TITLE+= - (daemon that uses getdns) + USERID:=stubby=410:stubby=410 + DEPENDS:= +libyaml +getdns +endef + +define Package/stubby/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/stubby $(1)/usr/sbin/stubby + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/stubby.init $(1)/etc/init.d/stubby + $(INSTALL_DIR) $(1)/etc/stubby + $(INSTALL_DATA) $(PKG_INSTALL_DIR)/etc/stubby/stubby.yml $(1)/etc/stubby/stubby.yml.default + $(INSTALL_DATA) ./files/stubby.yml $(1)/etc/stubby/stubby.yml +endef + + +define Package/stubby/conffiles + /etc/stubby/stubby.yml +endef + +$(eval $(call BuildPackage,stubby)) diff --git a/net/stubby/files/stubby.init b/net/stubby/files/stubby.init new file mode 100644 index 000000000..1f2ce16e2 --- /dev/null +++ b/net/stubby/files/stubby.init @@ -0,0 +1,25 @@ +#!/bin/sh /etc/rc.common + +USE_PROCD=1 + +START=50 +STOP=51 + +PROG=/usr/sbin/stubby + +start_service() { + procd_open_instance stubby + procd_set_param command /usr/sbin/stubby + + procd_set_param respawn ${respawn_threshold:-3600} ${respawn_timeout:-5} ${respawn_retry:-5} + + procd_set_param limits core="unlimited" + + procd_set_param file /etc/stubby/stubby.yml + + procd_set_param stdout 1 + procd_set_param stderr 1 + procd_set_param user stubby + procd_close_instance +} + diff --git a/net/stubby/files/stubby.yml b/net/stubby/files/stubby.yml new file mode 100644 index 000000000..f0e53cb59 --- /dev/null +++ b/net/stubby/files/stubby.yml @@ -0,0 +1,29 @@ +#NOTE: See '/etc/stubby/stubby.yml.default' for original config file and descriptions + +resolution_type: GETDNS_RESOLUTION_STUB + +dns_transport_list: + - GETDNS_TRANSPORT_TLS + +tls_authentication: GETDNS_AUTHENTICATION_REQUIRED + +tls_query_padding_blocksize: 256 + +edns_client_subnet_private : 1 + +idle_timeout: 10000 + +listen_addresses: + - 127.0.0.1@5453 + - 0::1@5453 + +round_robin_upstreams: 0 + +upstream_recursive_servers: +# Quad 9 IPv6 + - address_data: 2620:fe::fe + tls_auth_name: "dns.quad9.net" +# IPv4 addresses +# Quad 9 service + - address_data: 9.9.9.9 + tls_auth_name: "dns.quad9.net"