From db06f7ee2a9d4ee0bfa9792ed9309a7e83776720 Mon Sep 17 00:00:00 2001 From: Olivier Poitrey Date: Thu, 21 Nov 2019 02:26:31 -0800 Subject: [PATCH] nextdns: Update version 1.1.5 + add per host config option * Update nextdns to version 1.1.5 which adds IPv6 dual stack support. * Add the ability to configure per host configuration id from uci. Signed-off-by: Olivier Poitrey --- net/nextdns/Makefile | 6 +++--- net/nextdns/files/nextdns.config | 12 +++++++++++- net/nextdns/files/nextdns.init | 7 +++++++ 3 files changed, 21 insertions(+), 4 deletions(-) diff --git a/net/nextdns/Makefile b/net/nextdns/Makefile index 367263b1c7..08496997a6 100644 --- a/net/nextdns/Makefile +++ b/net/nextdns/Makefile @@ -8,13 +8,13 @@ include $(TOPDIR)/rules.mk PKG_NAME:=nextdns -PKG_VERSION:=1.1.3 -PKG_RELEASE:=2 +PKG_VERSION:=1.1.5 +PKG_RELEASE:=3 PKG_SOURCE_PROTO:=git PKG_SOURCE_VERSION:=v$(PKG_VERSION) PKG_SOURCE_URL:=https://github.com/nextdns/nextdns.git -PKG_MIRROR_HASH:=50ba4f90330c1d0f7075f7ac4802f7262cf5653b38e58875a45a56aa37214b39 +PKG_MIRROR_HASH:=01ff61771bcf076f1659167b8676234fdefefac9cd0a05aa1d491a7c5f0145fa PKG_MAINTAINER:=Olivier Poitrey PKG_LICENSE:=MIT diff --git a/net/nextdns/files/nextdns.config b/net/nextdns/files/nextdns.config index 560d1267b2..7e34291bf6 100644 --- a/net/nextdns/files/nextdns.config +++ b/net/nextdns/files/nextdns.config @@ -4,7 +4,17 @@ config nextdns main # NextDNS custom configuration id (create on on https://nextdns.io). # If not defined, this package will act as a non-logging, non-filtering # DNS over HTTPS resolver. - # option config abcdef + # + #option config abcdef + + # Custom configurations can also be conditionally assigned to LAN hosts based + # their MAC address or subnet. The first matching host_config wins. If both + # host_config and config are defined, config is always placed last, as default + # option. + # + #list host_config 'da:c8:6d:b6:93:78=fedcba' + #list host_config '10.0.1.2/32=abc123' + #list host_config '10.0.3.0/24=def321' # Listen on a custom local port so a DNS front (like dnsmasq) can use us as # a forwarder. diff --git a/net/nextdns/files/nextdns.init b/net/nextdns/files/nextdns.init index 1faaaa37a1..789f7d9686 100644 --- a/net/nextdns/files/nextdns.init +++ b/net/nextdns/files/nextdns.init @@ -23,12 +23,17 @@ dnsmasq_reload() { fi } +handle_host_config() { + host_config_args="$host_config_args -config=$1" +} + start_service() { config_load nextdns config_get_bool enabled main enabled "1" rm -f /tmp/dnsmasq.d/nextdns.conf if [ "$enabled" = "1" ]; then config_get config main config "" + config_list_foreach main host_config handle_host_config config_get listen main listen "127.0.0.1:5342" config_get_bool report_client_info main report_client_info "1" config_get_bool hardened_privacy main hardened_privacy "0" @@ -44,8 +49,10 @@ start_service() { fi procd_open_instance + # shellcheck disable=SC2086 procd_set_param command "$PROG" run \ -listen="$listen" \ + $host_config_args \ -config="$config" \ -report-client-info="$report_client_info" \ -hardened-privacy="$hardened_privacy" \ -- 2.30.2