🍕 Sync 2025-11-10 00:09:51

This commit is contained in:
actions-user
2025-11-10 00:09:51 +08:00
parent 8bc21f4bc5
commit 2f6d17f5dc
25 changed files with 2264 additions and 440 deletions

View File

@@ -1,7 +1,7 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=bandix
PKG_VERSION:=0.6.1
PKG_VERSION:=0.8.1
PKG_RELEASE:=1
PKG_LICENSE:=Apache-2.0
@@ -13,7 +13,7 @@ include $(INCLUDE_DIR)/package.mk
include $(TOPDIR)/feeds/packages/lang/rust/rust-values.mk
# 二进制文件的文件名和URL
RUST_BANDIX_VERSION:=0.6.1
RUST_BANDIX_VERSION:=0.8.1
RUST_BINARY_FILENAME:=bandix-$(RUST_BANDIX_VERSION)-$(RUSTC_TARGET_ARCH).tar.gz

View File

@@ -20,3 +20,8 @@ config bandix 'traffic'
config bandix 'connections'
option enabled '0'
config bandix 'dns'
option enabled '0'
option dns_max_records '10000'

View File

@@ -21,6 +21,8 @@ start_service() {
local traffic_flush_interval_seconds
local traffic_persist_history
local connections_enabled
local dns_enabled
local dns_max_records
config_load 'bandix'
config_get iface 'general' 'iface'
@@ -31,8 +33,10 @@ start_service() {
config_get traffic_flush_interval_seconds 'traffic' 'traffic_flush_interval_seconds'
config_get_bool traffic_persist_history 'traffic' 'traffic_persist_history'
config_get_bool connections_enabled 'connections' 'enabled'
config_get_bool dns_enabled 'dns' 'enabled'
config_get dns_max_records 'dns' 'dns_max_records'
[ "$connections_enabled" != 1 ] && [ "$traffic_enabled" != 1 ] && return 1
[ "$connections_enabled" != 1 ] && [ "$traffic_enabled" != 1 ] && [ "$dns_enabled" != 1 ] && return 1
# 构建基础命令行参数
local args="--iface $iface --port $port --data-dir $data_dir"
@@ -56,6 +60,14 @@ start_service() {
args="$args --enable-connection"
fi
# 添加 DNS 监控参数
if [ "$dns_enabled" -eq 1 ]; then
args="$args --enable-dns"
fi
if [ -n "$dns_max_records" ]; then
args="$args --dns-max-records $dns_max_records"
fi
procd_open_instance bandix
procd_set_param command $PROG $args
procd_set_param respawn ${respawn_threshold:-3600} ${respawn_timeout:-5} ${respawn_retry:-5}