From b9b070f39f3e14b7a8d154384f133555bddab106 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Tue, 14 Apr 2026 01:23:04 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A5=20Sync=202026-04-14=2001:23:04?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dnsproxy/Makefile | 4 +- internet-detector-mod-email/Makefile | 4 +- internet-detector-mod-modem-restart/Makefile | 4 +- internet-detector-mod-telegram/Makefile | 4 +- .../modules/mod_telegram.lua | 9 +- .../ucode/luci.internet-detector-mod-telegram | 11 ++- internet-detector/Makefile | 4 +- luci-app-internet-detector/Makefile | 4 +- .../resources/view/internet-detector.js | 44 ++++++--- .../po/ru/internet-detector.po | 11 ++- .../po/templates/internet-detector.pot | 13 ++- luci-app-passwall/Makefile | 2 +- .../root/etc/hotplug.d/iface/98-passwall | 17 ++-- .../root/usr/share/passwall/app.sh | 16 ++-- .../root/usr/share/passwall/iptables.sh | 96 +++++++++---------- .../root/usr/share/passwall/nftables.sh | 76 ++++++++------- .../root/usr/share/passwall/subscribe.lua | 8 ++ luci-app-passwall2/Makefile | 2 +- .../root/usr/share/passwall2/app.sh | 47 +++++---- .../root/usr/share/passwall2/iptables.sh | 22 +++-- .../root/usr/share/passwall2/nftables.sh | 21 ++-- .../root/usr/share/passwall2/subscribe.lua | 8 ++ mihomo-alpha/Makefile | 4 +- mihomo-meta/Makefile | 4 +- v2ray-plugin/Makefile | 4 +- 25 files changed, 261 insertions(+), 178 deletions(-) diff --git a/dnsproxy/Makefile b/dnsproxy/Makefile index 0c2ac8ae..1cda4a90 100644 --- a/dnsproxy/Makefile +++ b/dnsproxy/Makefile @@ -5,8 +5,8 @@ include $(TOPDIR)/rules.mk PKG_NAME:=dnsproxy -PKG_VERSION:=0.81.0 -PKG_RELEASE:=3 +PKG_VERSION:=0.81.1 +PKG_RELEASE:=4 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://codeload.github.com/AdguardTeam/dnsproxy/tar.gz/v$(PKG_VERSION)? diff --git a/internet-detector-mod-email/Makefile b/internet-detector-mod-email/Makefile index 1143828d..496cc13a 100644 --- a/internet-detector-mod-email/Makefile +++ b/internet-detector-mod-email/Makefile @@ -5,8 +5,8 @@ include $(TOPDIR)/rules.mk PKG_NAME:=internet-detector-mod-email -PKG_VERSION:=1.7.2 -PKG_RELEASE:=2 +PKG_VERSION:=1.7.3 +PKG_RELEASE:=3 PKG_MAINTAINER:=gSpot include $(INCLUDE_DIR)/package.mk diff --git a/internet-detector-mod-modem-restart/Makefile b/internet-detector-mod-modem-restart/Makefile index 242710de..f3cfb719 100644 --- a/internet-detector-mod-modem-restart/Makefile +++ b/internet-detector-mod-modem-restart/Makefile @@ -5,8 +5,8 @@ include $(TOPDIR)/rules.mk PKG_NAME:=internet-detector-mod-modem-restart -PKG_VERSION:=1.7.2 -PKG_RELEASE:=2 +PKG_VERSION:=1.7.3 +PKG_RELEASE:=3 PKG_MAINTAINER:=gSpot include $(INCLUDE_DIR)/package.mk diff --git a/internet-detector-mod-telegram/Makefile b/internet-detector-mod-telegram/Makefile index bb576138..993cbd11 100644 --- a/internet-detector-mod-telegram/Makefile +++ b/internet-detector-mod-telegram/Makefile @@ -5,8 +5,8 @@ include $(TOPDIR)/rules.mk PKG_NAME:=internet-detector-mod-telegram -PKG_VERSION:=1.7.2 -PKG_RELEASE:=2 +PKG_VERSION:=1.7.3 +PKG_RELEASE:=3 PKG_MAINTAINER:=gSpot include $(INCLUDE_DIR)/package.mk diff --git a/internet-detector-mod-telegram/files/usr/lib/lua/internet-detector/modules/mod_telegram.lua b/internet-detector-mod-telegram/files/usr/lib/lua/internet-detector/modules/mod_telegram.lua index c2f693f4..942c19c6 100644 --- a/internet-detector-mod-telegram/files/usr/lib/lua/internet-detector/modules/mod_telegram.lua +++ b/internet-detector-mod-telegram/files/usr/lib/lua/internet-detector/modules/mod_telegram.lua @@ -31,6 +31,7 @@ local Module = { curlParams = "-s -g --no-keepalive", proxyAuthString = "", proxyString = "", + ifaceString = "", status = nil, _enabled = false, _deadCounter = 0, @@ -85,6 +86,9 @@ function Module:init(t) t.proxy_port, self.proxyAuthString) end + if t.iface then + self.ifaceString = " --interface " .. t.iface + end if tonumber(t.message_at_startup) == 1 then self._msgSentDisconnect = false self._disconnected = false @@ -138,9 +142,10 @@ function Module:httpRequest(url) self.debugOutput(string.format("--- %s ---", self.name)) - local curl = string.format( - '%s%s --connect-timeout %s %s "%s"; printf "\n$?";', + local curl = string.format( + '%s%s%s --connect-timeout %s %s "%s"; printf "\n$?";', self.curlExec, + self.ifaceString, self.proxyString, self.connectTimeout, self.curlParams, diff --git a/internet-detector-mod-telegram/files/usr/share/rpcd/ucode/luci.internet-detector-mod-telegram b/internet-detector-mod-telegram/files/usr/share/rpcd/ucode/luci.internet-detector-mod-telegram index cfe087fa..e9e80cc2 100644 --- a/internet-detector-mod-telegram/files/usr/share/rpcd/ucode/luci.internet-detector-mod-telegram +++ b/internet-detector-mod-telegram/files/usr/share/rpcd/ucode/luci.internet-detector-mod-telegram @@ -13,11 +13,12 @@ if(!curlExec) { die('Error! Curl not found!'); } -function httpRequest(url, proxyType, proxyHost, proxyPort, proxyUser, proxyPasswd) { +function httpRequest(url, proxyType, proxyHost, proxyPort, proxyUser, proxyPasswd, iface) { let retCode = 1; let data = ''; let proxyAuthString = ''; let proxyString = ''; + let ifaceString = iface ? (' --interface ' + iface) : ''; if(!url) { return { retCode: 1, data }; @@ -38,14 +39,14 @@ function httpRequest(url, proxyType, proxyHost, proxyPort, proxyUser, proxyPassw proxyAuthString); } const curl = sprintf( - '%s%s --connect-timeout %s %s "%s"; printf "\n$?";', + '%s%s%s --connect-timeout %s %s "%s"; printf "\n$?";', curlExec, + ifaceString, proxyString, curlConnectTimeout, curlParams, url ); - const fd = popen(curl, 'r'); if(fd) { data = fd.read('all'); @@ -98,6 +99,7 @@ const methods = { proxyPort : 'String', proxyUser : 'String', proxyPasswd: 'String', + iface : 'String', }, call: function(request) { const botToken = request.args?.botToken; @@ -108,7 +110,8 @@ const methods = { request.args.proxyHost, request.args.proxyPort, request.args.proxyUser, - request.args.proxyPasswd + request.args.proxyPasswd, + request.args.iface ); if(ret.retCode == 0 && length(ret.data) > 0) { return parseResponse(ret.data); diff --git a/internet-detector/Makefile b/internet-detector/Makefile index efe20e44..da821eb0 100644 --- a/internet-detector/Makefile +++ b/internet-detector/Makefile @@ -5,8 +5,8 @@ include $(TOPDIR)/rules.mk PKG_NAME:=internet-detector -PKG_VERSION:=1.7.2 -PKG_RELEASE:=2 +PKG_VERSION:=1.7.3 +PKG_RELEASE:=3 PKG_MAINTAINER:=gSpot include $(INCLUDE_DIR)/package.mk diff --git a/luci-app-internet-detector/Makefile b/luci-app-internet-detector/Makefile index 748ecb8a..9ff60c7f 100644 --- a/luci-app-internet-detector/Makefile +++ b/luci-app-internet-detector/Makefile @@ -5,8 +5,8 @@ include $(TOPDIR)/rules.mk PKG_NAME:=luci-app-internet-detector -PKG_VERSION:=1.7.2 -PKG_RELEASE:=2 +PKG_VERSION:=1.7.3 +PKG_RELEASE:=3 LUCI_TITLE:=LuCI support for internet-detector LUCI_DEPENDS:=+internet-detector LUCI_PKGARCH:=all diff --git a/luci-app-internet-detector/htdocs/luci-static/resources/view/internet-detector.js b/luci-app-internet-detector/htdocs/luci-static/resources/view/internet-detector.js index 203a35f2..7cdca962 100644 --- a/luci-app-internet-detector/htdocs/luci-static/resources/view/internet-detector.js +++ b/luci-app-internet-detector/htdocs/luci-static/resources/view/internet-detector.js @@ -294,13 +294,13 @@ return view.extend({ callTgChatId: rpc.declare({ object: 'luci.internet-detector-mod-telegram', method: 'GetTgChatId', - params: [ 'botToken', 'proxyType', 'proxyHost', 'proxyPort', 'proxyUser', 'proxyPasswd' ], + params: [ 'botToken', 'proxyType', 'proxyHost', 'proxyPort', 'proxyUser', 'proxyPasswd', 'iface' ], expect: { '': {} } }), - getTgChatId(botToken, proxyType, proxyHost, proxyPort, proxyUser, proxyPasswd) { + getTgChatId(botToken, proxyType, proxyHost, proxyPort, proxyUser, proxyPasswd, iface) { return this.callTgChatId( - botToken, proxyType, proxyHost, proxyPort, proxyUser, proxyPasswd).then(data => { + botToken, proxyType, proxyHost, proxyPort, proxyUser, proxyPasswd, iface).then(data => { return data; }); }, @@ -405,38 +405,47 @@ return view.extend({ alert(_('Bot API token is missing!')); return; }; - let proxyType = null; + let proxyType = ''; let proxyTypeInput = document.getElementById( 'widget.cbid.%s.%s.mod_telegram_proxy_type'.format(this.appName, instance)); if(proxyTypeInput) { proxyType = proxyTypeInput.value; }; - let proxyHost = null; + let proxyHost = ''; let proxyHostInput = document.getElementById( 'widget.cbid.%s.%s.mod_telegram_proxy_host'.format(this.appName, instance)); - if(proxyTypeInput) { + if(proxyHostInput) { proxyHost = proxyHostInput.value; }; - let proxyPort = null; + let proxyPort = ''; let proxyPortInput = document.getElementById( 'widget.cbid.%s.%s.mod_telegram_proxy_port'.format(this.appName, instance)); - if(proxyTypeInput) { + if(proxyPortInput) { proxyPort = proxyPortInput.value; }; - let proxyUser = null; + let proxyUser = ''; let proxyUserInput = document.getElementById( 'widget.cbid.%s.%s.mod_telegram_proxy_user'.format(this.appName, instance)); - if(proxyTypeInput) { + if(proxyUserInput) { proxyUser = proxyUserInput.value; }; - let proxyPasswd = null; + let proxyPasswd = ''; let proxyPasswdInput = document.getElementById( 'widget.cbid.%s.%s.mod_telegram_proxy_passwd'.format(this.appName, instance)); - if(proxyTypeInput) { + if(proxyPasswdInput) { proxyPasswd = proxyPasswdInput.value; }; + let iface = ''; + let ifaceInput = document.getElementById( + 'cbid.%s.%s.mod_telegram_iface'.format(this.appName, instance)); + if(ifaceInput) { + let li = ifaceInput.querySelector('li[selected]'); + if(li) { + iface = li.dataset.value || ''; + }; + }; - return this.getTgChatId(botToken, proxyType, proxyHost, proxyPort, proxyUser, proxyPasswd).then(r => { + return this.getTgChatId(botToken, proxyType, proxyHost, proxyPort, proxyUser, proxyPasswd, iface).then(r => { if(r.ok) { if(r.chatId) { let tgChatIdInput = document.getElementById( @@ -945,6 +954,7 @@ return view.extend({ _('Network device for Internet access. If not specified, the default device is used.') ); o.noaliases = true; + o.modalonly = true; // interval_up o = s.taboption('main', form.ListValue, @@ -1806,6 +1816,14 @@ return view.extend({ o.modalonly = true; o.password = true; + // iface + o = s.taboption('telegram', widgets.DeviceSelect, + 'mod_telegram_iface', _('Device'), + _('Network device for sending messages. If not specified, the default device is used.') + ); + o.noaliases = true; + o.modalonly = true; + // message_at_startup o = s.taboption('telegram', form.Flag, 'mod_telegram_message_at_startup', diff --git a/luci-app-internet-detector/po/ru/internet-detector.po b/luci-app-internet-detector/po/ru/internet-detector.po index a776e325..cae6c563 100644 --- a/luci-app-internet-detector/po/ru/internet-detector.po +++ b/luci-app-internet-detector/po/ru/internet-detector.po @@ -339,6 +339,9 @@ msgstr "" "Интерфейс ModemManager. Если задан, то будет перезапущен после перезапуска " "ModemManger." +msgid "Network device activity (kernel: netdev)" +msgstr "Активность сетевого устройства (kernel: netdev)" + msgid "" "Network device for Internet access. If not specified, the default " "device is used." @@ -346,8 +349,12 @@ msgstr "" "Сетевое устройство для доступа в Интернет. Если не указано, используется " "устройство по умолчанию." -msgid "Network device activity (kernel: netdev)" -msgstr "Активность сетевого устройства (kernel: netdev)" +msgid "" +"Network device for sending messages. If not specified, the default " +"device is used." +msgstr "" +"Сетевое устройство для отправки сообщений. Если не указано, используется " +"устройство по умолчанию." msgid "" "Network device or interface to restart. If not specified, then the network service is restarted." diff --git a/luci-app-internet-detector/po/templates/internet-detector.pot b/luci-app-internet-detector/po/templates/internet-detector.pot index 7c7186bc..bd5822bf 100644 --- a/luci-app-internet-detector/po/templates/internet-detector.pot +++ b/luci-app-internet-detector/po/templates/internet-detector.pot @@ -317,12 +317,17 @@ msgid "" "ModemManager." msgstr "" -msgid "" -"Network device for Internet access. If not specified, the default " -"interface is used." +msgid "Network device activity (kernel: netdev)" msgstr "" -msgid "Network device activity (kernel: netdev)" +msgid "" +"Network device for Internet access. If not specified, the default " +"device is used." +msgstr "" + +msgid "" +"Network device for sending messages. If not specified, the default " +"device is used." msgstr "" msgid "" diff --git a/luci-app-passwall/Makefile b/luci-app-passwall/Makefile index d8cd4cf1..3c735eb3 100644 --- a/luci-app-passwall/Makefile +++ b/luci-app-passwall/Makefile @@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=luci-app-passwall PKG_VERSION:=26.4.6 -PKG_RELEASE:=64 +PKG_RELEASE:=65 PKG_PO_VERSION:=$(PKG_VERSION) PKG_CONFIG_DEPENDS:= \ diff --git a/luci-app-passwall/root/etc/hotplug.d/iface/98-passwall b/luci-app-passwall/root/etc/hotplug.d/iface/98-passwall index 1368610c..fb77b72a 100644 --- a/luci-app-passwall/root/etc/hotplug.d/iface/98-passwall +++ b/luci-app-passwall/root/etc/hotplug.d/iface/98-passwall @@ -1,22 +1,23 @@ #!/bin/sh +. /usr/share/passwall/utils.sh + [ "$ACTION" = "ifup" ] || [ "$ACTION" = "ifupdate" ] || exit 0 -[ "$(uci get passwall.@global[0].enabled 2>/dev/null)" = "1" ] && [ -f /var/lock/passwall_ready.lock ] && { +([ "$(get_cache_var "ENABLED_DEFAULT_ACL")" = "1" ] || [ "$(get_cache_var "ENABLED_ACLS")" = "1" ]) && [ -f ${LOCK_PATH}/${CONFIG}_ready.lock ] && { default_device=$(ip route show default 2>/dev/null | awk -F 'dev ' '{print $2}' | awk '{print $1}' | head -n1) default6_device=$(ip -6 route show default 2>/dev/null | awk -F 'dev ' '{print $2}' | awk '{print $1}' | head -n1) ( [ "$default_device" = "$DEVICE" ] || [ "$default6_device" = "$DEVICE" ] ) && { if [ "$ACTION" = "ifupdate" ]; then - FWI=$(uci -q get firewall.passwall.path 2>/dev/null) - [ -n "$FWI" ] && [ -f "$FWI" ] && sh "$FWI" >/dev/null 2>&1 & + USE_TABLES=$(get_cache_var "USE_TABLES") + [ -n "$USE_TABLES" ] && ${APP_PATH}/${USE_TABLES}.sh update_wan_sets >/dev/null 2>&1 & exit 0 fi - LOCK_FILE_DIR=/var/lock - [ ! -d ${LOCK_FILE_DIR} ] && mkdir -p ${LOCK_FILE_DIR} - LOCK_FILE="${LOCK_FILE_DIR}/passwall_ifup.lock" + [ ! -d ${LOCK_PATH} ] && mkdir -p ${LOCK_PATH} + LOCK_FILE="${LOCK_PATH}/${CONFIG}_ifup.lock" if [ -s ${LOCK_FILE} ]; then SPID=$(cat ${LOCK_FILE}) if [ -e /proc/${SPID}/status ]; then @@ -26,8 +27,8 @@ fi echo $$ > ${LOCK_FILE} - /etc/init.d/passwall restart >/dev/null 2>&1 & - logger -p notice -t network -s "passwall: restart when $INTERFACE ifup" + /etc/init.d/${CONFIG} restart >/dev/null 2>&1 & + logger -p notice -t network -s "${CONFIG}: restart when $INTERFACE ifup" rm -rf ${LOCK_FILE} } diff --git a/luci-app-passwall/root/usr/share/passwall/app.sh b/luci-app-passwall/root/usr/share/passwall/app.sh index b315d7ef..cb570647 100755 --- a/luci-app-passwall/root/usr/share/passwall/app.sh +++ b/luci-app-passwall/root/usr/share/passwall/app.sh @@ -751,12 +751,11 @@ run_redir() { } local protocol=$(config_n_get $node protocol) - local default_node=$(config_n_get $node default_node) local v2ray_dns_mode=$(config_t_get global v2ray_dns_mode tcp) - [ "${DNS_MODE}" != "sing-box" ] && [ "${DNS_MODE}" != "udp" ] && [ "$protocol" = "_shunt" ] && [ "$default_node" = "_direct" ] && { + [ "${DNS_MODE}" != "sing-box" ] && [ "$protocol" = "_shunt" ] && { DNS_MODE="sing-box" v2ray_dns_mode="tcp" - echolog "* 当前TCP节点采用Sing-Box分流且默认节点为直连,远程DNS过滤模式将默认使用Sing-Box(TCP),防止环回!" + echolog "* 当前 TCP 节点采用 Sing-Box 分流,远程 DNS 过滤模式将默认使用 Sing-Box(TCP)。!" } [ "$protocol" = "_shunt" ] && { @@ -832,12 +831,11 @@ run_redir() { } local protocol=$(config_n_get $node protocol) - local default_node=$(config_n_get $node default_node) local v2ray_dns_mode=$(config_t_get global v2ray_dns_mode tcp) - [ "${DNS_MODE}" != "xray" ] && [ "${DNS_MODE}" != "udp" ] && [ "$protocol" = "_shunt" ] && [ "$default_node" = "_direct" ] && { + [ "${DNS_MODE}" != "xray" ] && [ "$protocol" = "_shunt" ] && { DNS_MODE="xray" v2ray_dns_mode="tcp" - echolog "* 当前TCP节点采用Xray分流且默认节点为直连,远程DNS过滤模式将默认使用Xray(TCP),防止环回!" + echolog "* 当前 TCP 节点采用 Xray 分流,远程 DNS 过滤模式将默认使用Xray(TCP)。" } [ "$protocol" = "_shunt" ] && { @@ -1767,6 +1765,12 @@ acl_app() { local type=$(echo $(config_n_get $tcp_node type) | tr 'A-Z' 'a-z') if [ -n "${type}" ] && ([ "${type}" = "sing-box" ] || [ "${type}" = "xray" ]); then + local protocol=$(config_n_get $tcp_node protocol) + [ "$protocol" = "_shunt" ] && [ "${type}" != "${dns_mode}" ] && { + dns_mode=${type} + v2ray_dns_mode="tcp" + remote_dns="1.1.1.1" + } config_file="acl/${tcp_node}_TCP_${redir_port}.json" _extra_param="socks_address=127.0.0.1 socks_port=$socks_port" if ([ "$dns_mode" = "sing-box" ] || [ "$dns_mode" = "xray" ]) && [ "${type}" = "${dns_mode}" ]; then diff --git a/luci-app-passwall/root/usr/share/passwall/iptables.sh b/luci-app-passwall/root/usr/share/passwall/iptables.sh index 93b73dd6..4e929926 100755 --- a/luci-app-passwall/root/usr/share/passwall/iptables.sh +++ b/luci-app-passwall/root/usr/share/passwall/iptables.sh @@ -792,6 +792,38 @@ filter_direct_node_list() { done } +update_wan_sets() { + local log=$1 + + local WAN_IP=$(get_wan_ips ip4) + [ -n "$WAN_IP" ] && { + ipset -F "$IPSET_WAN" + for wan_ip in $WAN_IP; do + ipset -! add "$IPSET_WAN" "$wan_ip" + done + [ "$log" = "log" ] && { + local wan_ip + for wan_ip in $WAN_IP; do + echolog " - [$?]加入WAN IPv4到ipset[$IPSET_WAN]:${wan_ip}" + done + } + } + + local WAN6_IP=$(get_wan_ips ip6) + [ -n "$WAN6_IP" ] && { + ipset -F "$IPSET_WAN6" + for wan6_ip in $WAN6_IP; do + ipset -! add "$IPSET_WAN6" "$wan6_ip" + done + [ "$log" = "log" ] && { + local wan6_ip + for wan6_ip in $WAN6_IP; do + echolog " - [$?]加入WAN IPv6到ipset[$IPSET_WAN6]:${wan6_ip}" + done + } + } +} + add_firewall_rule() { echolog "开始加载 iptables 防火墙规则..." ipset -! create $IPSET_LOCAL nethash maxelem 1048576 @@ -942,6 +974,8 @@ add_firewall_rule() { EOF } + update_wan_sets "log" + [ -n "$ISP_DNS" ] && { #echolog "处理 ISP DNS 例外..." for ispip in $ISP_DNS; do @@ -975,13 +1009,8 @@ add_firewall_rule() { $ipt_n -A PSW $(dst $IPSET_LAN) -j RETURN $ipt_n -A PSW $(dst $IPSET_VPS) -j RETURN - WAN_IP=$(get_wan_ips ip4) - [ ! -z "${WAN_IP}" ] && { - for wan_ip in $WAN_IP; do - $ipt_n -A PSW $(comment "WAN_IP_RETURN") -d "${wan_ip}" -j RETURN - done - } - + $ipt_n -A PSW $(comment "WAN_IP_RETURN") $(dst $IPSET_WAN) -j RETURN + [ "$accept_icmp" = "1" ] && insert_rule_after "$ipt_n" "PREROUTING" "prerouting_rule" "-p icmp -j PSW" [ -z "${is_tproxy}" ] && insert_rule_after "$ipt_n" "PREROUTING" "prerouting_rule" "-p tcp -j PSW" @@ -1014,16 +1043,8 @@ add_firewall_rule() { $ipt_m -A PSW $(dst $IPSET_LAN) -j RETURN $ipt_m -A PSW $(dst $IPSET_VPS) -j RETURN $ipt_m -A PSW -m conntrack --ctdir REPLY -j RETURN - - [ ! -z "${WAN_IP}" ] && { - ipset -F $IPSET_WAN - for wan_ip in $WAN_IP; do - ipset -! add $IPSET_WAN ${wan_ip} - echolog " - [$?]加入WAN IPv4到ipset[$IPSET_WAN]:${wan_ip}" - done - $ipt_m -A PSW $(comment "WAN_IP_RETURN") $(dst $IPSET_WAN) -j RETURN - } - unset WAN_IP wan_ip + + $ipt_m -A PSW $(comment "WAN_IP_RETURN") $(dst $IPSET_WAN) -j RETURN insert_rule_before "$ipt_m" "PREROUTING" "mwan3" "-j PSW" # Only TCP, UDP Invalid. @@ -1093,17 +1114,8 @@ add_firewall_rule() { $ip6t_m -A PSW $(dst $IPSET_LAN6) -j RETURN $ip6t_m -A PSW $(dst $IPSET_VPS6) -j RETURN $ip6t_m -A PSW -m conntrack --ctdir REPLY -j RETURN - - WAN6_IP=$(get_wan_ips ip6) - [ ! -z "${WAN6_IP}" ] && { - ipset -F $IPSET_WAN6 - for wan6_ip in $WAN6_IP; do - ipset -! add $IPSET_WAN6 ${wan6_ip} - echolog " - [$?]加入WAN IPv6到ipset[$IPSET_WAN6]:${wan6_ip}" - done - $ip6t_m -A PSW $(comment "WAN6_IP_RETURN") $(dst $IPSET_WAN6) -j RETURN - } - unset WAN6_IP wan6_ip + + $ip6t_m -A PSW $(comment "WAN6_IP_RETURN") $(dst $IPSET_WAN6) -j RETURN insert_rule_before "$ip6t_m" "PREROUTING" "mwan3" "-j PSW" # Only TCP, UDP Invalid. @@ -1119,7 +1131,7 @@ add_firewall_rule() { ip -6 rule add fwmark ${FWMARK} table 999 priority 999 ip -6 route add local ::/0 dev lo table 999 - + [ "$TCP_UDP" = "1" ] && [ -z "$UDP_NODE" ] && UDP_NODE=$TCP_NODE [ "$ENABLED_DEFAULT_ACL" == 1 ] && { @@ -1412,7 +1424,9 @@ gen_include() { local __ipt="" [ -n "${ipt}" ] && { __ipt=$(cat <<- EOF - . $UTILS_PATH + + ${MY_PATH} update_wan_sets + mangle_output_psw=\$(${ipt}-save -t mangle | grep "PSW" | grep "mangle\-OUTPUT\-PSW" | sed "s#-A OUTPUT ##g") $ipt-save -c | grep -v "PSW" | $ipt-restore -c $ipt-restore -n <<-EOT @@ -1429,21 +1443,12 @@ gen_include() { \$(${MY_PATH} insert_rule_before "$ipt_m" "PREROUTING" "mwan3" "-j PSW") \$(${MY_PATH} insert_rule_before "$ipt_m" "PREROUTING" "PSW" "-p tcp -m socket -j PSW_DIVERT") - - WAN_IP=\$(get_wan_ips ip4) - [ ! -z "\${WAN_IP}" ] && { - ipset -F $IPSET_WAN - for wan_ip in \$WAN_IP; do - ipset -! add $IPSET_WAN \${wan_ip} - done - } EOF ) } local __ip6t="" [ -n "${ip6t}" ] && { __ip6t=$(cat <<- EOF - . $UTILS_PATH mangle_output_psw=\$(${ip6t}-save -t mangle | grep "PSW" | grep "mangle\-OUTPUT\-PSW" | sed "s#-A OUTPUT ##g") $ip6t-save -c | grep -v "PSW" | $ip6t-restore -c $ip6t-restore -n <<-EOT @@ -1459,20 +1464,12 @@ gen_include() { \$(${MY_PATH} insert_rule_before "$ip6t_m" "PREROUTING" "mwan3" "-j PSW") \$(${MY_PATH} insert_rule_before "$ip6t_m" "PREROUTING" "PSW" "-p tcp -m socket -j PSW_DIVERT") - - WAN6_IP=\$(get_wan_ips ip6) - [ ! -z "\${WAN6_IP}" ] && { - ipset -F $IPSET_WAN6 - for wan6_ip in \$WAN6_IP; do - ipset -! add $IPSET_WAN6 \${wan6_ip} - done - } EOF ) } cat <<-EOF >> $FWI ${__ipt} - + ${__ip6t} return 0 @@ -1529,6 +1526,9 @@ get_ip6t_bin) filter_direct_node_list) filter_direct_node_list ;; +update_wan_sets) + update_wan_sets "$@" + ;; stop) stop ;; diff --git a/luci-app-passwall/root/usr/share/passwall/nftables.sh b/luci-app-passwall/root/usr/share/passwall/nftables.sh index 1717a76f..ce413be1 100755 --- a/luci-app-passwall/root/usr/share/passwall/nftables.sh +++ b/luci-app-passwall/root/usr/share/passwall/nftables.sh @@ -858,6 +858,34 @@ mwan3_start() { nft list chain ip mangle mwan3_hook >/dev/null 2>&1 && nft insert rule ip mangle mwan3_hook ct mark ${FWMARK} counter return >/dev/null 2>&1 } +update_wan_sets() { + local log=$1 + + local WAN_IP=$(get_wan_ips ip4) + [ -n "$WAN_IP" ] && { + nft flush set $NFTABLE_NAME $NFTSET_WAN + echo "$WAN_IP" | insert_nftset $NFTSET_WAN "-1" + [ "$log" = "log" ] && { + local wan_ip + for wan_ip in $WAN_IP; do + echolog " - [$?]加入WAN IPv4到nftset[$NFTSET_WAN]:${wan_ip}" + done + } + } + + local WAN6_IP=$(get_wan_ips ip6) + [ -n "${WAN6_IP}" ] && { + nft flush set $NFTABLE_NAME $NFTSET_WAN6 + echo "$WAN6_IP" | insert_nftset $NFTSET_WAN6 "-1" + [ "$log" = "log" ] && { + local wan6_ip + for wan6_ip in $WAN6_IP; do + echolog " - [$?]加入WAN IPv6到nftset[$NFTSET_WAN6]:${wan6_ip}" + done + } + } +} + add_firewall_rule() { echolog "开始加载 nftables 防火墙规则..." gen_nft_tables @@ -999,6 +1027,8 @@ add_firewall_rule() { [ -n "$lan_ip6" ] && echo $lan_ip6 | insert_nftset $NFTSET_LAN6 "-1" } + update_wan_sets "log" + [ -n "$ISP_DNS" ] && { #echolog "处理 ISP DNS 例外..." echo "$ISP_DNS" | insert_nftset $NFTSET_WHITE 0 @@ -1113,17 +1143,9 @@ add_firewall_rule() { nft "add rule $NFTABLE_NAME nat_output meta l4proto {icmp,icmpv6} counter jump PSW_ICMP_REDIRECT" fi - WAN_IP=$(get_wan_ips ip4) - if [ -n "${WAN_IP}" ]; then - nft flush set $NFTABLE_NAME $NFTSET_WAN - echo $WAN_IP | insert_nftset $NFTSET_WAN "-1" - [ -z "${is_tproxy}" ] && nft "add rule $NFTABLE_NAME PSW_NAT ip daddr @$NFTSET_WAN counter return comment \"WAN_IP_RETURN\"" - nft "add rule $NFTABLE_NAME PSW_MANGLE ip daddr @$NFTSET_WAN counter return comment \"WAN_IP_RETURN\"" - for wan_ip in $WAN_IP; do - echolog " - [$?]加入WAN IPv4到nftset[$NFTSET_WAN]:${wan_ip}" - done - fi - unset WAN_IP wan_ip + #ipv4 wan_ip + [ -z "${is_tproxy}" ] && nft "add rule $NFTABLE_NAME PSW_NAT ip daddr @$NFTSET_WAN counter return comment \"WAN_IP_RETURN\"" + nft "add rule $NFTABLE_NAME PSW_MANGLE ip daddr @$NFTSET_WAN counter return comment \"WAN_IP_RETURN\"" ip rule add fwmark ${FWMARK} table 999 priority 999 ip route add local 0.0.0.0/0 dev lo table 999 @@ -1166,21 +1188,12 @@ add_firewall_rule() { nft "add rule $NFTABLE_NAME mangle_prerouting meta nfproto {ipv6} counter jump PSW_MANGLE_V6" nft "add rule $NFTABLE_NAME mangle_output meta nfproto {ipv6} counter jump PSW_OUTPUT_MANGLE_V6 comment \"PSW_OUTPUT_MANGLE\"" - WAN6_IP=$(get_wan_ips ip6) - [ -n "${WAN6_IP}" ] && { - nft flush set $NFTABLE_NAME $NFTSET_WAN6 - echo $WAN6_IP | insert_nftset $NFTSET_WAN6 "-1" - nft "add rule $NFTABLE_NAME PSW_MANGLE_V6 ip6 daddr @$NFTSET_WAN6 counter return comment \"WAN6_IP_RETURN\"" - for wan6_ip in $WAN6_IP; do - echolog " - [$?]加入WAN IPv6到nftset[$NFTSET_WAN6]:${wan6_ip}" - done - } - unset WAN6_IP wan6_ip + nft "add rule $NFTABLE_NAME PSW_MANGLE_V6 ip6 daddr @$NFTSET_WAN6 counter return comment \"WAN6_IP_RETURN\"" ip -6 rule add fwmark ${FWMARK} table 999 priority 999 ip -6 route add local ::/0 dev lo table 999 } - + [ "$TCP_UDP" = "1" ] && [ -z "$UDP_NODE" ] && UDP_NODE=$TCP_NODE [ "$ENABLED_DEFAULT_ACL" == 1 ] && { @@ -1466,20 +1479,10 @@ gen_include() { local __nft=" " __nft=$(cat <<- EOF - . $UTILS_PATH + [ -z "\$(nft list chain $NFTABLE_NAME mangle_prerouting | grep PSW_DIVERT)" ] && nft -f ${nft_chain_file} - WAN_IP=\$(get_wan_ips ip4) - [ ! -z "\${WAN_IP}" ] && { - nft flush set $NFTABLE_NAME $NFTSET_WAN - echo "\${WAN_IP}" | sh ${MY_PATH} insert_nftset $NFTSET_WAN "-1" - } - [ "$PROXY_IPV6" == "1" ] && { - WAN6_IP=\$(get_wan_ips ip6) - [ ! -z "\${WAN6_IP}" ] && { - nft flush set $NFTABLE_NAME $NFTSET_WAN6 - echo "\${WAN6_IP}" | sh ${MY_PATH} insert_nftset $NFTSET_WAN6 "-1" - } - } + + ${MY_PATH} update_wan_sets EOF ) @@ -1527,6 +1530,9 @@ mwan3_start) mwan3_stop) mwan3_stop ;; +update_wan_sets) + update_wan_sets "$@" + ;; stop) stop ;; diff --git a/luci-app-passwall/root/usr/share/passwall/subscribe.lua b/luci-app-passwall/root/usr/share/passwall/subscribe.lua index c6773e71..4c99ef3d 100755 --- a/luci-app-passwall/root/usr/share/passwall/subscribe.lua +++ b/luci-app-passwall/root/usr/share/passwall/subscribe.lua @@ -254,12 +254,20 @@ do uci:foreach(appname, "shunt_rules", function(e) if e[".name"] and e.remarks then table.insert(rules, e) + table.insert(rules, { + [".name"] = e[".name"] .. "_proxy_tag", + remarks = e.remarks .. " 前置代理" + }) end end) table.insert(rules, { [".name"] = "default_node", remarks = "默认" }) + table.insert(rules, { + [".name"] = "default_proxy_tag", + remarks = "默认 前置代理" + }) for k, e in pairs(rules) do local _node_id = node[e[".name"]] or nil diff --git a/luci-app-passwall2/Makefile b/luci-app-passwall2/Makefile index 98b19594..00c043e2 100644 --- a/luci-app-passwall2/Makefile +++ b/luci-app-passwall2/Makefile @@ -7,7 +7,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=luci-app-passwall2 PKG_VERSION:=26.4.10 -PKG_RELEASE:=20 +PKG_RELEASE:=21 PKG_PO_VERSION:=$(PKG_VERSION) PKG_CONFIG_DEPENDS:= \ diff --git a/luci-app-passwall2/root/usr/share/passwall2/app.sh b/luci-app-passwall2/root/usr/share/passwall2/app.sh index 5a8e9128..bd1110eb 100755 --- a/luci-app-passwall2/root/usr/share/passwall2/app.sh +++ b/luci-app-passwall2/root/usr/share/passwall2/app.sh @@ -1167,6 +1167,7 @@ start() { stop } mkdir -p /tmp/etc /tmp/log $TMP_PATH $TMP_BIN_PATH $TMP_SCRIPT_FUNC_PATH $TMP_ROUTE_PATH $TMP_ACL_PATH $TMP_PATH2 + get_config export V2RAY_LOCATION_ASSET=$(config_t_get global_rules v2ray_location_asset "/usr/share/v2ray/") export XRAY_LOCATION_ASSET=$V2RAY_LOCATION_ASSET export ENABLE_DEPRECATED_GEOSITE=true @@ -1275,6 +1276,26 @@ stop() { exit 0 } +get_direct_dns() { + RESOLVFILE=/tmp/resolv.conf.d/resolv.conf.auto + [ -f "${RESOLVFILE}" ] && [ -s "${RESOLVFILE}" ] || RESOLVFILE=/tmp/resolv.conf.auto + + ISP_DNS=$(cat $RESOLVFILE 2>/dev/null | grep -E -o "[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+" | grep -v -E '^(0\.0\.0\.0|127\.0\.0\.1)$' | awk '!seen[$0]++') + ISP_DNS6=$(cat $RESOLVFILE 2>/dev/null | grep -E "([A-Fa-f0-9]{1,4}::?){1,7}[A-Fa-f0-9]{1,4}" | awk -F % '{print $1}' | awk -F " " '{print $2}' | grep -v -Fx ::1 | grep -v -Fx :: | awk '!seen[$0]++') + + DNSMASQ_UPSTREAM_DNS=$(uci show dhcp.@dnsmasq[0] | grep "\.server=" | awk -F '=' '{print $2}' | sed "s/'//g" | tr ' ' '\n' | grep -v "\/" | awk '{if($1 ~ /#/) {sub(/#/, "#", $1); print $1} else {print $1"#53"}}' | head -2 | sed ':label;N;s/\n/,/;b label') + DEFAULT_DNS="${DNSMASQ_UPSTREAM_DNS}" + [ -z "${DEFAULT_DNS}" ] && DEFAULT_DNS=$(echo -n $ISP_DNS | tr ' ' '\n' | head -2 | tr '\n' ',' | sed 's/,$//') + AUTO_DNS=${DEFAULT_DNS:-119.29.29.29} + + local AUTO_DNS_1=$(echo ${AUTO_DNS} | awk -F ',' '{print $1}') + local AUTO_DNS_2=$(echo ${AUTO_DNS} | awk -F ',' '{print $2}') + local AUTO_DNS_ADDRESS=$(echo ${AUTO_DNS_1} | awk -F '#' '{print $1}') + local AUTO_DNS_PORT=$(echo ${AUTO_DNS_1} | awk -F '#' '{print $2}') + DIRECT_DNS_UDP_SERVER=${AUTO_DNS_ADDRESS} + DIRECT_DNS_UDP_PORT=${AUTO_DNS_PORT} +} + get_config() { ENABLED_DEFAULT_ACL=0 ENABLED=$(config_t_get global enabled 0) @@ -1307,31 +1328,17 @@ get_config() { DNS_CACHE=$(config_t_get global dns_cache 1) DNS_REDIRECT=$(config_t_get global dns_redirect 1) - RESOLVFILE=/tmp/resolv.conf.d/resolv.conf.auto - [ -f "${RESOLVFILE}" ] && [ -s "${RESOLVFILE}" ] || RESOLVFILE=/tmp/resolv.conf.auto + get_direct_dns - ISP_DNS=$(cat $RESOLVFILE 2>/dev/null | grep -E -o "[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+" | grep -v -E '^(0\.0\.0\.0|127\.0\.0\.1)$' | awk '!seen[$0]++') - ISP_DNS6=$(cat $RESOLVFILE 2>/dev/null | grep -E "([A-Fa-f0-9]{1,4}::?){1,7}[A-Fa-f0-9]{1,4}" | awk -F % '{print $1}' | awk -F " " '{print $2}' | grep -v -Fx ::1 | grep -v -Fx :: | awk '!seen[$0]++') - - DEFAULT_DNSMASQ_CFGID=$(uci show dhcp.@dnsmasq[0] | awk -F '.' '{print $2}' | awk -F '=' '{print $1}'| head -1) - DEFAULT_DNS=$(uci show dhcp.@dnsmasq[0] | grep "\.server=" | awk -F '=' '{print $2}' | sed "s/'//g" | tr ' ' '\n' | grep -v "\/" | head -2 | sed ':label;N;s/\n/,/;b label') - [ -z "${DEFAULT_DNS}" ] && DEFAULT_DNS=$(echo -n $ISP_DNS | tr ' ' '\n' | head -2 | tr '\n' ',' | sed 's/,$//') - AUTO_DNS=${DEFAULT_DNS:-119.29.29.29} - - local AUTO_DNS2=$(get_first_dns AUTO_DNS 53 | sed 's/#/:/g') - local AUTO_DNS_ADDRESS=$(echo ${AUTO_DNS2} | awk -F ':' '{print $1}') - local AUTO_DNS_PORT=$(echo ${AUTO_DNS2} | awk -F ':' '{print $2}') - DIRECT_DNS_UDP_SERVER=${AUTO_DNS_ADDRESS} - DIRECT_DNS_UDP_PORT=${AUTO_DNS_PORT} - - DNSMASQ_CONF_DIR=/tmp/dnsmasq.d + DEFAULT_DNSMASQ_CONF_DIR=/tmp/dnsmasq.d + DNSMASQ_CONF_DIR=${DEFAULT_DNSMASQ_CONF_DIR} DEFAULT_DNSMASQ_CFGID="$(uci -q show "dhcp.@dnsmasq[0]" | awk 'NR==1 {split($0, conf, /[.=]/); print conf[2]}')" if [ -f "/tmp/etc/dnsmasq.conf.$DEFAULT_DNSMASQ_CFGID" ]; then DNSMASQ_CONF_DIR="$(awk -F '=' '/^conf-dir=/ {print $2}' "/tmp/etc/dnsmasq.conf.$DEFAULT_DNSMASQ_CFGID")" if [ -n "$DNSMASQ_CONF_DIR" ]; then DNSMASQ_CONF_DIR=${DNSMASQ_CONF_DIR%*/} else - DNSMASQ_CONF_DIR="/tmp/dnsmasq.d" + DNSMASQ_CONF_DIR=${DEFAULT_DNSMASQ_CONF_DIR} fi fi set_cache_var GLOBAL_DNSMASQ_CONF ${DNSMASQ_CONF_DIR}/dnsmasq-${CONFIG}.conf @@ -1340,16 +1347,16 @@ get_config() { QUEUE_RUN=1 } -get_config - arg1=$1 shift case $arg1 in run_socks) + get_direct_dns QUEUE_RUN=0 run_socks $@ ;; socks_node_switch) + get_direct_dns QUEUE_RUN=0 socks_node_switch $@ ;; diff --git a/luci-app-passwall2/root/usr/share/passwall2/iptables.sh b/luci-app-passwall2/root/usr/share/passwall2/iptables.sh index f6e7e836..c66ea8f6 100755 --- a/luci-app-passwall2/root/usr/share/passwall2/iptables.sh +++ b/luci-app-passwall2/root/usr/share/passwall2/iptables.sh @@ -768,14 +768,6 @@ add_firewall_rule() { $ipt_m -A PSW2_OUTPUT $(dst $IPSET_LAN) -j RETURN $ipt_m -A PSW2_OUTPUT $(dst $IPSET_VPS) -j RETURN $ipt_m -A PSW2_OUTPUT -m conntrack --ctdir REPLY -j RETURN - [ -n "$AUTO_DNS" ] && { - for auto_dns in $(echo $AUTO_DNS | tr ',' ' '); do - local dns_address=$(echo $auto_dns | awk -F '#' '{print $1}') - local dns_port=$(echo $auto_dns | awk -F '#' '{print $2}') - $ipt_m -A PSW2_OUTPUT -p udp -d ${dns_address} --dport ${dns_port:-53} -j RETURN - log_i18n 1 "$(i18n "Add direct DNS to %s: %s" "iptables" "${dns_address}:${dns_port:-53}")" - done - } $ipt_m -A PSW2_OUTPUT -m mark --mark 255 -j RETURN ip rule add fwmark ${FWMARK} table 999 priority 999 @@ -837,6 +829,20 @@ add_firewall_rule() { $ip6t_m -A PSW2_OUTPUT $(dst $IPSET_VPS6) -j RETURN $ip6t_m -A PSW2_OUTPUT -m conntrack --ctdir REPLY -j RETURN + [ -n "$AUTO_DNS" ] && { + for auto_dns in $(echo $AUTO_DNS | tr ',' ' '); do + local dns_address=$(echo $auto_dns | awk -F '#' '{print $1}') + local dns_port=$(echo $auto_dns | awk -F '#' '{print $2}') + if [[ "$dns_address" == *::* ]]; then + $ip6t_m -I PSW2_OUTPUT -p udp -d ${dns_address} --dport ${dns_port:-53} -j RETURN + log_i18n 1 "$(i18n "Add direct DNS to %s: %s" "ip6tables" "${dns_address}:${dns_port:-53}")" + else + $ipt_m -I PSW2_OUTPUT -p udp -d ${dns_address} --dport ${dns_port:-53} -j RETURN + log_i18n 1 "$(i18n "Add direct DNS to %s: %s" "iptables" "${dns_address}:${dns_port:-53}")" + fi + done + } + ip -6 rule add fwmark ${FWMARK} table 999 priority 999 ip -6 route add local ::/0 dev lo table 999 diff --git a/luci-app-passwall2/root/usr/share/passwall2/nftables.sh b/luci-app-passwall2/root/usr/share/passwall2/nftables.sh index bc92a973..4f50bcb9 100755 --- a/luci-app-passwall2/root/usr/share/passwall2/nftables.sh +++ b/luci-app-passwall2/root/usr/share/passwall2/nftables.sh @@ -797,14 +797,6 @@ add_firewall_rule() { nft "add rule $NFTABLE_NAME PSW2_OUTPUT_MANGLE ip daddr @$NFTSET_LAN counter return" nft "add rule $NFTABLE_NAME PSW2_OUTPUT_MANGLE ip daddr @$NFTSET_VPS counter return" nft "add rule $NFTABLE_NAME PSW2_OUTPUT_MANGLE ct direction reply counter return" - [ -n "$AUTO_DNS" ] && { - for auto_dns in $(echo $AUTO_DNS | tr ',' ' '); do - local dns_address=$(echo $auto_dns | awk -F '#' '{print $1}') - local dns_port=$(echo $auto_dns | awk -F '#' '{print $2}') - nft "add rule $NFTABLE_NAME PSW2_OUTPUT_MANGLE ip protocol udp ip daddr ${dns_address} $(factor ${dns_port:-53} "udp dport") counter return" - log_i18n 1 "$(i18n "Add direct DNS to %s: %s" "nftables" "${dns_address}:${dns_port:-53}")" - done - } nft "add rule $NFTABLE_NAME PSW2_OUTPUT_MANGLE meta mark 255 counter return" # jump chains @@ -869,6 +861,19 @@ add_firewall_rule() { nft "add rule $NFTABLE_NAME PSW2_OUTPUT_MANGLE_V6 ct direction reply counter return" nft "add rule $NFTABLE_NAME PSW2_OUTPUT_MANGLE_V6 meta mark 255 counter return" + [ -n "$AUTO_DNS" ] && { + for auto_dns in $(echo $AUTO_DNS | tr ',' ' '); do + local dns_address=$(echo $auto_dns | awk -F '#' '{print $1}') + local dns_port=$(echo $auto_dns | awk -F '#' '{print $2}') + if [[ "$dns_address" == *::* ]]; then + nft "insert rule $NFTABLE_NAME PSW2_OUTPUT_MANGLE_V6 meta l4proto udp ip6 daddr ${dns_address} $(factor ${dns_port:-53} "udp dport") counter return" + else + nft "insert rule $NFTABLE_NAME PSW2_OUTPUT_MANGLE ip protocol udp ip daddr ${dns_address} $(factor ${dns_port:-53} "udp dport") counter return" + fi + log_i18n 1 "$(i18n "Add direct DNS to %s: %s" "nftables" "${dns_address}:${dns_port:-53}")" + done + } + # jump chains [ "$PROXY_IPV6" == "1" ] && { nft "add rule $NFTABLE_NAME mangle_prerouting meta nfproto {ipv6} counter jump PSW2_MANGLE_V6" diff --git a/luci-app-passwall2/root/usr/share/passwall2/subscribe.lua b/luci-app-passwall2/root/usr/share/passwall2/subscribe.lua index 41667309..c1ada588 100755 --- a/luci-app-passwall2/root/usr/share/passwall2/subscribe.lua +++ b/luci-app-passwall2/root/usr/share/passwall2/subscribe.lua @@ -237,12 +237,20 @@ do uci:foreach(appname, "shunt_rules", function(e) if e[".name"] and e.remarks then table.insert(rules, e) + table.insert(rules, { + [".name"] = e[".name"] .. "_proxy_tag", + remarks = e.remarks .. " " .. i18n.translate("Preproxy") + }) end end) table.insert(rules, { [".name"] = "default_node", remarks = i18n.translatef("Default") }) + table.insert(rules, { + [".name"] = "default_proxy_tag", + remarks = i18n.translatef("Default") .. " " .. i18n.translate("Preproxy") + }) for k, e in pairs(rules) do local _node_id = node[e[".name"]] or nil diff --git a/mihomo-alpha/Makefile b/mihomo-alpha/Makefile index 1f8fc59b..15637c56 100644 --- a/mihomo-alpha/Makefile +++ b/mihomo-alpha/Makefile @@ -2,13 +2,13 @@ include $(TOPDIR)/rules.mk PKG_NAME:=mihomo-alpha PKG_VERSION:=2026.04.11 -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION) PKG_SOURCE_PROTO:=git PKG_SOURCE_URL:=https://github.com/MetaCubeX/mihomo.git -PKG_SOURCE_VERSION:=008b91bfe8c0e2daca0ab69061efd9ea1ad71bd2 +PKG_SOURCE_VERSION:=80072ebb6f9933e6a87ae94e3f6917a6c82c665e PKG_MIRROR_HASH:=skip PKG_LICENSE:=GPL3.0+ diff --git a/mihomo-meta/Makefile b/mihomo-meta/Makefile index 1672a59d..d656eaa5 100644 --- a/mihomo-meta/Makefile +++ b/mihomo-meta/Makefile @@ -2,13 +2,13 @@ include $(TOPDIR)/rules.mk PKG_NAME:=mihomo-meta PKG_VERSION:=1.19.23 -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION) PKG_SOURCE_PROTO:=git PKG_SOURCE_URL:=https://github.com/MetaCubeX/mihomo.git -PKG_SOURCE_VERSION:=008b91bfe8c0e2daca0ab69061efd9ea1ad71bd2 +PKG_SOURCE_VERSION:=v1.19.23 PKG_MIRROR_HASH:=skip PKG_LICENSE:=GPL3.0+ diff --git a/v2ray-plugin/Makefile b/v2ray-plugin/Makefile index 8fa962ad..2e9186bb 100644 --- a/v2ray-plugin/Makefile +++ b/v2ray-plugin/Makefile @@ -6,8 +6,8 @@ include $(TOPDIR)/rules.mk PKG_NAME:=v2ray-plugin -PKG_VERSION:=5.48.0 -PKG_RELEASE:=2 +PKG_VERSION:=5.49.0 +PKG_RELEASE:=3 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://codeload.github.com/teddysun/v2ray-plugin/tar.gz/v$(PKG_VERSION)?