2019-05-19 22:25:20 +08:00
i n c l u d e $( TOPDIR ) / r u l e s . m k
PKG_NAME := dnsdist
2023-03-30 22:41:34 +08:00
PKG_VERSION := 1.8.0
2023-06-13 23:48:27 +08:00
PKG_RELEASE := 2
2019-05-19 22:25:20 +08:00
PKG_SOURCE := $( PKG_NAME) -$( PKG_VERSION) .tar.bz2
PKG_SOURCE_URL := https://downloads.powerdns.com/releases/
2023-03-30 22:41:34 +08:00
PKG_HASH := 1c0d375c25453d349b88e03ff589aa2603ca8692fc98364c068ead372804704f
2019-05-19 22:25:20 +08:00
2021-06-02 20:19:42 +08:00
PKG_MAINTAINER := Peter van Dijk <peter.van.dijk@powerdns.com>
2019-05-19 22:25:20 +08:00
PKG_LICENSE := GPL-2.0-only
PKG_LICENSE_FILES := COPYING
2019-06-25 18:59:32 +08:00
PKG_CPE_ID := cpe:/a:powerdns:dnsdist
2019-05-19 22:25:20 +08:00
PKG_INSTALL := 1
2020-02-10 10:47:22 +08:00
PKG_BUILD_PARALLEL := 1
2019-05-19 22:25:20 +08:00
2021-04-21 21:02:56 +08:00
PKG_BUILD_DEPENDS := boost
2019-12-15 00:37:56 +08:00
2019-05-19 22:25:20 +08:00
PKG_CONFIG_DEPENDS := \
CONFIG_DNSDIST_GNUTLS \
CONFIG_DNSDIST_OPENSSL
i n c l u d e $( INCLUDE_DIR ) / p a c k a g e . m k
2023-06-13 23:48:27 +08:00
d e f i n e P a c k a g e / d n s d i s t / D e f a u l t
SECTION:= net
CATEGORY:= Network
SUBMENU:= IP Addresses and Names
TITLE:= dnsdist DNS-, DOS- and abuse-aware loadbalancer $( 2)
USERID:= dnsdist:dnsdist
DEPENDS:= \
+ca-bundle \
+libatomic \
+libcap \
+libstdcpp \
+luajit
URL:= https://dnsdist.org/
VARIANT:= $( 1)
PROVIDES:= dnsdist
e n d e f
d e f i n e P a c k a g e / d n s d i s t / d e s c r i p t i o n / D e f a u l t
dnsdist is a highly DNS-, DoS- and abuse-aware loadbalancer. Its goal in life
is to route traffic to the best server, delivering top performance to legitimate
users while shunting or blocking abusive traffic.
e n d e f
d e f i n e P a c k a g e / d n s d i s t / c o n f f i l e s / D e f a u l t
/ e t c / d n s d i s t . c o n f
/ e t c / c o n f i g / d n s d i s t
/ e t c / i n i t . d / d n s d i s t
e n d e f
2019-05-19 22:25:20 +08:00
d e f i n e P a c k a g e / d n s d i s t / c o n f i g
2019-12-09 09:54:47 +08:00
m e n u "Configuration"
depends on PACKAGE_dnsdist
comment "SSL Support"
choice
prompt "Selected SSL library"
2020-03-12 20:09:28 +08:00
default DNSDIST_OPENSSL
2019-12-09 09:54:47 +08:00
config DNSDIST_GNUTLS
bool "GnuTLS"
2023-06-13 23:48:27 +08:00
config DNSDIST_OPENSSL
bool "OpenSSL"
2019-12-09 09:54:47 +08:00
config DNSDIST_NOSSL
bool "No SSL support"
endchoice
2019-12-13 16:03:53 +08:00
comment "DNS over HTTPS/TLS Support"
2019-12-09 09:54:47 +08:00
depends on !DNSDIST_NOSSL
config DNSDIST_DNS_OVER_HTTPS
depends on DNSDIST_OPENSSL
depends on !DNSDIST_NOSSL
bool "DNS over HTTPS Support"
help
"Enables DNS over HTTPS Support for dnsdist"
default y
2021-09-23 20:19:37 +08:00
config DNSDIST_DNS_OVER_HTTPS_OUTGOING
2023-06-13 23:48:27 +08:00
depends on DNSDIST_OPENSSL
2021-09-23 20:19:37 +08:00
depends on !DNSDIST_NOSSL
bool "Outgoing DNS over HTTPS Support"
help
"Enables Outgoing DNS over HTTPS Support for dnsdist"
default y
2019-12-09 09:54:47 +08:00
config DNSDIST_DNS_OVER_TLS
depends on !DNSDIST_NOSSL
bool "DNS over TLS Support"
help
"Enabled DNS over TLS Support for dnsdist"
default y
2021-04-22 23:57:25 +08:00
2023-06-13 23:48:27 +08:00
config DNSDIST_CARBON
bool "CARBON support"
help
"Enable Carbon (Graphite) support for dnsdist"
default n
config DNSDIST_LMDB
bool "LMDB support"
help
"Enable LMDB support for dnsdist"
default n
config DNSDIST_COMPLETION
bool "Console completion support"
help
"Enable console completion for dnsdist"
default n
config DNSDIST_DEBUG_SYMBOLS
bool "Debug symbols"
help
"Enable debug symbols in the dnsdist binary"
default n
config DNSDIST_DELAY_PIPE
bool "Delay action support"
help
"Enable delay action support for dnsdist"
default n
config DNSDIST_DYNBLOCKS
bool "Dynamic blocks support"
help
"Enable dynamic blocks support for dnsdist"
default n
config DNSDIST_DNSTAP
bool "DNSTAP support"
help
"Enable DNSTAP support for dnsdist"
default n
config DNSDIST_EBPF
bool "eBPF support"
help
"Enable eBPF support for dnsdist"
default n
config DNSDIST_ECS_ACTIONS
bool "ECS actions"
help
"Enable actions that control EDNS Client Subnet support for dnsdist"
default n
config DNSDIST_HASHED
bool "Hashed credentials"
help
"Enable credentials hashing support for dnsdist"
default n
config DNSDIST_IPCIPHER
bool "IP cipher support"
help
"Enable IP cipher support for dnsdist"
default n
config DNSDIST_LIBEDIT
bool "Build with libedit"
help
"Build with libedit - for completion, history and line editing"
default n
config DNSDIST_LMDB
bool "LMDB support"
help
"Enable LMDB support for dnsdist"
default n
config DNSDIST_LUA_ADVANCED
bool "Lua advanced bindings"
help
"Enable Lua bindings for queries and responses manipulation in dnsdist"
default n
config DNSDIST_MAC
bool "MAC address support"
help
"Enable MAC address in ring buffers support for dnsdist"
default y
2021-04-22 23:57:25 +08:00
config DNSDIST_NET_SNMP
bool "Net-SNMP support"
help
"Enable Net-SNMP support for dnsdist"
2023-06-13 23:48:27 +08:00
default n
config DNSDIST_OCSP_STAPLING
bool "OCSP Stapling support"
help
"Enable OCSP Stapling support for dnsdist"
default n
config DNSDIST_PIE
bool "Position Independent Executable"
help
"Build dnsdist as a Position-Independent executable. This is required to benefit from ASLR, but significantly increases the required disk space and memory usage"
default n
config DNSDIST_PROTOBUF
bool "Protobuf support"
help
"Enable exporting queries and responses over Protocol Buffer for dnsdist"
default n
config DNSDIST_PROMETHEUS
bool "Prometheus support"
help
"Enable Prometheus support for dnsdist"
default n
2021-04-23 05:45:02 +08:00
config DNSDIST_RE2
bool "RE2 support"
help
"Enable RE2 support for dnsdist"
2023-06-13 23:48:27 +08:00
default n
2021-04-28 03:19:12 +08:00
2023-06-13 23:48:27 +08:00
config DNSDIST_RULES_ALTER
bool "Rules altering queries"
2021-04-28 03:19:12 +08:00
help
2023-06-13 23:48:27 +08:00
"Enable rules altering queries for dnsdist"
default n
config DNSDIST_SECPOLL
bool "Security polling"
help
"Enable security polling support for dnsdist"
default n
2021-04-28 03:50:53 +08:00
config DNSDIST_SODIUM
2021-06-01 06:30:08 +08:00
bool "Build with libsodium"
2021-04-28 03:50:53 +08:00
help
"Build with libsodium - for encrypted console connections, and DNSCrypt"
2023-06-13 23:48:27 +08:00
default n
config DNSDIST_TOP_N
bool "Top N bindings"
help
"Enable bindings to get the top N queries and responses in dnsdist"
default n
config DNSDIST_WEB
bool "Internal web server"
help
"Enable support for the internal web server in dnsdist"
default n
2019-12-09 09:54:47 +08:00
e n d m e n u
2019-05-19 22:25:20 +08:00
e n d e f
2023-06-13 23:48:27 +08:00
d e f i n e P a c k a g e / d n s d i s t / i n s t a l l / D e f a u l t
$( INSTALL_DIR) $( 1) /etc
$( INSTALL_DIR) $( 1) /etc/dnsdist.conf.d
$( INSTALL_CONF) ./files/dnsdist.conf $( 1) /etc/dnsdist.conf
$( INSTALL_DIR) $( 1) /etc/config
$( INSTALL_CONF) ./files/dnsdist.config $( 1) /etc/config/dnsdist
$( INSTALL_DIR) $( 1) /etc/init.d
$( INSTALL_BIN) ./files/dnsdist.init $( 1) /etc/init.d/dnsdist
$( INSTALL_DIR) $( 1) /usr/bin
$( INSTALL_BIN) $( PKG_BUILD_DIR) /dnsdist $( 1) /usr/bin/
e n d e f
2019-05-19 22:25:20 +08:00
d e f i n e P a c k a g e / d n s d i s t
2023-06-13 23:48:27 +08:00
$( call Package/dnsdist/Default,mini,- minimal version with a restricted feature set )
DEPENDS += \
+DNSDIST_LIBEDIT:libedit \
+DNSDIST_DNSTAP:libfstrm \
+DNSDIST_GNUTLS:libgnutls \
2019-12-15 17:49:20 +08:00
+DNSDIST_DNS_OVER_HTTPS:libh2o-evloop \
2023-06-13 23:48:27 +08:00
+DNSDIST_NET_SNMP:libnetsnmp \
2021-09-23 20:19:37 +08:00
+DNSDIST_DNS_OVER_HTTPS_OUTGOING:libnghttp2 \
2019-12-15 17:49:20 +08:00
+DNSDIST_OPENSSL:libopenssl \
2021-04-28 03:50:53 +08:00
+DNSDIST_SODIUM:libsodium \
2023-06-13 23:48:27 +08:00
+DNSDIST_LMDB:lmdb \
+DNSDIST_CDB:tinycdb \
+DNSDIST_RE2:re2
2019-05-19 22:25:20 +08:00
e n d e f
2023-06-13 23:48:27 +08:00
P a c k a g e / d n s d i s t / description = $( call Package/dnsdist/description/Default)
P a c k a g e / d n s d i s t / conffiles = $( call Package/dnsdist/conffiles/Default)
P a c k a g e / d n s d i s t / install = $( call Package/dnsdist/install/Default,$1 )
2019-05-19 22:25:20 +08:00
2023-06-13 23:48:27 +08:00
d e f i n e P a c k a g e / d n s d i s t - f u l l
$( call Package/dnsdist/Default,full,- full version with all the features built in)
DEPENDS += \
+libedit \
+libfstrm \
+libgnutls \
+libh2o-evloop \
+libnetsnmp \
+libnghttp2 \
+libopenssl \
+libsodium \
+lmdb \
+tinycdb \
+re2
2019-05-19 22:25:20 +08:00
e n d e f
2023-06-13 23:48:27 +08:00
P a c k a g e / d n s d i s t - f u l l / description = $( call Package/dnsdist/description/Default)
P a c k a g e / d n s d i s t - f u l l / conffiles = $( call Package/dnsdist/conffiles/Default)
P a c k a g e / d n s d i s t - f u l l / install = $( call Package/dnsdist/install/Default,$1 )
2019-05-19 22:25:20 +08:00
2021-04-21 21:02:56 +08:00
# not everything groks --disable-nls
DISABLE_NLS :=
2023-06-13 23:48:27 +08:00
# disable PIE for this package, see CONFIG_DNSDIST_PIE
PKG_ASLR_PIE := 0
i f n e q ( $( CONFIG_DNSDIST_DEBUG_SYMBOLS ) , )
RSTRIP:= :
STRIP:= :
e n d i f
IsEnabled = $( or $( filter full,$( BUILD_VARIANT) ) ,$( CONFIG_$( 1) ) )
2021-04-23 05:45:02 +08:00
# OpenWRT's setting of CXX destroys dnsdist's -std=c++17
# --with-re2 compensates for that because it compensates for a bug in re2.pc that also destroys it
# so this addition is for the --without-re2 case
#
# none of this is pretty
TARGET_CXX += -std= c++17
2023-06-13 23:48:27 +08:00
TARGET_CFLAGS += -Os -fvisibility= hidden -flto -fno-ipa-cp -DNDEBUG
TARGET_CXXFLAGS += -Os -fvisibility= hidden -flto -fno-ipa-cp -DNDEBUG \
-DDISABLE_DEPRECATED_DYNBLOCK -DDISABLE_RECVMMSG -DDISABLE_NPN -DDISABLE_FALSE_SHARING_PADDING -DUSE_SINGLE_ACCEPTOR_THREAD -DOPENSSL_NO_ENGINE -DDISABLE_OPENSSL_ERROR_STRINGS \
$( if $( call IsEnabled,DNSDIST_CARBON) ,,-DDISABLE_CARBON) \
$( if $( call IsEnabled,DNSDIST_COMPLETION) ,,-DDISABLE_COMPLETION) \
$( if $( call IsEnabled,DNSDIST_DEBUG_SYMBOLS) ,-g3,) \
$( if $( call IsEnabled,DNSDIST_DELAY_PIPE) ,,-DDISABLE_DELAY_PIPE) \
$( if $( call IsEnabled,DNSDIST_DYNBLOCKS) ,,-DDISABLE_DYNBLOCKS) \
$( if $( call IsEnabled,DNSDIST_ECS_ACTIONS) ,,-DDISABLE_ECS_ACTIONS) \
$( if $( call IsEnabled,DNSDIST_HASHED) ,,-DDISABLE_HASHED_CREDENTIALS) \
$( if $( call IsEnabled,DNSDIST_LUA_ADVANCED) ,,-DDISABLE_NON_FFI_DQ_BINDINGS -DDISABLE_POLICIES_BINDINGS -DDISABLE_DOWNSTREAM_BINDINGS -DDISABLE_DNSHEADER_BINDINGS -DDISABLE_COMBO_ADDR_BINDINGS -DDISABLE_QPS_LIMITER_BINDINGS -DDISABLE_PACKETCACHE_BINDINGS -DDISABLE_CLIENT_STATE_BINDINGS -DDISABLE_DNSPACKET_BINDINGS -DDISABLE_LUA_BINDINGS_RINGS) \
$( if $( call IsEnabled,DNSDIST_MAC) ,-DDNSDIST_RINGS_WITH_MACADDRESS,) \
$( if $( call IsEnabled,DNSDIST_OCSP_STAPLING) ,,-DDISABLE_OCSP_STAPLING) \
$( if $( call IsEnabled,DNSDIST_PROTOBUF) ,,-DDISABLE_PROTOBUF) \
$( if $( call IsEnabled,DNSDIST_PROMETHEUS) ,,-DDISABLE_PROMETHEUS) \
$( if $( call IsEnabled,DNSDIST_RULES_ALTER) ,,-DDISABLE_RULES_ALTERING_QUERIES) \
$( if $( call IsEnabled,DNSDIST_SECPOLL) ,,-DDISABLE_SECPOLL) \
$( if $( call IsEnabled,DNSDIST_TOP_N) ,,-DDISABLE_TOP_N_BINDINGS) \
$( if $( call IsEnabled,DNSDIST_WEB) ,,-DDISABLE_WEB_CONFIG -DDISABLE_BUILTIN_HTML -DDISABLE_LUA_WEB_HANDLERS)
2021-04-23 05:45:02 +08:00
2019-05-19 22:25:20 +08:00
CONFIGURE_ARGS += \
2020-02-10 10:47:22 +08:00
--with-pic \
2022-06-20 22:53:34 +08:00
--with-lua= luajit \
2023-06-13 23:48:27 +08:00
--with-libcap \
$( if $( call IsEnabled,DNSDIST_PIE) ,,--disable-hardening) \
$( if $( call IsEnabled,DNSDIST_SODIUM) ,--enable-dnscrypt --with-libsodium,--disable-dnscrypt --without-libsodium) \
$( if $( call IsEnabled,DNSDIST_DNSTAP) ,--enable-dnstap= yes,--enable-dnstap= no) \
$( if $( call IsEnabled,DNSDIST_RE2) ,--with,--without) -re2 \
$( if $( call IsEnabled,DNSDIST_NET_SNMP) ,--with,--without) -net-snmp \
$( if $( call IsEnabled,DNSDIST_GNUTLS) ,--with,--without) -gnutls \
$( if $( call IsEnabled,DNSDIST_OPENSSL) ,--with,--without) -libssl \
$( if $( call IsEnabled,DNSDIST_DNS_OVER_TLS) ,--enable-dns-over-tls,) \
$( if $( call IsEnabled,DNSDIST_CDB) ,--with,--without) -cdb \
$( if $( call IsEnabled,DNSDIST_LMDB) ,--with,--without) -lmdb \
$( if $( call IsEnabled,DNSDIST_LIBEDIT) ,--with,--without) -libedit \
$( if $( call IsEnabled,DNSDIST_IPCIPHER) ,--enable,--disable) -ipcipher \
$( if $( call IsEnabled,DNSDIST_EBPF) ,--with,--without) -ebpf \
$( if $( call IsEnabled,DNSDIST_DNS_OVER_HTTPS) ,--enable-dns-over-https,) \
$( if $( call IsEnabled,DNSDIST_DNS_OVER_HTTPS_OUTGOING) ,--with,--without) -nghttp2
2019-05-19 22:25:20 +08:00
$( eval $ ( call BuildPackage ,dnsdist ) )
2023-06-13 23:48:27 +08:00
$( eval $ ( call BuildPackage ,dnsdist -full ) )