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 Jan 6, 2025
2 parents bb729bb + 73ebd4d commit 78611eb
Show file tree
Hide file tree
Showing 5 changed files with 194 additions and 150 deletions.
22 changes: 18 additions & 4 deletions lang/lua-eco/Makefile
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
include $(TOPDIR)/rules.mk

PKG_NAME:=lua-eco
PKG_VERSION:=3.6.0
PKG_VERSION:=3.7.0
PKG_RELEASE:=1

PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL=https://github.com/zhaojh329/lua-eco/releases/download/v$(PKG_VERSION)
PKG_HASH:=0fdcd8eb9e93f2d1f0ff2132298faae2e13a8bfd676bd91db4d53e48917d6a74
PKG_HASH:=c8f35657cc873cbfc6e2c3cd0e9bfb3add0b634d1cfba648947e47f303f81d1d

PKG_MAINTAINER:=Jianhui Zhao <[email protected]>
PKG_LICENSE:=MIT
Expand Down Expand Up @@ -47,7 +47,9 @@ endef
Package/lua-eco-log=$(call Package/lua-eco/Module,log utils)
Package/lua-eco-base64=$(call Package/lua-eco/Module,base64)
Package/lua-eco-sha1=$(call Package/lua-eco/Module,sha1)
Package/lua-eco-sha256=$(call Package/lua-eco/Module,sha256)
Package/lua-eco-md5=$(call Package/lua-eco/Module,md5)
Package/lua-eco-hmac=$(call Package/lua-eco/Module,hmac)
Package/lua-eco-socket=$(call Package/lua-eco/Module,socket)
Package/lua-eco-dns=$(call Package/lua-eco/Module,dns,+lua-eco-socket)
Package/lua-eco-ssl=$(call Package/lua-eco/Module,ssl,\
Expand Down Expand Up @@ -98,11 +100,11 @@ define Package/lua-eco/install
$(INSTALL_DIR) $(1)/usr/bin $(1)/usr/local/lib/lua/5.3/eco/core \
$(1)/usr/lib $(1)/usr/local/lib/lua/5.3/eco/encoding
$(INSTALL_BIN) $(PKG_BUILD_DIR)/eco $(1)/usr/bin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/libeco.so $(1)/usr/lib
$(INSTALL_BIN) $(PKG_BUILD_DIR)/libeco.so* $(1)/usr/lib
$(INSTALL_BIN) $(PKG_BUILD_DIR)/bufio.so $(1)/usr/local/lib/lua/5.3/eco
$(INSTALL_DATA) $(PKG_BUILD_DIR)/hex.lua $(1)/usr/local/lib/lua/5.3/eco/encoding
$(INSTALL_BIN) $(PKG_BUILD_DIR)/{time,bufio,sys,file}.so $(1)/usr/local/lib/lua/5.3/eco/core
$(INSTALL_DATA) $(PKG_BUILD_DIR)/{time,sys,file,sync}.lua $(1)/usr/local/lib/lua/5.3/eco
$(INSTALL_DATA) $(PKG_BUILD_DIR)/{time,sys,file,sync,channel}.lua $(1)/usr/local/lib/lua/5.3/eco
endef

define Package/lua-eco-log/install
Expand All @@ -120,11 +122,21 @@ define Package/lua-eco-sha1/install
$(INSTALL_BIN) $(PKG_BUILD_DIR)/sha1.so $(1)/usr/local/lib/lua/5.3/eco/hash
endef

define Package/lua-eco-sha256/install
$(INSTALL_DIR) $(1)/usr/local/lib/lua/5.3/eco/hash
$(INSTALL_BIN) $(PKG_BUILD_DIR)/sha256.so $(1)/usr/local/lib/lua/5.3/eco/hash
endef

define Package/lua-eco-md5/install
$(INSTALL_DIR) $(1)/usr/local/lib/lua/5.3/eco/hash
$(INSTALL_BIN) $(PKG_BUILD_DIR)/md5.so $(1)/usr/local/lib/lua/5.3/eco/hash
endef

define Package/lua-eco-hmac/install
$(INSTALL_DIR) $(1)/usr/local/lib/lua/5.3/eco/hash
$(INSTALL_BIN) $(PKG_BUILD_DIR)/hmac.lua $(1)/usr/local/lib/lua/5.3/eco/hash
endef

define Package/lua-eco-socket/install
$(INSTALL_DIR) $(1)/usr/local/lib/lua/5.3/eco/core
$(INSTALL_DATA) $(PKG_BUILD_DIR)/socket.lua $(1)/usr/local/lib/lua/5.3/eco
Expand Down Expand Up @@ -201,7 +213,9 @@ $(eval $(call BuildPackage,lua-eco))
$(eval $(call BuildPackage,lua-eco-log))
$(eval $(call BuildPackage,lua-eco-base64))
$(eval $(call BuildPackage,lua-eco-sha1))
$(eval $(call BuildPackage,lua-eco-sha256))
$(eval $(call BuildPackage,lua-eco-md5))
$(eval $(call BuildPackage,lua-eco-hmac))
$(eval $(call BuildPackage,lua-eco-socket))
$(eval $(call BuildPackage,lua-eco-dns))
$(eval $(call BuildPackage,lua-eco-ssl))
Expand Down
36 changes: 18 additions & 18 deletions 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:=18
PKG_RELEASE:=20
PKG_MAINTAINER:=Stan Grishin <[email protected]>
PKG_LICENSE:=AGPL-3.0-or-later

Expand Down Expand Up @@ -46,33 +46,33 @@ endef
define Package/adblock-fast/install
$(INSTALL_DIR) $(1)/etc/init.d
$(INSTALL_BIN) ./files/etc/init.d/adblock-fast $(1)/etc/init.d/adblock-fast
$(SED) "s|^\(readonly PKG_VERSION\).*|\1='$(PKG_VERSION)-$(PKG_RELEASE)'|" $(1)/etc/init.d/adblock-fast
$(SED) "s|^\(readonly PKG_VERSION\).*|\1='$(PKG_VERSION)-r$(PKG_RELEASE)'|" $(1)/etc/init.d/adblock-fast
$(INSTALL_DIR) $(1)/etc/config
$(INSTALL_CONF) ./files/etc/config/adblock-fast $(1)/etc/config/adblock-fast
$(INSTALL_DIR) $(1)/etc/uci-defaults
$(INSTALL_BIN) ./files/etc/uci-defaults/90-adblock-fast $(1)/etc/uci-defaults/90-adblock-fast
endef

define Package/adblock-fast/postinst
#!/bin/sh
# check if we are on real system
if [ -z "$${IPKG_INSTROOT}" ]; then
/etc/init.d/adblock-fast enable
fi
exit 0
#!/bin/sh
# check if we are on real system
if [ -z "$${IPKG_INSTROOT}" ]; then
/etc/init.d/adblock-fast enable
fi
exit 0
endef

define Package/adblock-fast/prerm
#!/bin/sh
# check if we are on real system
if [ -z "$${IPKG_INSTROOT}" ]; then
echo -n "Stopping adblock-fast service... "
{ /etc/init.d/adblock-fast stop && \
/etc/init.d/adblock-fast killcache; } >/dev/null 2>&1 && echo "OK" || echo "FAIL"
echo -n "Removing rc.d symlink for adblock-fast... "
/etc/init.d/adblock-fast disable >/dev/null 2>&1 && echo "OK" || echo "FAIL"
fi
exit 0
#!/bin/sh
# check if we are on real system
if [ -z "$${IPKG_INSTROOT}" ]; then
echo -n "Stopping adblock-fast service... "
{ /etc/init.d/adblock-fast stop && \
/etc/init.d/adblock-fast killcache; } >/dev/null 2>&1 && echo "OK" || echo "FAIL"
echo -n "Removing rc.d symlink for adblock-fast... "
/etc/init.d/adblock-fast disable >/dev/null 2>&1 && echo "OK" || echo "FAIL"
fi
exit 0
endef

$(eval $(call BuildPackage,adblock-fast))
132 changes: 81 additions & 51 deletions net/adblock-fast/files/etc/init.d/adblock-fast
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,7 @@ print_json_string() { json_init; json_add_string "$1" "$2"; json_dump; json_clea
sanitize_dir() { [ -d "$(readlink -fn "$1")" ] && readlink -fn "$1"; }
smartdns_restart() { /etc/init.d/smartdns restart >/dev/null 2>&1; }
str_contains() { test "$1" != "$(str_replace "$1" "$2" '')"; }
str_contains_word() { echo "$1" | grep -q -w "$2"; }
str_contains_word() { echo "$1" | grep -qw "$2"; }
str_first_word() { echo "${1%% *}"; }
# shellcheck disable=SC2018,SC2019
str_to_lower() { echo "$1" | tr 'A-Z' 'a-z'; }
Expand Down Expand Up @@ -846,6 +846,7 @@ resolver() {
_dnsmasq_instance_config() {
local cfg="$1" param="$2" confdir confdirFile
[ -s "/etc/config/dhcp" ] || return 0
[ -n "$(uci_get dhcp "$cfg")" ] || return 1
case "$param" in
dnsmasq.addnhosts)
if [ "$(uci_get 'dhcp' "$cfg" 'serversfile')" = "$dnsmasqServersFile" ]; then
Expand Down Expand Up @@ -880,10 +881,19 @@ resolver() {
;;
esac
}
# shellcheck disable=SC2317
_dnsmasq_instance_append_force_dns_port() {
local cfg="$1" instance_port
[ -s "/etc/config/dhcp" ] || return 0
[ -n "$(uci_get 'dhcp' "$cfg")" ] || return 1
config_get instance_port "$cfg" 'port' '53'
str_contains_word "$force_dns_port" "$instance_port" || force_dns_port="${force_dns_port:+$force_dns_port }${instance_port}"
}
# shellcheck disable=SC2016,SC2317
_dnsmasq_instance_init() {
local cfg="$1" param="$2" confdir confdirFile
[ -s "/etc/config/dhcp" ] || return 0
[ -n "$(uci_get 'dhcp' "$cfg")" ] || return 1
case "$param" in
dnsmasq.conf|dnsmasq.ipset|dnsmasq.nftset)
if grep -q 'config_get dnsmasqconfdir "$cfg" confdir "/tmp/dnsmasq${cfg:+.$cfg}.d"' '/etc/init.d/dnsmasq'; then
Expand All @@ -898,8 +908,16 @@ resolver() {
;;
esac
}
_smartdns_instance_append_force_dns_port() {
[ -s "/etc/config/smartdns" ] || return 0
[ -n "$(uci_get 'smartdns' "$cfg")" ] || return 1
local cfg="$1" instance_port
config_get instance_port "$cfg" 'port' '53'
str_contains_word "$force_dns_port" "$instance_port" || force_dns_port="${force_dns_port:+$force_dns_port }${instance_port}"
}
_smartdns_instance_config() {
[ -s "/etc/config/smartdns" ] || return 0
[ -n "$(uci_get 'smartdns' "$cfg")" ] || return 1
local cfg="$1" param="$2"
case "$param" in
cleanup)
Expand All @@ -925,6 +943,14 @@ resolver() {
;;
esac
}
# shellcheck disable=SC2317
_unbound_instance_append_force_dns_port() {
[ -s "/etc/config/unbound" ] || return 0
[ -n "$(uci_get 'unbound' "$cfg")" ] || return 1
local cfg="$1" instance_port
config_get instance_port "$cfg" 'listen_port' '53'
str_contains_word "$force_dns_port" "$instance_port" || force_dns_port="${force_dns_port:+$force_dns_port }${instance_port}"
}

local param output_text i
case $1 in
Expand Down Expand Up @@ -975,17 +1001,21 @@ resolver() {
config_load 'dhcp'
if [ "$dnsmasq_instance" = "*" ]; then
config_foreach _dnsmasq_instance_config 'dnsmasq' "$dns"
config_foreach _dnsmasq_instance_append_force_dns_port 'dnsmasq'
elif [ -n "$dnsmasq_instance" ]; then
for i in $dnsmasq_instance; do
_dnsmasq_instance_config "@dnsmasq[$i]" "$dns" || _dnsmasq_instance_config "$i" "$dns"
_dnsmasq_instance_append_force_dns_port "@dnsmasq[$i]" || _dnsmasq_instance_append_force_dns_port "$i"
done
fi
config_load 'smartdns'
if [ "$smartdns_instance" = "*" ]; then
config_foreach _smartdns_instance_config 'smartdns' "$dns"
config_foreach _smartdns_instance_append_force_dns_port 'smartdns'
elif [ -n "$smartdns_instance" ]; then
for i in $smartdns_instance; do
_smartdns_instance_config "@smartdns[$i]" "$dns" || _smartdns_instance_config "$i" "$dns"
_smartdns_instance_append_force_dns_port "@smartdns[$i]" || _smartdns_instance_append_force_dns_port "$i"
done
fi

Expand Down Expand Up @@ -1927,7 +1957,7 @@ adb_sizes() {

# shellcheck disable=SC2120
adb_start() {
local action status error message stats c iface
local action status error message stats p iface
local param="$1" validation_result="$3"

load_environment "$validation_result" "$param" || return 1
Expand Down Expand Up @@ -2061,85 +2091,85 @@ adb_start() {
json_add_array firewall
if [ "$force_dns" -ne '0' ]; then
# shellcheck disable=SC3060
for c in ${force_dns_port/,/ }; do
if netstat -tuln | grep LISTEN | grep ":${c}" >/dev/null 2>&1; then
for p in ${force_dns_port/,/ }; do
if netstat -tuln | grep LISTEN | grep ":${p}" >/dev/null 2>&1; then
for iface in $force_dns_interface; do
json_add_object ""
json_add_string type redirect
json_add_string target DNAT
json_add_object ''
json_add_string type 'redirect'
json_add_string target 'DNAT'
json_add_string src "$iface"
json_add_string proto "tcp udp"
json_add_string src_dport "$c"
json_add_string dest_port "$c"
json_add_string family any
json_add_boolean reflection 0
json_add_string proto 'tcp udp'
json_add_string src_dport '53'
json_add_string dest_port "$p"
json_add_string family 'any'
json_add_boolean reflection '0'
json_close_object
done
else
for iface in $force_dns_interface; do
json_add_object ""
json_add_string type rule
json_add_object ''
json_add_string type 'rule'
json_add_string src "$iface"
json_add_string dest "*"
json_add_string proto "tcp udp"
json_add_string dest_port "$c"
json_add_string target REJECT
json_add_string dest '*'
json_add_string proto 'tcp udp'
json_add_string dest_port "$p"
json_add_string target 'REJECT'
json_close_object
done
fi
done
fi
case "$dns" in
dnsmasq.ipset|smartdns.ipset)
json_add_object ""
json_add_string type ipset
json_add_string name adb
json_add_string match dest_net
json_add_string storage hash
json_add_object ''
json_add_string type 'ipset'
json_add_string name 'adb'
json_add_string match 'dest_net'
json_add_string storage 'hash'
json_close_object
for iface in $force_dns_interface; do
json_add_object ""
json_add_string type rule
json_add_string ipset adb
json_add_object ''
json_add_string type 'rule'
json_add_string ipset 'adb'
json_add_string src "$iface"
json_add_string dest "*"
json_add_string proto "tcp udp"
json_add_string target REJECT
json_add_string dest '*'
json_add_string proto 'tcp udp'
json_add_string target 'REJECT'
json_close_object
done
;;
dnsmasq.nftset|smartdns.nftset)
json_add_object ""
json_add_string type ipset
json_add_string name adb4
json_add_string family 4
json_add_string match dest_net
json_add_object ''
json_add_string type 'ipset'
json_add_string name 'adb4'
json_add_string family '4'
json_add_string match 'dest_net'
json_close_object
for iface in $force_dns_interface; do
json_add_object ""
json_add_string type rule
json_add_string ipset adb4
json_add_object ''
json_add_string type 'rule'
json_add_string ipset 'adb4'
json_add_string src "$iface"
json_add_string dest "*"
json_add_string proto "tcp udp"
json_add_string target REJECT
json_add_string dest '*'
json_add_string proto 'tcp udp'
json_add_string target 'REJECT'
json_close_object
done
if [ "$ipv6_enabled" -ne '0' ]; then
json_add_object ""
json_add_string type ipset
json_add_string name adb6
json_add_string family 6
json_add_string match dest_net
json_add_object ''
json_add_string type 'ipset'
json_add_string name 'adb6'
json_add_string family '6'
json_add_string match 'dest_net'
json_close_object
for iface in $force_dns_interface; do
json_add_object ""
json_add_string type rule
json_add_string ipset adb6
json_add_object ''
json_add_string type 'rule'
json_add_string ipset 'adb6'
json_add_string src "$iface"
json_add_string dest "*"
json_add_string proto "tcp udp"
json_add_string target REJECT
json_add_string dest '*'
json_add_string proto 'tcp udp'
json_add_string target 'REJECT'
json_close_object
done
fi
Expand Down
8 changes: 4 additions & 4 deletions net/natmap/Makefile
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
include $(TOPDIR)/rules.mk

PKG_NAME:=natmap
PKG_VERSION:=20240813
PKG_RELEASE:=2
PKG_VERSION:=20250101
PKG_RELEASE:=1

PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=https://github.com/heiher/natmap/releases/download/$(PKG_VERSION)
PKG_HASH:=2fd89d286b19b9235d5e3477699c3752911bc5e80840ea1ed6930bfe98f47248
PKG_HASH:=7cd18e495b3d163a39b0a52866e6bad9b121ade504d6477f5ea36dc0d0040cac

PKG_MAINTAINER:=Richard Yu <[email protected]>, Ray Wang <[email protected]>
PKG_LICENSE:=MIT
Expand Down
Loading

0 comments on commit 78611eb

Please sign in to comment.