Skip to content

Commit

Permalink
Merge Official Source
Browse files Browse the repository at this point in the history
Signed-off-by: Tianling Shen <[email protected]>
  • Loading branch information
1715173329 committed Sep 21, 2024
2 parents 5d93d58 + b5ed85f commit d49c670
Show file tree
Hide file tree
Showing 13 changed files with 36 additions and 172 deletions.
2 changes: 1 addition & 1 deletion net/adblock-fast/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ include $(TOPDIR)/rules.mk

PKG_NAME:=adblock-fast
PKG_VERSION:=1.1.2
PKG_RELEASE:=3
PKG_RELEASE:=5
PKG_MAINTAINER:=Stan Grishin <[email protected]>
PKG_LICENSE:=AGPL-3.0-or-later

Expand Down
19 changes: 12 additions & 7 deletions net/adblock-fast/files/etc/init.d/adblock-fast
Original file line number Diff line number Diff line change
Expand Up @@ -364,6 +364,7 @@ is_running() {
fi
}
ipset() { "$ipset" "$@" >/dev/null 2>&1; }
get_ram_available() { ubus call system info | jsonfilter -e '@.memory.available'; }
get_ram_free() { ubus call system info | jsonfilter -e '@.memory.free'; }
get_ram_total() { ubus call system info | jsonfilter -e '@.memory.total'; }
led_on(){ if [ -n "${1}" ] && [ -e "${1}/trigger" ]; then echo 'default-on' > "${1}/trigger" 2>&1; fi; }
Expand Down Expand Up @@ -1067,7 +1068,7 @@ cache() {
;;
create_gzip)
rm -f "$outputGzip" >/dev/null 2>/dev/null
R_TMP="$(mktemp -u -q -t ${packageName}_tmp.XXXXXXXX)"
R_TMP="$(mktemp -u -q -t "${packageName}_tmp.XXXXXXXX")"
if gzip < "$outputFile" > "$R_TMP"; then
if mv "$R_TMP" "$outputGzip"; then
rm -f "$R_TMP"
Expand Down Expand Up @@ -1130,7 +1131,7 @@ process_file_url() {
return 0
fi
while [ -z "$R_TMP" ] || [ -e "$R_TMP" ]; do
R_TMP="$(mktemp -u -q -t ${packageName}_tmp.XXXXXXXX)"
R_TMP="$(mktemp -u -q -t "${packageName}_tmp.XXXXXXXX")"
done
if [ -z "$url" ] || ! $dl_command "$url" "$dl_flag" "$R_TMP" 2>/dev/null || \
[ ! -s "$R_TMP" ]; then
Expand All @@ -1141,7 +1142,7 @@ process_file_url() {
append_newline "$R_TMP"
[ -n "$cfg" ] && new_size="$(get_local_filesize "$R_TMP")"
if [ -n "$new_size" ] && [ "$size" != "$new_size" ]; then
uci_set "$packageName" "$cfg" 'size' "$size"
uci_set "$packageName" "$cfg" 'size' "$new_size"
fi
format="$(detect_file_type "$R_TMP")"
case "$format" in
Expand Down Expand Up @@ -1182,7 +1183,7 @@ download_dnsmasq_file() {
json set status 'statusDownloading'

rm -f "$A_TMP" "$B_TMP" "$SED_TMP" "$outputFile" "$outputCache" "$outputGzip"
if [ "$(get_ram_free)" -lt 32 ]; then
if [ "$(get_ram_available)" -lt 32 ]; then
output 3 'Low free memory, restarting resolver '
if resolver 'quiet_restart'; then
output_okn
Expand Down Expand Up @@ -1211,6 +1212,7 @@ download_dnsmasq_file() {
}

download_lists() {
# shellcheck disable=SC2317
_ram_check() {
_config_calculate_sizes() {
local cfg="$1"
Expand All @@ -1223,7 +1225,7 @@ download_lists() {
[ -n "$size" ] && total_sizes=$((total_sizes+size))
}
local i free_mem total_sizes
free_mem="$(get_ram_free)"
free_mem="$(get_ram_available)"
if [ -z "$free_mem" ]; then
json add warnning 'warningFreeRamCheckFail'
output "${_WARNING_}: $(get_text 'warningFreeRamCheckFail')!\\n"
Expand Down Expand Up @@ -1623,6 +1625,7 @@ adb_check() {
}

adb_check_lists() {
# shellcheck disable=SC2317
_check_list() {
local cfg="$1"
local en size url R_TMP string c
Expand All @@ -1635,7 +1638,7 @@ adb_check_lists() {
output "[DL] $url $__FAIL__\\n"
fi
while [ -z "$R_TMP" ] || [ -e "$R_TMP" ]; do
R_TMP="$(mktemp -u -q -t ${packageName}_tmp.XXXXXXXX)"
R_TMP="$(mktemp -u -q -t "${packageName}_tmp.XXXXXXXX")"
done
if [ -z "$url" ] || ! $dl_command "$url" "$dl_flag" "$R_TMP" 2>/dev/null || \
[ ! -s "$R_TMP" ]; then
Expand Down Expand Up @@ -1671,6 +1674,7 @@ adb_check_lists() {
}

adb_config_update() {
# shellcheck disable=SC2317
_cleanup_missing_urls() {
local cfg="$1" url size
config_get url "$cfg" url
Expand All @@ -1695,7 +1699,7 @@ adb_config_update() {
fi
output 1 'Updating config '
while [ -z "$R_TMP" ] || [ -e "$R_TMP" ]; do
R_TMP="$(mktemp -u -q -t ${packageName}_tmp.XXXXXXXX)"
R_TMP="$(mktemp -u -q -t "${packageName}_tmp.XXXXXXXX")"
done
if ! $dl_command "$config_update_url" "$dl_flag" "$R_TMP" 2>/dev/null || [ ! -s "$R_TMP" ]; then
append_newline "$R_TMP"
Expand Down Expand Up @@ -1726,6 +1730,7 @@ adb_show_blocklist() {
}

adb_sizes() {
# shellcheck disable=SC2317
_config_add_url_size() {
local cfg="$1" url name size
config_get url "$cfg" url
Expand Down
2 changes: 1 addition & 1 deletion net/adblock/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ include $(TOPDIR)/rules.mk

PKG_NAME:=adblock
PKG_VERSION:=4.2.2
PKG_RELEASE:=3
PKG_RELEASE:=5
PKG_LICENSE:=GPL-3.0-or-later
PKG_MAINTAINER:=Dirk Brenken <[email protected]>

Expand Down
13 changes: 8 additions & 5 deletions net/adblock/files/adblock.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
export LC_ALL=C
export PATH="/usr/sbin:/usr/bin:/sbin:/bin"

adb_ver="4.2.2-r3"
adb_ver="4.2.2-r5"
adb_enabled="0"
adb_debug="0"
adb_forcedns="0"
Expand Down Expand Up @@ -128,6 +128,7 @@ f_load() {
done
unset bg_pid
fi
rm -f "${adb_reportdir}"/adb_report.pcap*
fi

if [ -x "${adb_dumpcmd}" ] && [ "${adb_report}" = "1" ] && [ -z "${bg_pid}" ] && [ "${adb_action}" != "report" ] && [ "${adb_action}" != "stop" ]; then
Expand Down Expand Up @@ -1328,17 +1329,19 @@ f_report() {
if(type=="."&&$(NF-2)!="CNAME")
{domain=substr($(NF-1),1,length($(NF-1))-1);type="RQ"}
else
{if($(NF-1)~/[0-9]\/[0-9]\/[0-9]/||$(NF-1)=="0.0.0.0"){type="NX"}else{type="OK"};domain=""};
printf "%08d\t%s\t%s\t%s\t%-25s\t%s\n",$9,type,$1,substr($2,1,8),$6,domain}' >>"${report_raw}"
{if($(NF-2)~/NXDomain/||$(NF-1)=="0.0.0.0"){type="NX"}else{type="OK"};domain=""};
if(int($9)>0)
printf "%08d\t%s\t%s\t%s\t%-25s\t%s\n",$9,type,$1,substr($2,1,8),$6,domain}' >>"${report_raw}"
else
"${adb_dumpcmd}" "${resolve}" --immediate-mode -T domain -tttt -r "${file}" 2>/dev/null |
"${adb_awkcmd}" -v cnt="${cnt}" '!/\.lan\. |PTR\? | SOA\? | Flags /&&/ A[A]*\? |NXDomain|0\.0\.0\.0|[0-9]\/[0-9]\/[0-9]/{sub(/\.[0-9]+$/,"",$4);
type=substr($(NF-1),length($(NF-1)));
if(type=="."&&$(NF-2)!="CNAME")
{domain=substr($(NF-1),1,length($(NF-1))-1);type="RQ"}
else
{if($(NF-1)~/[0-9]\/[0-9]\/[0-9]/||$(NF-1)=="0.0.0.0"){type="NX"}else{type="OK"};domain=""};
printf "%08d\t%s\t%s\t%s\t%-25s\t%s\n",$7,type,$1,substr($2,1,8),$4,domain}' >>"${report_raw}"
{if($(NF-2)~/NXDomain/||$(NF-1)=="0.0.0.0"){type="NX"}else{type="OK"};domain=""};
if(int($7)>0)
printf "%08d\t%s\t%s\t%s\t%-25s\t%s\n",$7,type,$1,substr($2,1,8),$4,domain}' >>"${report_raw}"
fi
) &
hold="$((cnt % adb_cores))"
Expand Down
2 changes: 1 addition & 1 deletion net/banip/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ include $(TOPDIR)/rules.mk

PKG_NAME:=banip
PKG_VERSION:=1.0.0
PKG_RELEASE:=6
PKG_RELEASE:=7
PKG_LICENSE:=GPL-3.0-or-later
PKG_MAINTAINER:=Dirk Brenken <[email protected]>

Expand Down
1 change: 0 additions & 1 deletion net/banip/files/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ IP address blocking is commonly used to protect against brute force attacks, pre
| doh | public DoH-Provider | | | x | tcp: 80, 443 | [Link](https://github.com/dibdot/DoH-IP-blocklists) |
| drop | spamhaus drop compilation | x | x | | | [Link](https://www.spamhaus.org) |
| dshield | dshield IP blocklist | x | x | | | [Link](https://www.dshield.org) |
| edrop | spamhaus edrop compilation | x | x | | | [Link](https://www.spamhaus.org) |
| etcompromised | ET compromised hosts | x | x | | | [Link](https://iplists.firehol.org/?ipset=et_compromised) |
| feodo | feodo tracker | x | x | | | [Link](https://feodotracker.abuse.ch) |
| firehol1 | firehol level 1 compilation | x | x | | | [Link](https://iplists.firehol.org/?ipset=firehol_level1) |
Expand Down
8 changes: 4 additions & 4 deletions net/banip/files/banip-functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -527,7 +527,7 @@ f_getuplink() {
if [ "${update}" = "0" ]; then
"${ban_sedcmd}" -i "/# uplink added on /d" "${ban_allowlist}"
fi
printf "%-42s%s\n" "${ip}" "# uplink added on $(date "+%Y-%m-%d %H:%M:%S")" >>"${ban_allowlist}"
printf "%-45s%s\n" "${ip}" "# uplink added on $(date "+%Y-%m-%d %H:%M:%S")" >>"${ban_allowlist}"
f_log "info" "add uplink '${ip}' to local allowlist"
update="1"
fi
Expand Down Expand Up @@ -1326,9 +1326,9 @@ f_lookup() {
else
[ "${ip##*:}" = "${ip}" ] && elementsv4="${elementsv4} ${ip}," || elementsv6="${elementsv6} ${ip},"
if [ "${feed}" = "allowlist" ] && [ "${ban_autoallowlist}" = "1" ] && ! "${ban_grepcmd}" -q "^${ip}[[:space:]]*#" "${ban_allowlist}"; then
printf "%-42s%s\n" "${ip}" "# '${domain}' added on $(date "+%Y-%m-%d %H:%M:%S")" >>"${ban_allowlist}"
printf "%-45s%s\n" "${ip}" "# '${domain}' added on $(date "+%Y-%m-%d %H:%M:%S")" >>"${ban_allowlist}"
elif [ "${feed}" = "blocklist" ] && [ "${ban_autoblocklist}" = "1" ] && ! "${ban_grepcmd}" -q "^${ip}[[:space:]]*#" "${ban_blocklist}"; then
printf "%-42s%s\n" "${ip}" "# '${domain}' added on $(date "+%Y-%m-%d %H:%M:%S")" >>"${ban_blocklist}"
printf "%-45s%s\n" "${ip}" "# '${domain}' added on $(date "+%Y-%m-%d %H:%M:%S")" >>"${ban_blocklist}"
fi
cnt_ip="$((cnt_ip + 1))"
fi
Expand Down Expand Up @@ -1714,7 +1714,7 @@ f_monitor() {
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}"
printf "%-45s%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
Expand Down
10 changes: 5 additions & 5 deletions net/softflowd/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@
include $(TOPDIR)/rules.mk

PKG_NAME:=softflowd
PKG_VERSION:=1.0.0
PKG_RELEASE:=5
PKG_VERSION:=1.1.0
PKG_RELEASE:=2

PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://codeload.github.com/irino/softflowd/tar.gz/softflowd-$(PKG_VERSION)?
PKG_HASH:=98aa66026d730211b45fe89670cd6ce50959846d536880b82f5afbca6281e108
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-softflowd-$(PKG_VERSION)
PKG_SOURCE_URL:=https://codeload.github.com/irino/softflowd/tar.gz/softflowd-v$(PKG_VERSION)?
PKG_HASH:=68d36a21895d0b155b27c718c4b79cc304a4de92d591d73887ccfd74f90f4ffc
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_NAME)-v$(PKG_VERSION)

PKG_MAINTAINER:=Ross Vandegrift <[email protected]>
PKG_LICENSE:=BSD-3-Clause
Expand Down
1 change: 1 addition & 0 deletions net/softflowd/files/softflowd.config
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,6 @@ config softflowd
option hoplimit ''
option tracking_level 'full'
option track_ipv6 '0'
option bidirectional '0'
option sampling_rate '100'
option filter ''
1 change: 1 addition & 0 deletions net/softflowd/files/softflowd.init
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ start_instance() {
append_string "$section" 'tracking_level' '-T'
append_string "$section" 'sampling_rate' '-s'
append_bool "$section" track_ipv6 '-6'
append_bool "$section" bidirectional '-b'

procd_open_instance
procd_set_param command /usr/sbin/softflowd -d $args${pid_file:+ -p $pid_file} "$filter"
Expand Down
134 changes: 0 additions & 134 deletions net/softflowd/patches/010-bzero.patch

This file was deleted.

11 changes: 0 additions & 11 deletions net/softflowd/patches/020-uid.patch

This file was deleted.

Loading

0 comments on commit d49c670

Please sign in to comment.