Merge branch 'openwrt:master' into master

This commit is contained in:
Hayzam Sherif 2023-06-07 22:44:32 +05:30 committed by GitHub
commit ee57376761
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
27 changed files with 220 additions and 509 deletions

View file

@ -12,7 +12,8 @@ PKG_VERSION:=6.2.3
PKG_RELEASE:=3
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://cdn.zabbix.com/zabbix/sources/stable/6.2/
PKG_SOURCE_URL:=https://cdn.zabbix.com/zabbix/sources/stable/$(basename $(PKG_VERSION))/ \
https://cdn.zabbix.com/zabbix/sources/oldstable/$(basename $(PKG_VERSION))/
PKG_HASH:=2be7e57fb33a55fee71480598e317ffa6a8ee5a39639a7e1b42b2ea6872107b5
PKG_MAINTAINER:=Etienne CHAMPETIER <champetier.etienne@gmail.com>

View file

@ -1,55 +0,0 @@
#
# Copyright (C) 2020 Jeffery To
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
PKG_NAME:=packr
PKG_VERSION:=1.30.1
PKG_RELEASE:=1
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://github.com/gobuffalo/packr.git
PKG_SOURCE_VERSION:=v$(PKG_VERSION)
PKG_MIRROR_HASH:=fe199299e6b7236cf9538c06d27ab1a4efd93cda2b3ea85bab9154be364760c8
PKG_LICENSE:=MIT
PKG_LICENSE_FILES:=LICENSE.txt
PKG_MAINTAINER:=Jeffery To <jeffery.to@gmail.com>
HOST_BUILD_DEPENDS:=golang/host
HOST_BUILD_PARALLEL:=1
PKG_BUILD_DEPENDS:=golang/host
PKG_BUILD_PARALLEL:=1
PKG_BUILD_FLAGS:=no-mips16
GO_PKG:=github.com/gobuffalo/packr
GO_PKG_BUILD_PKG:=github.com/gobuffalo/packr/packr
include $(INCLUDE_DIR)/host-build.mk
include $(INCLUDE_DIR)/package.mk
include ../../lang/golang/golang-host-build.mk
include ../../lang/golang/golang-package.mk
define Package/packr
SECTION:=devel
CATEGORY:=Development
TITLE:=Embed static files into Go binaries
URL:=https://github.com/gobuffalo/packr
DEPENDS:=$(GO_ARCH_DEPENDS)
endef
define Package/packr/description
Packr is a simple solution for bundling static assets inside of Go
binaries. Most importantly it does it in a way that is friendly to
developers while they are developing.
endef
$(eval $(call GoBinHostBuild))
$(eval $(call HostBuild))
$(eval $(call GoBinPackage,packr))
$(eval $(call BuildPackage,packr))

View file

@ -8,11 +8,11 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=python-hatchling
PKG_VERSION:=1.17.0
PKG_RELEASE:=2
PKG_VERSION:=1.17.1
PKG_RELEASE:=1
PYPI_NAME:=hatchling
PKG_HASH:=b1244db3f45b4ef5a00106a46612da107cdfaf85f1580b8e1c059fefc98b0930
PKG_HASH:=76dee5108f929b7eb9102df0a1bf88fa3247d68a44ff1f395e1cf32eaab0c6fa
PKG_LICENSE:=MIT
PKG_LICENSE_FILES:=LICENSE.txt

View file

@ -3,17 +3,18 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=passlib
PKG_VERSION:=1.7.2
PKG_RELEASE:=2
PKG_LICENSE:=BSD-3-Clause
PKG_NAME:=python-passlib
PKG_VERSION:=1.7.4
PKG_RELEASE:=1
PYPI_NAME:=$(PKG_NAME)
PKG_HASH:=8d666cef936198bc2ab47ee9b0410c94adf2ba798e5a84bf220be079ae7ab6a8
PYPI_NAME:=passlib
PKG_HASH:=defd50f72b65c5402ab2c573830a6978e5f202ad0d984793c8dde2c4152ebe04
PKG_LICENSE:=BSD-3-Clause
PKG_LICENSE_FILES:=LICENSE
include ../pypi.mk
include $(INCLUDE_DIR)/package.mk
include ../python3-package.mk
define Package/python3-passlib
@ -21,8 +22,8 @@ define Package/python3-passlib
SECTION:=lang
CATEGORY:=Languages
TITLE:=Comprehensive password hashing framework
URL:=https://bitbucket.org/ecollins/passlib
DEPENDS:=+python3 +python3-dateutil
URL:=https://passlib.readthedocs.io/
DEPENDS:=+python3
endef
define Package/python3-passlib/description
@ -35,6 +36,5 @@ multi-user applications.
endef
$(eval $(call Py3Package,python3-passlib))
$(eval $(call BuildPackage,python3-passlib))
$(eval $(call BuildPackage,python3-passlib-src))

View file

@ -8,12 +8,12 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=python-poetry-core
PKG_VERSION:=1.6.0
PKG_VERSION:=1.6.1
PKG_RELEASE:=1
PYPI_NAME:=poetry-core
PYPI_SOURCE_NAME:=poetry_core
PKG_HASH:=a9c7296a12d6c8e4f8aa50a66ef3c967b2b50fba634da144d358e676fad9989f
PKG_HASH:=0f9b0de39665f36d6594657e7d57b6f463cc10f30c28e6d1c3b9ff54c26c9ac3
PKG_LICENSE:=MIT
PKG_LICENSE_FILES:=LICENSE

View file

@ -8,12 +8,12 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=python-typing-extensions
PKG_VERSION:=4.6.2
PKG_VERSION:=4.6.3
PKG_RELEASE:=1
PYPI_NAME:=typing-extensions
PYPI_SOURCE_NAME:=typing_extensions
PKG_HASH:=06006244c70ac8ee83fa8282cb188f697b8db25bc8b4df07be1873c43897060c
PKG_HASH:=d91d5919357fe7f681a9f2b5b4cb2a5f1ef0a1e9f59c4d8ff0d3491e05c0ffd5
PKG_MAINTAINER:=Jan Pavlinec <jan.pavlinec1@gmail.com>, Jeffery To <jeffery.to@gmail.com>
PKG_LICENSE:=Python-2.0.1 0BSD

View file

@ -8,11 +8,11 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=yarl
PKG_VERSION:=1.6.3
PKG_VERSION:=1.9.2
PKG_RELEASE:=1
PYPI_NAME:=$(PKG_NAME)
PKG_HASH:=8a9066529240171b68893d60dca86a763eae2139dd42f42106b03cf4b426bf10
PKG_HASH:=04ab9d4b9f587c06d801c2abfe9317b77cdf996c65a90d5e84ecc45010823571
PKG_MAINTAINER:=Josef Schlehofer <pepe.schlehofer@gmail.com>
PKG_LICENSE:=Apache-2.0

View file

@ -8,11 +8,11 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=python3-bottle
PKG_VERSION:=0.12.19
PKG_VERSION:=0.12.25
PKG_RELEASE:=1
PYPI_NAME:=bottle
PKG_HASH:=a9d73ffcbc6a1345ca2d7949638db46349f5b2b77dac65d6494d45c23628da2c
PKG_HASH:=e1a9c94970ae6d710b3fb4526294dfeb86f2cb4a81eff3a4b98dc40fb0e5e021
PKG_MAINTAINER:=Josef Schlehofer <josef.schlehofer@nic.cz>
PKG_LICENSE:=MIT

View file

@ -1,33 +0,0 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=django-etesync-journal
PKG_VERSION:=1.2.2
PKG_RELEASE:=1
PYPI_NAME:=django-etesync-journal
PKG_HASH:=1b10a6bca45078bff9b78da3757ba118ecae8f0cc1d9db278bd96eab85f594db
PKG_LICENSE:=AGPL-3.0-only
PKG_LICENSE_FILES:=LICENSE
PKG_MAINTAINER:=Peter Stadler <peter.stadler@student.uibk.ac.at>
include ../pypi.mk
include $(INCLUDE_DIR)/package.mk
include ../python3-package.mk
define Package/python3-django-etesync-journal
SUBMENU:=Python
SECTION:=lang
CATEGORY:=Languages
TITLE:=The server side implementation of the EteSync protocol.
URL:=https://www.etesync.com/
DEPENDS:=+django +python3-django-restframework +python3-light
endef
define Package/python3-django-etesync-journal/description
The reusable django app that implements the server side of the EteSync protocol.
endef
$(eval $(call Py3Package,python3-django-etesync-journal))
$(eval $(call BuildPackage,python3-django-etesync-journal))
$(eval $(call BuildPackage,python3-django-etesync-journal-src))

View file

@ -5,12 +5,12 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=rust
PKG_VERSION:=1.69.0
PKG_RELEASE:=1
PKG_VERSION:=1.70.0
PKG_RELEASE:=2
PKG_SOURCE:=rustc-$(PKG_VERSION)-src.tar.gz
PKG_SOURCE_URL:=https://static.rust-lang.org/dist/
PKG_HASH:=fb05971867ad6ccabbd3720279f5a94b99f61024923187b56bb5c455fa3cf60f
PKG_HASH:=b2bfae000b7a5040e4ec4bbc50a09f21548190cb7570b0ed77358368413bd27c
HOST_BUILD_DIR:=$(BUILD_DIR_HOST)/rustc-$(PKG_VERSION)-src
PKG_MAINTAINER:=Luca Barbato <lu_zero@luminem.org>

View file

@ -1,7 +1,7 @@
From b74dbd080ea75ebcc371732ddbfeb81c96b8c5d5 Mon Sep 17 00:00:00 2001
From d3000458501d339ea2043006924d431ead18769e Mon Sep 17 00:00:00 2001
From: Luca Barbato <lu_zero@gentoo.org>
Date: Fri, 10 Mar 2023 18:24:14 +0100
Subject: [PATCH] Update xz2 and lzma-sys
Date: Sun, 4 Jun 2023 19:32:28 +0000
Subject: [PATCH] Update xz2 and use it static
---
Cargo.lock | 8 ++++----
@ -9,16 +9,9 @@ Subject: [PATCH] Update xz2 and lzma-sys
src/bootstrap/Cargo.toml | 2 +-
3 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/Cargo.lock b/Cargo.lock
index 64df70f68e9..dff61db9893 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -2490,19 +2490,19 @@ version = "0.4.14"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "51b9bbe6c47d51fc3e1a9b945965946b4c44142ab8792c50835a980d362c2710"
dependencies = [
"cfg-if",
]
@@ -3085,9 +3085,9 @@ dependencies = [
[[package]]
name = "lzma-sys"
@ -30,17 +23,7 @@ index 64df70f68e9..dff61db9893 100644
dependencies = [
"cc",
"libc",
"pkg-config",
]
[[package]]
name = "mac"
@@ -6341,19 +6341,19 @@ version = "0.2.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "244c3741f4240ef46274860397c7c74e50eb23624996930e484c16679633a54c"
dependencies = [
"libc",
]
@@ -7116,9 +7116,9 @@ dependencies = [
[[package]]
name = "xz2"
@ -52,21 +35,9 @@ index 64df70f68e9..dff61db9893 100644
dependencies = [
"lzma-sys",
]
[[package]]
name = "yaml-merge-keys"
version = "0.4.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
diff --git a/src/bootstrap/Cargo.lock b/src/bootstrap/Cargo.lock
index 4a0ba592577..e75b4dbd12e 100644
--- a/src/bootstrap/Cargo.lock
+++ b/src/bootstrap/Cargo.lock
@@ -351,19 +351,19 @@ version = "0.4.17"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "abb12e687cfb44aa40f41fc3978ef76448f9b6038cad6aef4259d3c095a2382e"
dependencies = [
"cfg-if",
]
@@ -389,9 +389,9 @@ dependencies = [
[[package]]
name = "lzma-sys"
@ -78,17 +49,7 @@ index 4a0ba592577..e75b4dbd12e 100644
dependencies = [
"cc",
"libc",
"pkg-config",
]
[[package]]
name = "memchr"
@@ -785,19 +785,19 @@ version = "0.2.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6d1526bbe5aaeb5eb06885f4d987bcdfa5e23187055de9b83fe00156a821fabc"
dependencies = [
"libc",
]
@@ -847,9 +847,9 @@ dependencies = [
[[package]]
name = "xz2"
@ -100,21 +61,9 @@ index 4a0ba592577..e75b4dbd12e 100644
dependencies = [
"lzma-sys",
]
[[package]]
name = "yansi"
version = "0.5.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
diff --git a/src/bootstrap/Cargo.toml b/src/bootstrap/Cargo.toml
index 22ceeca941e..9131fa5c341 100644
--- a/src/bootstrap/Cargo.toml
+++ b/src/bootstrap/Cargo.toml
@@ -42,17 +42,17 @@ object = { version = "0.29.0", default-features = false, features = ["archive",
serde = { version = "1.0.8", features = ["derive"] }
serde_json = "1.0.2"
sha2 = "0.10"
tar = "0.4"
toml = "0.5"
@@ -51,7 +51,7 @@ toml = "0.5"
ignore = "0.4.10"
opener = "0.5"
once_cell = "1.7.2"
@ -123,11 +72,3 @@ index 22ceeca941e..9131fa5c341 100644
walkdir = "2"
# Dependencies needed by the build-metrics feature
sysinfo = { version = "0.26.0", optional = true }
[target.'cfg(windows)'.dependencies.winapi]
version = "0.3"
features = [
--
2.39.1

View file

@ -0,0 +1,35 @@
From 032857e7e403f654129c45dc7e6718a9ad49e377 Mon Sep 17 00:00:00 2001
From: Nikolay Arhipov <n@arhipov.net>
Date: Tue, 6 Jun 2023 16:09:05 +0300
Subject: [PATCH] Bumped libc version
---
Cargo.lock | 4 ++--
library/std/Cargo.toml | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -2933,9 +2933,9 @@ checksum = "830d08ce1d1d941e6b30645f1a0e
[[package]]
name = "libc"
-version = "0.2.140"
+version = "0.2.146"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "99227334921fae1a979cf0bfdfcc6b3e5ce376ef57e16fb6fb3ea2ed6095f80c"
+checksum = "f92be4933c13fd498862a9e02a3055f8a8d9c039ce33db97306fd5a6caa7f29b"
dependencies = [
"rustc-std-workspace-core",
]
--- a/library/std/Cargo.toml
+++ b/library/std/Cargo.toml
@@ -15,7 +15,7 @@ cfg-if = { version = "1.0", features = [
panic_unwind = { path = "../panic_unwind", optional = true }
panic_abort = { path = "../panic_abort" }
core = { path = "../core" }
-libc = { version = "0.2.140", default-features = false, features = ['rustc-dep-of-std'] }
+libc = { version = "0.2.146", default-features = false, features = ['rustc-dep-of-std'] }
compiler_builtins = { version = "0.1.91" }
profiler_builtins = { path = "../profiler_builtins", optional = true }
unwind = { path = "../unwind" }

View file

@ -16,7 +16,7 @@ endif
include $(RUST_INCLUDE_DIR)/rust-values.mk
# Support only a subset for now.
RUST_ARCH_DEPENDS:=@(aarch64||arm||i386||i686||mips||mipsel||mips64||mips64el||mipsel||powerpc64||x86_64)
RUST_ARCH_DEPENDS:=@(aarch64||arm||i386||i686||mips||mipsel||mips64||mips64el||mipsel||powerpc64||riscv64||x86_64)
# $(1) path to the package (optional)
# $(2) additional arguments to cargo (optional)

View file

@ -33,6 +33,8 @@ RUSTC_TARGET_ARCH:=$(subst muslgnueabi,musleabi,$(RUSTC_TARGET_ARCH))
ifeq ($(ARCH),i386)
RUSTC_TARGET_ARCH:=$(subst i486,i586,$(RUSTC_TARGET_ARCH))
else ifeq ($(ARCH),riscv64)
RUSTC_TARGET_ARCH:=$(subst riscv64,riscv64gc,$(RUSTC_TARGET_ARCH))
endif
# ARM Logic

View file

@ -6,13 +6,13 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=adguardhome
PKG_VERSION:=0.107.25
PKG_VERSION:=0.107.29
PKG_RELEASE:=1
PKG_SOURCE_PROTO:=git
PKG_SOURCE_VERSION:=v$(PKG_VERSION)
PKG_SOURCE_URL:=https://github.com/AdguardTeam/AdGuardHome
PKG_MIRROR_HASH:=609e991f0d03c1541e02fc656f8abea686e64ed350729b85ea87fe25640dd03a
PKG_MIRROR_HASH:=71fcd316171042fe328ca9764eca21d230e9549c32bac95db71414f54dc15379
PKG_LICENSE:=GPL-3.0-only
PKG_LICENSE_FILES:=LICENSE.txt

View file

@ -5,8 +5,8 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=banip
PKG_VERSION:=0.8.6
PKG_RELEASE:=2
PKG_VERSION:=0.8.7
PKG_RELEASE:=1
PKG_LICENSE:=GPL-3.0-or-later
PKG_MAINTAINER:=Dirk Brenken <dev@brenken.org>

View file

@ -65,10 +65,11 @@ IP address blocking is commonly used to protect against brute force attacks, pre
* Auto-add the uplink subnet or uplink IP to the local allowlist
* Provides a small background log monitor to ban unsuccessful login attempts in real-time
* Auto-add unsuccessful LuCI, nginx, Asterisk or ssh login attempts to the local blocklist
* Auto-add entire subnets to the blocklist Sets based on an additional RDAP request with the monitored suspicious IP
* Fast feed processing as they are handled in parallel as background jobs
* Per feed it can be defined whether the wan-input chain, the wan-forward chain or the lan-forward chain should be blocked (default: all chains)
* Automatic blocklist backup & restore, the backups will be used in case of download errors or during startup
* Automatically selects one of the following download utilities with ssl support: aria2c, curl, uclient-fetch or wget
* Automatically selects one of the following download utilities with ssl support: aria2c, curl, uclient-fetch or full wget
* Supports an 'allowlist only' mode, this option restricts internet access from/to a small number of secure websites/IPs
* Deduplicate IPs accross all Sets (single IPs only, no intervals)
* Provides comprehensive runtime information
@ -78,7 +79,7 @@ IP address blocking is commonly used to protect against brute force attacks, pre
* Minimal status & error logging to syslog, enable debug logging to receive more output
* Procd based init system support (start/stop/restart/reload/status/report/search/survey/lookup)
* Procd network interface trigger support
* Add new or edit existing banIP feeds on your own with the integrated custom feed editor
* Add new or edit existing banIP feeds on your own with the LuCI integrated custom feed editor
* Supports external allowlist URLs to reference additional IPv4/IPv6 feeds
## Prerequisites
@ -97,7 +98,7 @@ IP address blocking is commonly used to protect against brute force attacks, pre
* Install the LuCI companion package 'luci-app-banip' (opkg install luci-app-banip)
* It's strongly recommended to use the LuCI frontend to easily configure all aspects of banIP, the application is located in LuCI under the 'Services' menu
* If you're going to configure banIP via CLI, edit the config file '/etc/config/banip' and enable the service (set ban\_enabled to '1'), then add pre-configured feeds via 'ban\_feed' (see the feed list above) and add/change other options to your needs (see the options reference below)
* Start the service with '/etc/init.d/banip start' and check check everything is working by running '/etc/init.d/banip status'
* Start the service with '/etc/init.d/banip start' and check everything is working by running '/etc/init.d/banip status'
## banIP CLI interface
* All important banIP functions are accessible via CLI.
@ -140,6 +141,7 @@ Available commands:
| ban_logforwardlan | option | 0 | log rejects in the lan-forward chain |
| ban_autoallowlist | option | 1 | add wan IPs/subnets and resolved domains automatically to the local allowlist (not only to the Sets) |
| ban_autoblocklist | option | 1 | add suspicious attacker IPs and resolved domains automatically to the local blocklist (not only to the Sets) |
| ban_autoblocksubnet | option | 0 | add entire subnets to the blocklist Sets based on an additional RDAP request with the suspicious IP |
| ban_autoallowuplink | option | subnet | limit the uplink autoallow function to: 'subnet', 'ip' or 'disable' it at all |
| ban_allowlistonly | option | 0 | restrict the internet access from/to a small number of secure websites/IPs |
| ban_basedir | option | /tmp | base working directory while banIP processing |

View file

@ -20,8 +20,12 @@ ban_blocklist="/etc/banip/banip.blocklist"
ban_mailtemplate="/etc/banip/banip.tpl"
ban_pidfile="/var/run/banip.pid"
ban_rtfile="/var/run/banip_runtime.json"
ban_rdapfile="/var/run/banip_rdap.json"
ban_rdapurl="https://rdap.db.ripe.net/ip/"
ban_lock="/var/run/banip.lock"
ban_fetchcmd=""
ban_fetchparm=""
ban_rdapparm=""
ban_logreadcmd="$(command -v logread)"
ban_logcmd="$(command -v logger)"
ban_ubuscmd="$(command -v ubus)"
@ -33,12 +37,13 @@ ban_sedcmd="$(command -v sed)"
ban_catcmd="$(command -v cat)"
ban_zcatcmd="$(command -v zcat)"
ban_lookupcmd="$(command -v nslookup)"
ban_jsoncmd="$(command -v jsonfilter)"
ban_mailcmd="$(command -v msmtp)"
ban_mailsender="no-reply@banIP"
ban_mailreceiver=""
ban_mailtopic="banIP notification"
ban_mailprofile="ban_notify"
ban_mailnotifcation="0"
ban_mailnotification="0"
ban_reportelements="1"
ban_nftloglevel="warn"
ban_nftpriority="-200"
@ -57,6 +62,7 @@ ban_allowlistonly="0"
ban_autoallowlist="1"
ban_autoallowuplink="subnet"
ban_autoblocklist="1"
ban_autoblocksubnet="0"
ban_deduplicate="1"
ban_splitsize="0"
ban_autodetect="1"
@ -93,8 +99,8 @@ f_system() {
fi
ban_packages="$(${ban_ubuscmd} -S call rpc-sys packagelist '{ "all": true }' 2>/dev/null)"
ban_memory="$("${ban_awkcmd}" '/^MemAvailable/{printf "%s",int($2/1000)}' "/proc/meminfo" 2>/dev/null)"
ban_ver="$(printf "%s" "${ban_packages}" | jsonfilter -ql1 -e '@.packages.banip')"
ban_sysver="$(${ban_ubuscmd} -S call system board 2>/dev/null | jsonfilter -ql1 -e '@.model' -e '@.release.description' |
ban_ver="$(printf "%s" "${ban_packages}" | "${ban_jsoncmd}" -ql1 -e '@.packages.banip')"
ban_sysver="$("${ban_ubuscmd}" -S call system board 2>/dev/null | "${ban_jsoncmd}" -ql1 -e '@.model' -e '@.release.description' |
"${ban_awkcmd}" 'BEGIN{RS="";FS="\n"}{printf "%s, %s",$1,$2}')"
if [ -z "${ban_cores}" ]; then
cpu="$("${ban_grepcmd}" -c '^processor' /proc/cpuinfo 2>/dev/null)"
@ -236,6 +242,9 @@ f_conf() {
"ban_ifv6")
eval "${option}=\"$(printf "%s" "${ban_ifv6}")${value} \""
;;
"ban_trigger")
eval "${option}=\"$(printf "%s" "${ban_trigger}")${value} \""
;;
"ban_feed")
eval "${option}=\"$(printf "%s" "${ban_feed}")${value} \""
;;
@ -321,22 +330,26 @@ f_getfetch() {
"aria2c")
[ "${ban_fetchinsecure}" = "1" ] && insecure="--check-certificate=false"
ban_fetchparm="${ban_fetchparm:-"${insecure} --timeout=20 --retry-wait=10 --max-tries=${ban_fetchretry} --max-file-not-found=${ban_fetchretry} --allow-overwrite=true --auto-file-renaming=false --log-level=warn --dir=/ -o"}"
ban_rdapparm="--timeout=5 --allow-overwrite=true --auto-file-renaming=false --dir=/ -o"
;;
"curl")
[ "${ban_fetchinsecure}" = "1" ] && insecure="--insecure"
ban_fetchparm="${ban_fetchparm:-"${insecure} --connect-timeout 20 --retry-delay 10 --retry ${ban_fetchretry} --retry-all-errors --fail --silent --show-error --location -o"}"
ban_rdapparm="--connect-timeout 5 --silent --location -o"
;;
"uclient-fetch")
[ "${ban_fetchinsecure}" = "1" ] && insecure="--no-check-certificate"
ban_fetchparm="${ban_fetchparm:-"${insecure} --timeout=20 -O"}"
ban_rdapparm="--timeout=5 -O"
;;
"wget")
[ "${ban_fetchinsecure}" = "1" ] && insecure="--no-check-certificate"
ban_fetchparm="${ban_fetchparm:-"${insecure} --no-cache --no-cookies --timeout=20 --waitretry=10 --tries=${ban_fetchretry} --retry-connrefused --max-redirect=0 -O"}"
ban_fetchparm="${ban_fetchparm:-"${insecure} --no-cache --no-cookies --timeout=20 --waitretry=10 --tries=${ban_fetchretry} --retry-connrefused -O"}"
ban_rdapparm="--timeout=5 -O"
;;
esac
f_log "debug" "f_getfetch ::: auto/update: ${ban_autodetect}/${update}, cmd: ${ban_fetchcmd:-"-"}, parm: ${ban_fetchparm:-"-"}"
f_log "debug" "f_getfetch ::: auto/update: ${ban_autodetect}/${update}, cmd: ${ban_fetchcmd:-"-"}, fetch_parm: ${ban_fetchparm:-"-"}, rdap_parm: ${ban_rdapparm:-"-"}"
}
# get wan interfaces
@ -593,11 +606,11 @@ f_down() {
ruleset_raw="$("${ban_nftcmd}" -tj list ruleset 2>/dev/null)"
{
printf "%s\n" "flush set inet banIP ${feed}"
handle="$(printf "%s\n" "${ruleset_raw}" | jsonfilter -l1 -qe "@.nftables[@.rule.table=\"banIP\"&&@.rule.chain=\"wan-input\"][@.expr[0].match.right=\"@${feed}\"].handle")"
handle="$(printf "%s\n" "${ruleset_raw}" | "${ban_jsoncmd}" -ql1 -e "@.nftables[@.rule.table=\"banIP\"&&@.rule.chain=\"wan-input\"][@.expr[0].match.right=\"@${feed}\"].handle")"
[ -n "${handle}" ] && printf "%s\n" "delete rule inet banIP wan-input handle ${handle}"
handle="$(printf "%s\n" "${ruleset_raw}" | jsonfilter -l1 -qe "@.nftables[@.rule.table=\"banIP\"&&@.rule.chain=\"wan-forward\"][@.expr[0].match.right=\"@${feed}\"].handle")"
handle="$(printf "%s\n" "${ruleset_raw}" | "${ban_jsoncmd}" -ql1 -e "@.nftables[@.rule.table=\"banIP\"&&@.rule.chain=\"wan-forward\"][@.expr[0].match.right=\"@${feed}\"].handle")"
[ -n "${handle}" ] && printf "%s\n" "delete rule inet banIP wan-forward handle ${handle}"
handle="$(printf "%s\n" "${ruleset_raw}" | jsonfilter -l1 -qe "@.nftables[@.rule.table=\"banIP\"&&@.rule.chain=\"lan-forward\"][@.expr[0].match.right=\"@${feed}\"].handle")"
handle="$(printf "%s\n" "${ruleset_raw}" | "${ban_jsoncmd}" -ql1 -e "@.nftables[@.rule.table=\"banIP\"&&@.rule.chain=\"lan-forward\"][@.expr[0].match.right=\"@${feed}\"].handle")"
[ -n "${handle}" ] && printf "%s\n" "delete rule inet banIP lan-forward handle ${handle}"
} >"${tmp_flush}"
fi
@ -866,7 +879,7 @@ f_down() {
rm -f "${split_file}"
done
if [ "${ban_debug}" = "1" ] && [ "${ban_reportelements}" = "1" ]; then
cnt_set="$("${ban_nftcmd}" -j list set inet banIP "${feed}" 2>/dev/null | jsonfilter -qe '@.nftables[*].set.elem[*]' | wc -l 2>/dev/null)"
cnt_set="$("${ban_nftcmd}" -j list set inet banIP "${feed}" 2>/dev/null | "${ban_jsoncmd}" -qe '@.nftables[*].set.elem[*]' | wc -l 2>/dev/null)"
fi
fi
else
@ -916,7 +929,7 @@ f_rmset() {
json_get_keys feedlist
tmp_del="${ban_tmpfile}.final.delete"
ruleset_raw="$("${ban_nftcmd}" -tj list ruleset 2>/dev/null)"
table_sets="$(printf "%s\n" "${ruleset_raw}" | jsonfilter -qe '@.nftables[@.set.table="banIP"].set.name')"
table_sets="$(printf "%s\n" "${ruleset_raw}" | "${ban_jsoncmd}" -qe '@.nftables[@.set.table="banIP"].set.name')"
{
printf "%s\n\n" "#!/usr/sbin/nft -f"
for item in ${table_sets}; do
@ -925,11 +938,11 @@ f_rmset() {
del_set="${del_set}${item}, "
rm -f "${ban_backupdir}/banIP.${item}.gz"
printf "%s\n" "flush set inet banIP ${item}"
handle="$(printf "%s\n" "${ruleset_raw}" | jsonfilter -l1 -qe "@.nftables[@.rule.table=\"banIP\"&&@.rule.chain=\"wan-input\"][@.expr[0].match.right=\"@${item}\"].handle")"
handle="$(printf "%s\n" "${ruleset_raw}" | "${ban_jsoncmd}" -ql1 -e "@.nftables[@.rule.table=\"banIP\"&&@.rule.chain=\"wan-input\"][@.expr[0].match.right=\"@${item}\"].handle")"
[ -n "${handle}" ] && printf "%s\n" "delete rule inet banIP wan-input handle ${handle}"
handle="$(printf "%s\n" "${ruleset_raw}" | jsonfilter -l1 -qe "@.nftables[@.rule.table=\"banIP\"&&@.rule.chain=\"wan-forward\"][@.expr[0].match.right=\"@${item}\"].handle")"
handle="$(printf "%s\n" "${ruleset_raw}" | "${ban_jsoncmd}" -ql1 -e "@.nftables[@.rule.table=\"banIP\"&&@.rule.chain=\"wan-forward\"][@.expr[0].match.right=\"@${item}\"].handle")"
[ -n "${handle}" ] && printf "%s\n" "delete rule inet banIP wan-forward handle ${handle}"
handle="$(printf "%s\n" "${ruleset_raw}" | jsonfilter -l1 -qe "@.nftables[@.rule.table=\"banIP\"&&@.rule.chain=\"lan-forward\"][@.expr[0].match.right=\"@${item}\"].handle")"
handle="$(printf "%s\n" "${ruleset_raw}" | "${ban_jsoncmd}" -ql1 -e "@.nftables[@.rule.table=\"banIP\"&&@.rule.chain=\"lan-forward\"][@.expr[0].match.right=\"@${item}\"].handle")"
[ -n "${handle}" ] && printf "%s\n" "delete rule inet banIP lan-forward handle ${handle}"
printf "%s\n\n" "delete set inet banIP ${item}"
fi
@ -957,10 +970,10 @@ f_genstatus() {
ban_endtime="$(date "+%s")"
duration="$(((ban_endtime - ban_starttime) / 60))m $(((ban_endtime - ban_starttime) % 60))s"
fi
table_sets="$("${ban_nftcmd}" -tj list ruleset 2>/dev/null | jsonfilter -qe '@.nftables[@.set.table="banIP"].set.name')"
table_sets="$("${ban_nftcmd}" -tj list ruleset 2>/dev/null | "${ban_jsoncmd}" -qe '@.nftables[@.set.table="banIP"].set.name')"
if [ "${ban_reportelements}" = "1" ]; then
for item in ${table_sets}; do
cnt_elements="$((cnt_elements + $("${ban_nftcmd}" -j list set inet banIP "${item}" 2>/dev/null | jsonfilter -qe '@.nftables[*].set.elem[*]' | wc -l 2>/dev/null)))"
cnt_elements="$((cnt_elements + $("${ban_nftcmd}" -j list set inet banIP "${item}" 2>/dev/null | "${ban_jsoncmd}" -qe '@.nftables[*].set.elem[*]' | wc -l 2>/dev/null)))"
done
fi
runtime="action: ${ban_action:-"-"}, duration: ${duration:-"-"}, date: $(date "+%Y-%m-%d %H:%M:%S")"
@ -1132,7 +1145,7 @@ f_report() {
# json output preparation
#
ruleset_raw="$("${ban_nftcmd}" -tj list ruleset 2>/dev/null)"
table_sets="$(printf "%s" "${ruleset_raw}" | jsonfilter -qe '@.nftables[@.set.table="banIP"].set.name')"
table_sets="$(printf "%s" "${ruleset_raw}" | "${ban_jsoncmd}" -qe '@.nftables[@.set.table="banIP"].set.name')"
sum_sets="0"
sum_setinput="0"
sum_setforwardwan="0"
@ -1147,11 +1160,11 @@ f_report() {
printf "%s\n" "{"
printf "\t%s\n" '"sets":{'
for item in ${table_sets}; do
set_cntinput="$(printf "%s" "${ruleset_raw}" | jsonfilter -l1 -qe "@.nftables[@.rule.table=\"banIP\"&&@.rule.chain=\"wan-input\"][@.expr[0].match.right=\"@${item}\"].expr[*].counter.packets")"
set_cntforwardwan="$(printf "%s" "${ruleset_raw}" | jsonfilter -l1 -qe "@.nftables[@.rule.table=\"banIP\"&&@.rule.chain=\"wan-forward\"][@.expr[0].match.right=\"@${item}\"].expr[*].counter.packets")"
set_cntforwardlan="$(printf "%s" "${ruleset_raw}" | jsonfilter -l1 -qe "@.nftables[@.rule.table=\"banIP\"&&@.rule.chain=\"lan-forward\"][@.expr[0].match.right=\"@${item}\"].expr[*].counter.packets")"
set_cntinput="$(printf "%s" "${ruleset_raw}" | "${ban_jsoncmd}" -ql1 -e "@.nftables[@.rule.table=\"banIP\"&&@.rule.chain=\"wan-input\"][@.expr[0].match.right=\"@${item}\"].expr[*].counter.packets")"
set_cntforwardwan="$(printf "%s" "${ruleset_raw}" | "${ban_jsoncmd}" -ql1 -e "@.nftables[@.rule.table=\"banIP\"&&@.rule.chain=\"wan-forward\"][@.expr[0].match.right=\"@${item}\"].expr[*].counter.packets")"
set_cntforwardlan="$(printf "%s" "${ruleset_raw}" | "${ban_jsoncmd}" -ql1 -e "@.nftables[@.rule.table=\"banIP\"&&@.rule.chain=\"lan-forward\"][@.expr[0].match.right=\"@${item}\"].expr[*].counter.packets")"
if [ "${ban_reportelements}" = "1" ]; then
set_cnt="$("${ban_nftcmd}" -j list set inet banIP "${item}" 2>/dev/null | jsonfilter -qe '@.nftables[*].set.elem[*]' | wc -l 2>/dev/null)"
set_cnt="$("${ban_nftcmd}" -j list set inet banIP "${item}" 2>/dev/null | "${ban_jsoncmd}" -qe '@.nftables[*].set.elem[*]' | wc -l 2>/dev/null)"
sum_setelements="$((sum_setelements + set_cnt))"
else
set_cnt=""
@ -1295,7 +1308,7 @@ f_search() {
fi
fi
if [ -n "${proto}" ]; then
table_sets="$("${ban_nftcmd}" -tj list ruleset 2>/dev/null | jsonfilter -qe "@.nftables[@.set.table=\"banIP\"&&@.set.type=\"ip${proto}_addr\"].set.name")"
table_sets="$("${ban_nftcmd}" -tj list ruleset 2>/dev/null | "${ban_jsoncmd}" -qe "@.nftables[@.set.table=\"banIP\"&&@.set.type=\"ip${proto}_addr\"].set.name")"
else
printf "%s\n%s\n%s\n" ":::" "::: no valid search input" ":::"
return
@ -1332,7 +1345,7 @@ f_survey() {
printf "%s\n%s\n%s\n" ":::" "::: no valid survey input" ":::"
return
fi
set_elements="$("${ban_nftcmd}" -j list set inet banIP "${input}" 2>/dev/null | jsonfilter -qe '@.nftables[*].set.elem[*]')"
set_elements="$("${ban_nftcmd}" -j list set inet banIP "${input}" 2>/dev/null | "${ban_jsoncmd}" -qe '@.nftables[*].set.elem[*]')"
printf "%s\n%s\n%s\n" ":::" "::: banIP Survey" ":::"
printf " %s\n" "List of elements in the Set '${input}' on $(date "+%Y-%m-%d %H:%M:%S")"
printf " %s\n" "---"
@ -1366,7 +1379,7 @@ f_mail() {
# log monitor
#
f_monitor() {
local nft_expiry line proto ip log_raw log_count
local nft_expiry line proto ip log_raw log_count rdap_log rdap_rc rdap_elements rdap_info
if [ -x "${ban_logreadcmd}" ] && [ -n "${ban_logterm%%??}" ] && [ "${ban_loglimit}" != "0" ]; then
@ -1375,6 +1388,7 @@ f_monitor() {
"${ban_logreadcmd}" -fe "${ban_logterm%%??}" 2>/dev/null |
while read -r line; do
: >"{ban_rdapfile}"
proto=""
ip="$(printf "%s" "${line}" | "${ban_awkcmd}" 'BEGIN{RS="(([0-9]{1,3}\\.){3}[0-9]{1,3})+"}{if(!seen[RT]++)printf "%s ",RT}')"
ip="$(f_trim "${ip}")"
@ -1387,17 +1401,34 @@ f_monitor() {
[ -n "${ip}" ] && proto="v6"
fi
if [ -n "${proto}" ] && ! "${ban_nftcmd}" get element inet banIP blocklist"${proto}" "{ ${ip} }" >/dev/null 2>&1; then
f_log "info" "suspicious IP${proto} '${ip}'"
f_log "info" "suspicious IP '${ip}'"
log_raw="$("${ban_logreadcmd}" -l "${ban_loglimit}" 2>/dev/null)"
log_count="$(printf "%s\n" "${log_raw}" | "${ban_grepcmd}" -c "suspicious IP${proto} '${ip}'")"
log_count="$(printf "%s\n" "${log_raw}" | "${ban_grepcmd}" -c "suspicious IP '${ip}'")"
if [ "${log_count}" -ge "${ban_logcount}" ]; then
if "${ban_nftcmd}" add element inet banIP "blocklist${proto}" "{ ${ip} ${nft_expiry} }" >/dev/null 2>&1; then
f_log "info" "add IP${proto} '${ip}' (expiry: ${ban_nftexpiry:-"-"}) to blocklist${proto} set"
if [ -z "${ban_nftexpiry}" ] && [ "${ban_autoblocklist}" = "1" ] && ! "${ban_grepcmd}" -q "^${ip}" "${ban_blocklist}"; then
printf "%-42s%s\n" "${ip}" "# added on $(date "+%Y-%m-%d %H:%M:%S")" >>"${ban_blocklist}"
f_log "info" "add IP${proto} '${ip}' to local blocklist"
if [ "${ban_autoblocksubnet}" = "1" ]; then
rdap_log="$("${ban_fetchcmd}" ${ban_rdapparm} "${ban_rdapfile}" "${ban_rdapurl}${ip}" 2>&1)"
rdap_rc="${?}"
if [ "${rdap_rc}" = "0" ] && [ -s "${ban_rdapfile}" ]; then
rdap_elements="$(jsonfilter -i "${ban_rdapfile}" -qe '@.cidr0_cidrs.*' | awk 'BEGIN{FS="[\" ]"}{printf "%s/%s, ",$6,$11}')"
rdap_info="$(jsonfilter -i "${ban_rdapfile}" -qe '@.country' -qe '@.notices[@.title="Source"].description[1]' | awk 'BEGIN{RS="";FS="\n"}{printf "%s, %s",$1,$2}')"
if [ -n "${rdap_elements//\/*/}" ]; then
if "${ban_nftcmd}" add element inet banIP "blocklist${proto}" "{ ${rdap_elements%%??} ${nft_expiry} }" >/dev/null 2>&1; then
f_log "info" "add IP range '${rdap_elements%%??}' (source: ${rdap_info:-"-"} ::: expiry: ${ban_nftexpiry:-"-"}) to blocklist${proto} set"
fi
fi
else
f_log "info" "rdap request failed (rc: ${rdap_rc:-"-"}/log: ${rdap_log})"
fi
fi
if [ "${ban_autoblocksubnet}" = "0" ] || [ "${rdap_rc}" != "0" ] || [ ! -s "${ban_rdapfile}" ] || [ -z "${rdap_elements//\/*/}" ]; then
if "${ban_nftcmd}" add element inet banIP "blocklist${proto}" "{ ${ip} ${nft_expiry} }" >/dev/null 2>&1; then
f_log "info" "add IP '${ip}' (expiry: ${ban_nftexpiry:-"-"}) to blocklist${proto} set"
fi
fi
if [ -z "${ban_nftexpiry}" ] && [ "${ban_autoblocklist}" = "1" ] && ! "${ban_grepcmd}" -q "^${ip}" "${ban_blocklist}"; then
printf "%-42s%s\n" "${ip}" "# added on $(date "+%Y-%m-%d %H:%M:%S")" >>"${ban_blocklist}"
f_log "info" "add IP '${ip}' to local blocklist"
fi
fi
fi
done

View file

@ -8,12 +8,12 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=knot
PKG_VERSION:=3.2.6
PKG_VERSION:=3.2.7
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=https://secure.nic.cz/files/knot-dns/
PKG_HASH:=ac124fb17dbc4ac5310a30a396245a6ba304b3c89abed0f8a47d727462c8da4d
PKG_HASH:=d3b7872ac8aa80f7f54ddb1bb3b1e2f90ec55f7270a2c4a9338eab42b7d2767b
PKG_MAINTAINER:=Daniel Salzman <daniel.salzman@nic.cz>
PKG_LICENSE:=GPL-3.0 LGPL-2.0 0BSD BSD-3-Clause OLDAP-2.8

View file

@ -1,12 +1,12 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=pdns
PKG_VERSION:=4.7.4
PKG_VERSION:=4.8.0
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
PKG_SOURCE_URL:=https://downloads.powerdns.com/releases/
PKG_HASH:=7469dd81fb7df11197f49638fa49ceff9f973225fc8f9c7160b0bfc00a2e7471
PKG_HASH:=61a96bbaf8b0ca49a9225a2254b9443c4ff8e050d337437d85af4de889e10127
PKG_MAINTAINER:=Peter van Dijk <peter.van.dijk@powerdns.com>
PKG_LICENCE:=GPL-2.0-only

View file

@ -25,7 +25,7 @@
ixfrdist.example.yml
endif
@@ -1368,9 +1366,6 @@ dnspcap2protobuf_LDADD = \
@@ -1324,9 +1322,6 @@ dnspcap2protobuf_LDADD = \
$(BOOST_PROGRAM_OPTIONS_LIBS) \
$(RT_LIBS)

View file

@ -6,12 +6,12 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=snort3
PKG_VERSION:=3.1.62.0
PKG_VERSION:=3.1.63.0
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://github.com/snort3/snort3/archive/refs/tags/
PKG_HASH:=1f18936da65d52702f75e5b9ffe2cfbc9c9373201801ad275f6e636451f7e06f
PKG_HASH:=7ca415ac8098cd5ee001dc751966d4a6028961ca9cfc788447b7ea7048f53f85
PKG_MAINTAINER:=W. Michael Petullo <mike@flyn.org>
PKG_LICENSE:=GPL-2.0-only

66
net/speedtestcpp/Makefile Normal file
View file

@ -0,0 +1,66 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=speedtestcpp
PKG_VERSION:=1.20.2
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://codeload.github.com/oskarirauta/speedtestcpp/tar.gz/v$(PKG_VERSION)?
PKG_HASH:=7d5c85f1d9a46f7d8a3ac4261ef1f92e53c511430bae096f7ec6f12a33d38904
PKG_MAINTAINER:=Oskari Rauta <oskari.rauta@gmail.com>
PKG_LICENSE:=MIT
PKG_LICENSE_FILES:=LICENSE
include $(INCLUDE_DIR)/package.mk
define Package/libspeedtestcpp
SECTION:=libs
CATEGORY:=Libraries
TITLE:=library for ookla's speedtest
DEPENDS:=+libcurl +libstdcpp
URL:=https://github.com/oskarirauta/speedtestcpp
endef
define Package/libspeedtestcpp/description
Shared library that provides support for ookla's speedtest
endef
define Package/speedtestcpp
SECTION:=net
CATEGORY:=Network
TITLE:=SpeedTest++
DEPENDS:=+libspeedtestcpp +libstdcpp
URL:=https://github.com/oskarirauta/speedtestcpp
PROVIDES:=speedtestpp
endef
define Package/speedtestcpp/description
Yet another unofficial speedtest.net client cli interface
forked from taganaka's SpeedTest with few improments and
lesser depends.
endef
TARGET_CXXFLAGS += --std=c++23 -fPIC
define Build/Configure
endef
define Package/libspeedtestcpp/install
$(INSTALL_DIR) $(1)/usr/lib
$(CP) $(PKG_BUILD_DIR)/libspeedtestcpp.so* $(1)/usr/lib/
endef
define Package/speedtestcpp/install
$(INSTALL_DIR) $(1)/usr/bin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/speedtest $(1)/usr/bin/
endef
define Build/InstallDev
$(INSTALL_DIR) $(1)/usr/lib $(1)/usr/include/speedtest
$(CP) $(PKG_BUILD_DIR)/libspeedtestcpp.{so*,a} $(1)/usr/lib/
$(CP) $(PKG_BUILD_DIR)/include/speedtest/*.hpp $(1)/usr/include/speedtest/
endef
$(eval $(call BuildPackage,libspeedtestcpp))
$(eval $(call BuildPackage,speedtestcpp))

View file

@ -1,42 +0,0 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=speedtestpp
PKG_VERSION:=1.14
PKG_RELEASE:=2
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://github.com/taganaka/SpeedTest.git
PKG_SOURCE_DATE:=2021-12-06
PKG_SOURCE_VERSION:=0f63cfbf7ce8d64ea803bf143b957eae76323405
PKG_MIRROR_HASH:=4221584dc3e1e31f2560ef347298a2bcca3ac2331049970b7bd7d742e4e1825f
PKG_MAINTAINER:=Oskari Rauta <oskari.rauta@gmail.com>
PKG_LICENSE:=MIT
CMAKE_INSTALL:=1
include $(INCLUDE_DIR)/package.mk
include $(INCLUDE_DIR)/nls.mk
include $(INCLUDE_DIR)/cmake.mk
CMAKE_OPTIONS += -DCMAKE_BUILD_TYPE=Release .
define Package/speedtestpp
SECTION:=net
CATEGORY:=Network
TITLE:=speedtest++
DEPENDS:=+libcurl +libopenssl +libstdcpp $(ICONV_DEPENDS)
CONFLICTS:=python3-speedtest-cli
URL:=https://github.com/taganaka/SpeedTest
endef
define Package/speedtestpp/description
Yet another unofficial speedtest.net client cli interface
endef
define Package/speedtestpp/install
$(INSTALL_DIR) $(1)/usr/bin
$(CP) $(PKG_INSTALL_DIR)/usr/bin/SpeedTest $(1)/usr/bin/speedtest
endef
$(eval $(call BuildPackage,speedtestpp))

View file

@ -1,239 +0,0 @@
From b7db370449cfe2b453c22b74a660701f78bd7ce3 Mon Sep 17 00:00:00 2001
From: Anatolii Lapytskyi <ala@allunite.com>
Date: Tue, 6 Sep 2022 15:59:27 +0200
Subject: [PATCH] Remove dependency on libxml2
---
CMakeLists.txt | 5 +-
README.md | 5 +-
SpeedTest.cpp | 136 ++++++++++++++-----------------------------------
SpeedTest.h | 2 -
4 files changed, 41 insertions(+), 107 deletions(-)
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -44,7 +44,6 @@ add_executable(SpeedTest ${SOURCE_FILES}
INCLUDE (CheckIncludeFiles)
find_package(CURL REQUIRED)
-find_package(LibXml2 REQUIRED)
if (NOT (APPLE))
find_package(OpenSSL REQUIRED)
@@ -52,7 +51,7 @@ else()
CHECK_INCLUDE_FILES("CommonCrypto/CommonDigest.h" HAVE_COMMON_DIGEST_H)
endif()
-include_directories(${CURL_INCLUDE_DIRS} ${LIBXML2_INCLUDE_DIR})
-target_link_libraries(SpeedTest ${CURL_LIBRARIES} ${LIBXML2_LIBRARIES} -lpthread ${OPENSSL_LIBRARIES})
+include_directories(${CURL_INCLUDE_DIRS})
+target_link_libraries(SpeedTest ${CURL_LIBRARIES} -lpthread ${OPENSSL_LIBRARIES})
install(TARGETS SpeedTest RUNTIME DESTINATION bin)
--- a/README.md
+++ b/README.md
@@ -26,7 +26,6 @@ It supports the new (undocumented) raw T
2. cmake
3. libcurl
4. libssl
-5. libxml2
### On Mac OS X
@@ -40,7 +39,7 @@ $ make install
### On Ubuntu/Debian
```
-$ sudo apt-get install build-essential libcurl4-openssl-dev libxml2-dev libssl-dev cmake
+$ sudo apt-get install build-essential libcurl4-openssl-dev libssl-dev cmake
$ git clone https://github.com/taganaka/SpeedTest
$ cd SpeedTest
$ cmake -DCMAKE_BUILD_TYPE=Release .
@@ -50,7 +49,7 @@ $ sudo make install
### On OpenSuse
```
-$ sudo zypper install cmake gcc-c++ libcurl-devel libxml2-devel libopenssl-devel git
+$ sudo zypper install cmake gcc-c++ libcurl-devel libopenssl-devel git
$ git clone https://github.com/taganaka/SpeedTest
$ cd SpeedTest
$ cmake -DCMAKE_BUILD_TYPE=Release .
--- a/SpeedTest.cpp
+++ b/SpeedTest.cpp
@@ -353,67 +353,16 @@ std::vector<std::string> SpeedTest::spli
}
-ServerInfo SpeedTest::processServerXMLNode(xmlTextReaderPtr reader) {
-
- auto name = xmlTextReaderConstName(reader);
- auto nodeName = std::string((char*)name);
-
- if (!name || nodeName != "server"){
- return ServerInfo();
- }
-
- if (xmlTextReaderAttributeCount(reader) > 0){
- auto info = ServerInfo();
- auto server_url = xmlTextReaderGetAttribute(reader, BAD_CAST "url");
- auto server_lat = xmlTextReaderGetAttribute(reader, BAD_CAST "lat");
- auto server_lon = xmlTextReaderGetAttribute(reader, BAD_CAST "lon");
- auto server_name = xmlTextReaderGetAttribute(reader, BAD_CAST "name");
- auto server_county = xmlTextReaderGetAttribute(reader, BAD_CAST "country");
- auto server_cc = xmlTextReaderGetAttribute(reader, BAD_CAST "cc");
- auto server_host = xmlTextReaderGetAttribute(reader, BAD_CAST "host");
- auto server_id = xmlTextReaderGetAttribute(reader, BAD_CAST "id");
- auto server_sponsor = xmlTextReaderGetAttribute(reader, BAD_CAST "sponsor");
-
- if (server_name)
- info.name.append((char*)server_name);
-
- if (server_url)
- info.url.append((char*)server_url);
-
- if (server_county)
- info.country.append((char*)server_county);
-
- if (server_cc)
- info.country_code.append((char*)server_cc);
-
- if (server_host)
- info.host.append((char*)server_host);
-
- if (server_sponsor)
- info.sponsor.append((char*)server_sponsor);
-
- if (server_id)
- info.id = std::atoi((char*)server_id);
-
- if (server_lat)
- info.lat = std::stof((char*)server_lat);
-
- if (server_lon)
- info.lon = std::stof((char*)server_lon);
-
- xmlFree(server_url);
- xmlFree(server_lat);
- xmlFree(server_lon);
- xmlFree(server_name);
- xmlFree(server_county);
- xmlFree(server_cc);
- xmlFree(server_host);
- xmlFree(server_id);
- xmlFree(server_sponsor);
- return info;
- }
-
- return ServerInfo();
+std::string getAttributeValue(const std::string& data, const size_t offset, const size_t max_pos, const std::string& attribute_name) {
+ size_t pos = data.find(attribute_name + "=\"", offset);
+ if (pos == std::string::npos)
+ return "";
+ if (pos >= max_pos)
+ return "";
+ size_t value_pos = pos + attribute_name.length() + 2;
+ size_t end = data.find("\"", value_pos);
+ std::string s = data.substr(pos + attribute_name.length() + 2, end - value_pos);
+ return s;
}
bool SpeedTest::fetchServers(const std::string& url, std::vector<ServerInfo>& target, int &http_code) {
@@ -441,53 +390,42 @@ bool SpeedTest::fetchServers(const std::
http_code = 200;
}
- size_t len = oss.str().length();
- auto *xmlbuff = (char*)calloc(len + 1, sizeof(char));
- if (!xmlbuff){
- std::cerr << "Unable to calloc" << std::endl;
+ IPInfo ipInfo;
+ if (!SpeedTest::ipInfo(ipInfo)){
curl_easy_cleanup(curl);
+ std::cerr << "OOPS!" <<std::endl;
return false;
}
- memcpy(xmlbuff, oss.str().c_str(), len);
- oss.str("");
- xmlTextReaderPtr reader = xmlReaderForMemory(xmlbuff, static_cast<int>(len), nullptr, nullptr, 0);
+ std::string data = oss.str();
- if (reader != nullptr) {
- IPInfo ipInfo;
- if (!SpeedTest::ipInfo(ipInfo)){
- curl_easy_cleanup(curl);
- free(xmlbuff);
- xmlFreeTextReader(reader);
- std::cerr << "OOPS!" <<std::endl;
- return false;
- }
- auto ret = xmlTextReaderRead(reader);
- while (ret == 1) {
- ServerInfo info = processServerXMLNode(reader);
- if (!info.url.empty()){
- info.distance = harversine(std::make_pair(ipInfo.lat, ipInfo.lon), std::make_pair(info.lat, info.lon));
- target.push_back(info);
- }
- ret = xmlTextReaderRead(reader);
- }
- xmlFreeTextReader(reader);
- if (ret != 0) {
- curl_easy_cleanup(curl);
- free(xmlbuff);
- std::cerr << "Failed to parse" << std::endl;
- return false;
+ const std::string server_tag_start = "<server ";
+
+ size_t server_tag_begin = data.find(server_tag_start);
+ while (server_tag_begin != std::string::npos) {
+ size_t server_tag_end = data.find("/>", server_tag_begin);
+
+ auto info = ServerInfo();
+ info.name = getAttributeValue(data, server_tag_begin, server_tag_end, "name");
+ info.url = getAttributeValue(data, server_tag_begin, server_tag_end, "url");
+ info.country = getAttributeValue(data, server_tag_begin, server_tag_end, "country");
+ info.country_code = getAttributeValue(data, server_tag_begin, server_tag_end, "cc");
+ info.host = getAttributeValue(data, server_tag_begin, server_tag_end, "host");
+ info.sponsor = getAttributeValue(data, server_tag_begin, server_tag_end, "sponsor");
+ info.id = atoi(getAttributeValue(data, server_tag_begin, server_tag_end, "id").c_str());
+ info.lat = std::stof(getAttributeValue(data, server_tag_begin, server_tag_end, "lat"));
+ info.lon = std::stof(getAttributeValue(data, server_tag_begin, server_tag_end, "lon"));
+
+ if (!info.url.empty()){
+ info.distance = harversine(std::make_pair(ipInfo.lat, ipInfo.lon), std::make_pair(info.lat, info.lon));
+ target.push_back(info);
}
- } else {
- std::cerr << "Unable to initialize xml parser" << std::endl;
- curl_easy_cleanup(curl);
- free(xmlbuff);
- return false;
+
+ server_tag_begin = data.find(server_tag_start, server_tag_begin + 1);
}
+
curl_easy_cleanup(curl);
- free(xmlbuff);
- xmlCleanupParser();
std::sort(target.begin(), target.end(), [](const ServerInfo &a, const ServerInfo &b) -> bool {
return a.distance < b.distance;
});
--- a/SpeedTest.h
+++ b/SpeedTest.h
@@ -7,7 +7,6 @@
#include "SpeedTestConfig.h"
#include "SpeedTestClient.h"
-#include <libxml/xmlreader.h>
#include <functional>
#include <cmath>
#include <curl/curl.h>
@@ -50,7 +49,6 @@ private:
const ServerInfo findBestServerWithin(const std::vector<ServerInfo>& serverList, long& latency, int sample_size = 5, std::function<void(bool)> cb = nullptr);
static CURL* curl_setup(CURL* curl = nullptr);
static size_t writeFunc(void* buf, size_t size, size_t nmemb, void* userp);
- static ServerInfo processServerXMLNode(xmlTextReaderPtr reader);
double execute(const ServerInfo &server, const TestConfig &config, const opFn &fnc, std::function<void(bool)> cb = nullptr);
template <typename T>
static T deg2rad(T n);

View file

@ -6,7 +6,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=gawk
PKG_VERSION:=5.2.1
PKG_RELEASE:=1
PKG_RELEASE:=2
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=@GNU/gawk
@ -29,6 +29,8 @@ define Package/gawk
DEPENDS:=+libncursesw +libreadline
endef
CONFIGURE_ARGS+= --disable-mpfr
define Package/gawk/install
$(INSTALL_DIR) $(1)/usr/bin
$(CP) $(PKG_INSTALL_DIR)/usr/bin/gawk $(1)/usr/bin/

View file

@ -8,12 +8,12 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=tree
PKG_VERSION:=2.1.0
PKG_VERSION:=2.1.1
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://codeload.github.com/Old-Man-Programmer/$(PKG_NAME)/tar.gz/$(PKG_VERSION)?
PKG_HASH:=e9da64f6bbf894840b76d5fb2d37282076febbc96076fc4e833b08fe42190ad2
PKG_HASH:=1b70253994dca48a59d6ed99390132f4d55c486bf0658468f8520e7e63666a06
PKG_MAINTAINER:=Banglang Huang <banglang.huang@foxmail.com>