diff --git a/autoupdate/Makefile b/autoupdate/Makefile index 2fa0d3af3..7eaa8c7b3 100755 --- a/autoupdate/Makefile +++ b/autoupdate/Makefile @@ -1,4 +1,4 @@ -# Copyright (C) 2020-2023 Hyy2001X +# Copyright (C) 2020-2024 Hyy2001X include $(TOPDIR)/rules.mk @@ -16,7 +16,7 @@ define Package/$(PKG_NAME) endef define Package/$(PKG_NAME)/description - autoupdate - Upgrade OpenWrt by one-key + autoupdate - One-key AutoUpdate endef define Build/Compile diff --git a/autoupdate/files/bin/autoupdate b/autoupdate/files/bin/autoupdate index e0be4806b..06621c7ff 100755 --- a/autoupdate/files/bin/autoupdate +++ b/autoupdate/files/bin/autoupdate @@ -3,7 +3,7 @@ # AutoUpdate for Openwrt # Dependences: wget-ssl/wget/uclient-fetch curl jq expr sysupgrade -Version=V6.9.7 +Version=V6.9.8 function TITLE() { clear && echo "Openwrt-AutoUpdate Script by Hyy2001 ${Version}" @@ -22,6 +22,9 @@ function SHELL_HELP() { -f 跳过版本号校验,并强制刷写固件 ${Red}(危险)${White} * -F, --force-flash 强制刷写固件 ${Red}(危险)${White} * -P, --proxy 优先开启镜像加速下载固件 * + ${Next} A 自动选择 + ${Next} F Cloudflare Workers + ${Next} G Ghproxy -D 使用指定的下载器 * --decompress 解压 img.gz 固件后再更新固件 * --skip-verify 跳过固件 SHA256 校验 ${Red}(危险)${White} * @@ -653,15 +656,22 @@ function UPGRADE() { ;; -P | --proxy) case $2 in - A | F | G) - Proxy_Type=$2 + A) + Proxy_Type="All" + Special_Commands="${Special_Commands} [镜像加速 Automatic]" shift ;; - *) - Proxy_Type="All" + F) + Proxy_Type=$2 + Special_Commands="${Special_Commands} [CF Workers]" + shift + ;; + G) + Proxy_Type=$2 + Special_Commands="${Special_Commands} [Ghproxy]" + shift ;; esac - Special_Commands="${Special_Commands} [镜像加速 ${Proxy_Type}]" ;; -D) DL_DEPENDS=($2) @@ -785,14 +795,14 @@ $(echo -e "云端固件版本: ${CLOUD_FW_Version}${CHECKED_Type}") esac local URL case "${Proxy_Type}" in - A | F | G) + F | G) URL="$(Proxy_X ${CLOUD_FW_Url} ${Proxy_Type}@@5)" ;; All) - URL="$(Proxy_X ${CLOUD_FW_Url} G@@2 F@@1 A@@1 X@@1)" + URL="$(Proxy_X ${CLOUD_FW_Url} G@@2 F@@2 X@@1)" ;; *) - URL="$(Proxy_X ${CLOUD_FW_Url} X@@3 G@@1 F@@1 A@@1)" + URL="$(Proxy_X ${CLOUD_FW_Url} X@@3 G@@1 F@@1)" ;; esac DOWNLOADER --file-name ${CLOUD_FW_Name} --no-url-name --dl ${DL_DEPENDS[@]} --url ${URL} --path ${Firmware_Path} --timeout 15 --type 固件 @@ -1102,17 +1112,14 @@ function Proxy_X() { case "${Type}" in raw) - A=https://raw.fgit.cf/$(echo ${URL##*com/}) F=https://git.hyy2001.workers.dev/$(echo ${URL##*com/}) G=https://mirror.ghproxy.com/${URL} ;; release) - A=https://hub.fgit.cf/$(echo ${URL##*com/}) F=https://git.hyy2001.workers.dev/$(echo ${URL##*com/}) G=https://mirror.ghproxy.com/${URL} ;; codeload) - A=https://hub.fgit.cf/$(echo ${URL##*com/}) F=https://git.hyy2001.workers.dev/$(echo ${URL##*com/}) G=https://mirror.ghproxy.com/${URL} ;; @@ -1120,9 +1127,6 @@ function Proxy_X() { while [[ $1 ]];do local URL_Cache=$1 URL_Final case $1 in - A@@*) - URL_Final="${URL_Cache/A/${A}}" - ;; F@@*) URL_Final="${URL_Cache/F/${F}}" ;; diff --git a/btop/Makefile b/btop/Makefile index 605ad61c1..46e86ad49 100644 --- a/btop/Makefile +++ b/btop/Makefile @@ -1,7 +1,3 @@ -# SPDX-License-Identifier: GPL-3.0-only -# -# Copyright (C) 2022 ImmortalWrt.org - include $(TOPDIR)/rules.mk PKG_NAME:=btop @@ -37,11 +33,11 @@ define Package/btop/description C++ version and continuation of bashtop and bpytop. endef -PROG_LDFLAGS:=-pthread -DFMT_HEADER_ONLY -D_FILE_OFFSET_BITS=64 +BTOP_LDFLAGS:=-pthread -DFMT_HEADER_ONLY -D_FILE_OFFSET_BITS=64 MAKE_FLAGS+= \ PLATFORM=Linux \ OPTFLAGS="$(TARGET_CXXFLAGS)" \ - LDCXXFLAGS="$(TARGET_LDFLAGS) $(PROG_LDFLAGS)" + LDCXXFLAGS="$(TARGET_LDFLAGS) $(BTOP_LDFLAGS)" define Package/btop/install $(INSTALL_DIR) $(1)/usr/bin diff --git a/luci-app-autoupdate/Makefile b/luci-app-autoupdate/Makefile index 0c421ac36..86c991168 100755 --- a/luci-app-autoupdate/Makefile +++ b/luci-app-autoupdate/Makefile @@ -4,7 +4,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=luci-app-autoupdate PKG_VERSION:=9 -PKG_RELEASE:=2 +PKG_RELEASE:=3 LUCI_TITLE:=LuCI Support for autoupdate LUCI_DEPENDS:=+autoupdate diff --git a/luci-app-autoupdate/luasrc/model/cbi/autoupdate/main.lua b/luci-app-autoupdate/luasrc/model/cbi/autoupdate/main.lua index b1e601665..06c69c2a6 100755 --- a/luci-app-autoupdate/luasrc/model/cbi/autoupdate/main.lua +++ b/luci-app-autoupdate/luasrc/model/cbi/autoupdate/main.lua @@ -16,7 +16,7 @@ enable = s:option(Flag, "enable", translate("Enable"), translate("Automatically enable.default = 0 enable.optional = false -proxy = s:option(Flag, "proxy", translate("Preference Mirror Speedup"), translate("Preference Mirror for speeding up downloads while upgrading (For Mainland)")) +proxy = s:option(Flag, "proxy", translate("Preference Mirror Speedup"), translate("Preference Mirror for speeding up download")) proxy.default = 1 proxy:depends("enable", "1") proxy.optional = false @@ -24,8 +24,8 @@ proxy.optional = false proxy_type = s:option(ListValue, "proxy_type", translate("Mirror Station")) proxy_type.default = "A" proxy_type:value("A", translate("Automatic selection (Recommend)")) -proxy_type:value("G", translate("GitHub Proxy - Ghproxy (Maybe faster)")) -proxy_type:value("F", translate("FastGit UK")) +proxy_type:value("G", translate("GitHub Proxy")) +proxy_type:value("F", translate("CF Workers")) proxy_type:depends("proxy", "1") proxy_type.optional = false diff --git a/luci-app-autoupdate/po/zh-cn/autoupdate.po b/luci-app-autoupdate/po/zh-cn/autoupdate.po index 82253620c..8424323b7 100755 --- a/luci-app-autoupdate/po/zh-cn/autoupdate.po +++ b/luci-app-autoupdate/po/zh-cn/autoupdate.po @@ -25,14 +25,14 @@ msgstr "镜像站" msgid "Automatic selection (Recommend)" msgstr "自动选择 (推荐)" -msgid "GitHub Proxy - Ghproxy (Maybe faster)" -msgstr "GitHub Proxy - Ghproxy (也许更快)" +msgid "GitHub Proxy" +msgstr "GitHub Proxy - Ghproxy" -msgid "FastGit UK" -msgstr "FastGit UK" +msgid "CF Workers" +msgstr "Cloudflare Workers" -msgid "Preference Mirror for speeding up downloads while upgrading (For Mainland)" -msgstr "定时更新固件时优先启用镜像加速 (适用与被墙地区)" +msgid "Preference Mirror for speeding up download" +msgstr "优先使用镜像站加速下载" msgid "Advanced Settings" msgstr "高级设置" @@ -53,7 +53,7 @@ msgid "Upgrade without keeping config" msgstr "不保留配置" msgid "Please don't select it unless you know what you're doing!" -msgstr "请勿随意勾选除非你知道自己在做什么!" +msgstr "请勿随意勾选,除非你知道自己在做什么!" msgid "Recommend to set the AUTOUPDATE time to an uncommon time" msgstr "建议设置定时更新时间为设备不常用的时间" diff --git a/luci-app-autoupdate/po/zh_Hans/autoupdate.po b/luci-app-autoupdate/po/zh_Hans/autoupdate.po index a7b3b2580..8424323b7 100755 --- a/luci-app-autoupdate/po/zh_Hans/autoupdate.po +++ b/luci-app-autoupdate/po/zh_Hans/autoupdate.po @@ -25,14 +25,14 @@ msgstr "镜像站" msgid "Automatic selection (Recommend)" msgstr "自动选择 (推荐)" -msgid "GitHub Proxy - Ghproxy (Maybe faster)" -msgstr "GitHub Proxy - Ghproxy (也许更快)" +msgid "GitHub Proxy" +msgstr "GitHub Proxy - Ghproxy" -msgid "FastGit UK" -msgstr "FastGit UK" +msgid "CF Workers" +msgstr "Cloudflare Workers" -msgid "Preference Mirror for speeding up downloads while upgrading (For Mainland)" -msgstr "定时更新固件时优先启用镜像加速 (适用与被墙地区)" +msgid "Preference Mirror for speeding up download" +msgstr "优先使用镜像站加速下载" msgid "Advanced Settings" msgstr "高级设置" @@ -53,7 +53,7 @@ msgid "Upgrade without keeping config" msgstr "不保留配置" msgid "Please don't select it unless you know what you're doing!" -msgstr "请勿随意勾选除非你知道自己在做什么!" +msgstr "请勿随意勾选,除非你知道自己在做什么!" msgid "Recommend to set the AUTOUPDATE time to an uncommon time" msgstr "建议设置定时更新时间为设备不常用的时间" @@ -70,6 +70,9 @@ msgstr "用于检测固件版本更新以及下载固件的地址" msgid "Firmware Flag" msgstr "固件标签" +msgid "Log Path" +msgstr "日志路径" + msgid "Do Upgrade" msgstr "执行更新" diff --git a/luci-app-mosdns/Makefile b/luci-app-mosdns/Makefile index 9e81e03ae..c08215f89 100644 --- a/luci-app-mosdns/Makefile +++ b/luci-app-mosdns/Makefile @@ -1,7 +1,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=luci-app-mosdns -PKG_VERSION:=1.5.17 +PKG_VERSION:=1.5.18 PKG_RELEASE:=1 LUCI_TITLE:=LuCI Support for mosdns diff --git a/luci-app-mosdns/luasrc/model/cbi/mosdns/basic.lua b/luci-app-mosdns/luasrc/model/cbi/mosdns/basic.lua index e10da072a..4af0903eb 100644 --- a/luci-app-mosdns/luasrc/model/cbi/mosdns/basic.lua +++ b/luci-app-mosdns/luasrc/model/cbi/mosdns/basic.lua @@ -174,8 +174,7 @@ o.default = "geosite.dat" o:value("geosite.dat", "v2ray-geosite") o:value("https://raw.githubusercontent.com/privacy-protection-tools/anti-AD/master/anti-ad-domains.txt", "anti-AD") o:value("https://raw.githubusercontent.com/Cats-Team/AdRules/main/mosdns_adrules.txt", "Cats-Team/AdRules") -o:value("https://raw.githubusercontent.com/ookangzheng/dbl-oisd-nl/master/dbl_light.txt", "oisd (small)") -o:value("https://raw.githubusercontent.com/ookangzheng/dbl-oisd-nl/master/dbl.txt", "oisd (big)") +o:value("https://raw.githubusercontent.com/neodevpro/neodevhost/master/domain", "NEO DEV HOST") o = s:taboption("basic", Button, "_reload", translate("Restart-Service"), translate("Restart the MosDNS process to take effect of new configuration")) o.write = function() diff --git a/luci-app-mosdns/root/etc/init.d/mosdns b/luci-app-mosdns/root/etc/init.d/mosdns index f12b5a8ee..3d9f580bb 100755 --- a/luci-app-mosdns/root/etc/init.d/mosdns +++ b/luci-app-mosdns/root/etc/init.d/mosdns @@ -228,7 +228,9 @@ start_service() { if [ -f "/etc/mosdns/rule/.ad_source" ]; then for url in $ad_source; do - [ "$url" = "geosite.dat" ] && continue + if [ "$url" = "geosite.dat" ] || [ $(echo "$url" | grep -c -E "^file://") -eq 1 ]; then + continue + fi if [ $(grep -c "$url" "/etc/mosdns/rule/.ad_source") -eq 0 ]; then update_list=1 break diff --git a/luci-app-mosdns/root/usr/share/mosdns/mosdns.sh b/luci-app-mosdns/root/usr/share/mosdns/mosdns.sh index eb6411b8f..fa9ffca4c 100755 --- a/luci-app-mosdns/root/usr/share/mosdns/mosdns.sh +++ b/luci-app-mosdns/root/usr/share/mosdns/mosdns.sh @@ -54,10 +54,17 @@ get_adlist() ( adlist_update() { [ "$(uci -q get mosdns.config.adblock)" != 1 ] && exit 0 + lock_file=/var/lock/mosdns_ad_update.lock ad_source=$(uci -q get mosdns.config.ad_source) AD_TMPDIR=$(mktemp -d) || exit 1 mirror="" : > /etc/mosdns/rule/.ad_source + if [ -f "$lock_file" ]; then + has_update=0 + exit 0 + else + : > $lock_file + fi has_update=0 for url in $ad_source; do @@ -83,7 +90,7 @@ adlist_update() { \cp $AD_TMPDIR/* /etc/mosdns/rule/adlist } fi - rm -rf "$AD_TMPDIR" + rm -rf "$AD_TMPDIR" $lock_file } geodat_update() ( diff --git a/luci-app-passwall/Makefile b/luci-app-passwall/Makefile index c45a059b1..4ff6e386d 100644 --- a/luci-app-passwall/Makefile +++ b/luci-app-passwall/Makefile @@ -6,7 +6,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=luci-app-passwall -PKG_VERSION:=4.74-4 +PKG_VERSION:=4.75-1 PKG_RELEASE:= PKG_CONFIG_DEPENDS:= \ diff --git a/luci-app-passwall/luasrc/model/cbi/passwall/client/type/ray.lua b/luci-app-passwall/luasrc/model/cbi/passwall/client/type/ray.lua index 7d113d768..99bf43633 100644 --- a/luci-app-passwall/luasrc/model/cbi/passwall/client/type/ray.lua +++ b/luci-app-passwall/luasrc/model/cbi/passwall/client/type/ray.lua @@ -54,7 +54,8 @@ for k, e in ipairs(api.get_valid_nodes()) do if e.node_type == "normal" then nodes_table[#nodes_table + 1] = { id = e[".name"], - remarks = e["remark"] + remarks = e["remark"], + type = e["type"] } end if e.protocol == "_balancing" then @@ -80,11 +81,13 @@ local o = s:option(ListValue, option_name("balancingStrategy"), translate("Balan o:depends({ [option_name("protocol")] = "_balancing" }) o:value("random") o:value("leastPing") -o.default = "random" +o:value("leastLoad") +o.default = "leastLoad" -- 探测地址 local o = s:option(Flag, option_name("useCustomProbeUrl"), translate("Use Custome Probe URL"), translate("By default the built-in probe URL will be used, enable this option to use a custom probe URL.")) o:depends({ [option_name("balancingStrategy")] = "leastPing" }) +o:depends({ [option_name("balancingStrategy")] = "leastLoad" }) local o = s:option(Value, option_name("probeUrl"), translate("Probe URL")) o:depends({ [option_name("useCustomProbeUrl")] = true }) @@ -94,6 +97,7 @@ o.description = translate("The URL used to detect the connection status.") -- 探测间隔 local o = s:option(Value, option_name("probeInterval"), translate("Probe Interval")) o:depends({ [option_name("balancingStrategy")] = "leastPing" }) +o:depends({ [option_name("balancingStrategy")] = "leastLoad" }) o.default = "1m" o.description = translate("The interval between initiating probes. Every time this time elapses, a server status check is performed on a server. The time format is numbers + units, such as '10s', '2h45m', and the supported time units are ns, us, ms, s, m, h, which correspond to nanoseconds, microseconds, milliseconds, seconds, minutes, and hours, respectively.") @@ -522,4 +526,21 @@ o.default = 0 o = s:option(Flag, option_name("tcpNoDelay"), "tcpNoDelay") o.default = 0 +o = s:option(ListValue, option_name("to_node"), translate("Landing node"), translate("Only support a layer of proxy.")) +o.default = "" +o:value("", translate("Close(Not use)")) +for k, v in pairs(nodes_table) do + if v.type == "Xray" then + o:value(v.id, v.remarks) + end +end + +for i, v in ipairs(s.fields[option_name("protocol")].keylist) do + if not v:find("_") then + s.fields[option_name("tcpMptcp")]:depends({ [option_name("protocol")] = v }) + s.fields[option_name("tcpNoDelay")]:depends({ [option_name("protocol")] = v }) + s.fields[option_name("to_node")]:depends({ [option_name("protocol")] = v }) + end +end + api.luci_types(arg[1], m, s, type_name, option_prefix) diff --git a/luci-app-passwall/luasrc/model/cbi/passwall/client/type/sing-box.lua b/luci-app-passwall/luasrc/model/cbi/passwall/client/type/sing-box.lua index 65c67da40..d6186976f 100644 --- a/luci-app-passwall/luasrc/model/cbi/passwall/client/type/sing-box.lua +++ b/luci-app-passwall/luasrc/model/cbi/passwall/client/type/sing-box.lua @@ -65,13 +65,13 @@ o.default = "eth1" o:depends({ [option_name("protocol")] = "_iface" }) local nodes_table = {} -local balancers_table = {} local iface_table = {} for k, e in ipairs(api.get_valid_nodes()) do if e.node_type == "normal" then nodes_table[#nodes_table + 1] = { id = e[".name"], - remarks = e["remark"] + remarks = e["remark"], + type = e["type"] } end if e.protocol == "_iface" then @@ -89,9 +89,6 @@ if #nodes_table > 0 then o = s:option(Value, option_name("main_node"), string.format('%s', translate("Preproxy Node")), translate("Set the node to be used as a pre-proxy. Each rule (including Default) has a separate switch that controls whether this rule uses the pre-proxy or not.")) o:depends({ [option_name("protocol")] = "_shunt", [option_name("preproxy_enabled")] = true }) - for k, v in pairs(balancers_table) do - o:value(v.id, v.remarks) - end for k, v in pairs(iface_table) do o:value(v.id, v.remarks) end @@ -110,9 +107,6 @@ uci:foreach(appname, "shunt_rules", function(e) o:depends({ [option_name("protocol")] = "_shunt" }) if #nodes_table > 0 then - for k, v in pairs(balancers_table) do - o:value(v.id, v.remarks) - end for k, v in pairs(iface_table) do o:value(v.id, v.remarks) end @@ -142,9 +136,6 @@ o:value("_direct", translate("Direct Connection")) o:value("_blackhole", translate("Blackhole")) if #nodes_table > 0 then - for k, v in pairs(balancers_table) do - o:value(v.id, v.remarks) - end for k, v in pairs(iface_table) do o:value(v.id, v.remarks) end @@ -631,4 +622,18 @@ o:value("prefer_ipv6") o:value("ipv4_only") o:value("ipv6_only") +o = s:option(ListValue, option_name("to_node"), translate("Landing node"), translate("Only support a layer of proxy.")) +o.default = "" +o:value("", translate("Close(Not use)")) +for k, v in pairs(nodes_table) do + if v.type == "sing-box" then + o:value(v.id, v.remarks) + end +end +for i, v in ipairs(s.fields[option_name("protocol")].keylist) do + if not v:find("_") then + o:depends({ [option_name("protocol")] = v }) + end +end + api.luci_types(arg[1], m, s, type_name, option_prefix) diff --git a/luci-app-passwall/luasrc/passwall/util_sing-box.lua b/luci-app-passwall/luasrc/passwall/util_sing-box.lua index e7b57c018..a659a910a 100644 --- a/luci-app-passwall/luasrc/passwall/util_sing-box.lua +++ b/luci-app-passwall/luasrc/passwall/util_sing-box.lua @@ -875,6 +875,53 @@ function gen_config(var) table.insert(inbounds, inbound) end + local function set_outbound_detour(node, outbound, outbounds_table, shunt_rule_name) + if not node or not outbound or not outbounds_table then return nil end + local default_outTag = outbound.tag + + if node.shadowtls == "1" then + local _node = { + type = "sing-box", + protocol = "shadowtls", + shadowtls_version = node.shadowtls_version, + password = (node.shadowtls_version == "2" or node.shadowtls_version == "3") and node.shadowtls_password or nil, + address = node.address, + port = node.port, + tls = "1", + tls_serverName = node.shadowtls_serverName, + utls = node.shadowtls_utls, + fingerprint = node.shadowtls_fingerprint + } + local shadowtls_outbound = gen_outbound(nil, _node, outbound.tag .. "_shadowtls") + if shadowtls_outbound then + table.insert(outbounds_table, shadowtls_outbound) + outbound.detour = outbound.tag .. "_shadowtls" + outbound.server = nil + outbound.server_port = nil + end + end + + if node.to_node then + local to_node = uci:get_all(appname, node.to_node) + if to_node then + local to_outbound = gen_outbound(nil, to_node) + if to_outbound then + if shunt_rule_name then + to_outbound.tag = outbound.tag + outbound.tag = node[".name"] + else + to_outbound.tag = outbound.tag .. " -> " .. to_outbound.tag + end + + to_outbound.detour = outbound.tag + table.insert(outbounds_table, to_outbound) + default_outTag = to_outbound.tag + end + end + end + return default_outTag + end + if node.protocol == "_shunt" then local rules = {} @@ -903,34 +950,14 @@ function gen_config(var) elseif preproxy_node and api.is_normal_node(preproxy_node) then local preproxy_outbound = gen_outbound(flag, preproxy_node, preproxy_tag) if preproxy_outbound then - if preproxy_node.shadowtls == "1" then - local _node = { - type = "sing-box", - protocol = "shadowtls", - shadowtls_version = preproxy_node.shadowtls_version, - password = (preproxy_node.shadowtls_version == "2" or preproxy_node.shadowtls_version == "3") and preproxy_node.shadowtls_password or nil, - address = preproxy_node.address, - port = preproxy_node.port, - tls = "1", - tls_serverName = preproxy_node.shadowtls_serverName, - utls = preproxy_node.shadowtls_utls, - fingerprint = preproxy_node.shadowtls_fingerprint - } - local shadowtls_outbound = gen_outbound(flag, _node, preproxy_tag .. "_shadowtls") - if shadowtls_outbound then - table.insert(outbounds, shadowtls_outbound) - preproxy_outbound.detour = preproxy_outbound.tag .. "_shadowtls" - preproxy_outbound.server = nil - preproxy_outbound.server_port = nil - end - end + set_outbound_detour(preproxy_node, preproxy_outbound, outbounds, preproxy_tag) table.insert(outbounds, preproxy_outbound) else preproxy_enabled = false end end - local function gen_shunt_node(rule_name, _node_id, as_proxy) + local function gen_shunt_node(rule_name, _node_id) if not rule_name then return nil, nil end if not _node_id then _node_id = node[rule_name] or "nil" end local rule_outboundTag @@ -1002,27 +1029,7 @@ function gen_config(var) end local _outbound = gen_outbound(flag, _node, rule_name, { proxy = proxy and 1 or 0, tag = proxy and preproxy_tag or nil }) if _outbound then - if _node.shadowtls == "1" then - local shadowtls_node = { - type = "sing-box", - protocol = "shadowtls", - shadowtls_version = _node.shadowtls_version, - password = (_node.shadowtls_version == "2" or _node.shadowtls_version == "3") and _node.shadowtls_password or nil, - address = _node.address, - port = _node.port, - tls = "1", - tls_serverName = _node.shadowtls_serverName, - utls = _node.shadowtls_utls, - fingerprint = _node.shadowtls_fingerprint - } - local shadowtls_outbound = gen_outbound(flag, shadowtls_node, rule_name .. "_shadowtls", { proxy = proxy and 1 or 0, tag = proxy and preproxy_tag or nil }) - if shadowtls_outbound then - table.insert(outbounds, shadowtls_outbound) - _outbound.detour = _outbound.tag .. "_shadowtls" - _outbound.server = nil - _outbound.server_port = nil - end - end + set_outbound_detour(_node, _outbound, outbounds, rule_name) table.insert(outbounds, _outbound) rule_outboundTag = rule_name end @@ -1201,46 +1208,23 @@ function gen_config(var) for index, value in ipairs(rules) do table.insert(route.rules, rules[index]) end - else - local outbound = nil - if node.protocol == "_iface" then - if node.iface then - outbound = { - type = "direct", - tag = node_id, - bind_interface = node.iface, - routing_mark = 255, - } - sys.call("touch /tmp/etc/passwall/iface/" .. node.iface) - end - else - outbound = gen_outbound(flag, node) - if outbound then - if node.shadowtls == "1" then - local shadowtls_node = { - type = "sing-box", - protocol = "shadowtls", - shadowtls_version = node.shadowtls_version, - password = (node.shadowtls_version == "2" or node.shadowtls_version == "3") and node.shadowtls_password or nil, - address = node.address, - port = node.port, - tls = "1", - tls_serverName = node.shadowtls_serverName, - utls = node.shadowtls_utls, - fingerprint = node.shadowtls_fingerprint - } - local shadowtls_outbound = gen_outbound(flag, shadowtls_node, outbound.tag .. "_shadowtls") - if shadowtls_outbound then - table.insert(outbounds, shadowtls_outbound) - outbound.detour = outbound.tag .. "_shadowtls" - outbound.server = nil - outbound.server_port = nil - end - end - end - end - if outbound then + elseif node.protocol == "_iface" then + if node.iface then + local outbound = { + type = "direct", + tag = node_id, + bind_interface = node.iface, + routing_mark = 255, + } + table.insert(outbounds, outbound) default_outTag = outbound.tag + route.final = default_outTag + sys.call("touch /tmp/etc/passwall/iface/" .. node.iface) + end + else + local outbound = gen_outbound(flag, node) + if outbound then + default_outTag = set_outbound_detour(node, outbound, outbounds) table.insert(outbounds, outbound) route.final = default_outTag end diff --git a/luci-app-passwall/luasrc/passwall/util_xray.lua b/luci-app-passwall/luasrc/passwall/util_xray.lua index 8514b3c12..7e8ba6d5a 100644 --- a/luci-app-passwall/luasrc/passwall/util_xray.lua +++ b/luci-app-passwall/luasrc/passwall/util_xray.lua @@ -248,6 +248,11 @@ function gen_outbound(flag, node, tag, proxy_table) reserved = (node.protocol == "wireguard" and node.wireguard_reserved) and node.wireguard_reserved or nil } } + + if node.protocol == "wireguard" then + result.settings.kernelMode = false + end + local alpn = {} if node.alpn and node.alpn ~= "default" then string.gsub(node.alpn, '[^' .. "," .. ']+', function(w) @@ -665,7 +670,7 @@ function gen_config(var) selector = valid_nodes, strategy = { type = _node.balancingStrategy or "random" } } - if _node.balancingStrategy == "leastPing" then + if _node.balancingStrategy == "leastPing" or _node.balancingStrategy == "leastLoad" then if not observatory then observatory = { subjectSelector = { "blc-" }, @@ -692,6 +697,34 @@ function gen_config(var) return balancer, rule end + local function set_outbound_detour(node, outbound, outbounds_table, shunt_rule_name) + if not node or not outbound or not outbounds_table then return nil end + local default_outTag = outbound.tag + + if node.to_node then + local to_node = uci:get_all(appname, node.to_node) + if to_node then + local to_outbound = gen_outbound(nil, to_node) + if to_outbound then + if shunt_rule_name then + to_outbound.tag = outbound.tag + outbound.tag = node[".name"] + else + to_outbound.tag = outbound.tag .. " -> " .. to_outbound.tag + end + + to_outbound.proxySettings = { + tag = outbound.tag, + transportLayer = true + } + table.insert(outbounds_table, to_outbound) + default_outTag = to_outbound.tag + end + end + end + return default_outTag + end + if node.protocol == "_shunt" then local rules = {} local balancers = {} @@ -723,6 +756,7 @@ function gen_config(var) elseif preproxy_node and api.is_normal_node(preproxy_node) then local preproxy_outbound = gen_outbound(flag, preproxy_node, preproxy_tag, { fragment = xray_settings.fragment == "1" or nil }) if preproxy_outbound then + set_outbound_detour(preproxy_node, preproxy_outbound, outbounds, preproxy_tag) table.insert(outbounds, preproxy_outbound) else preproxy_enabled = false @@ -738,7 +772,7 @@ function gen_config(var) end end - local function gen_shunt_node(rule_name, _node_id, as_proxy) + local function gen_shunt_node(rule_name, _node_id) if not rule_name then return nil, nil end if not _node_id then _node_id = node[rule_name] or "nil" end local rule_outboundTag @@ -832,6 +866,7 @@ function gen_config(var) end local _outbound = gen_outbound(flag, _node, rule_name, proxy_table) if _outbound then + set_outbound_detour(_node, _outbound, outbounds, rule_name) table.insert(outbounds, _outbound) if proxy then preproxy_used = true end rule_outboundTag = rule_name @@ -984,26 +1019,27 @@ function gen_config(var) } } end - else - local outbound = nil - if node.protocol == "_iface" then - if node.iface then - outbound = { - protocol = "freedom", - tag = "outbound", - streamSettings = { - sockopt = { - mark = 255, - interface = node.iface - } + elseif node.protocol == "_iface" then + if node.iface then + local outbound = { + protocol = "freedom", + tag = "outbound", + streamSettings = { + sockopt = { + mark = 255, + interface = node.iface } } - sys.call("touch /tmp/etc/passwall/iface/" .. node.iface) - end - else - outbound = gen_outbound(flag, node, nil, { fragment = xray_settings.fragment == "1" or nil }) + } + table.insert(outbounds, outbound) + sys.call("touch /tmp/etc/passwall/iface/" .. node.iface) + end + else + local outbound = gen_outbound(flag, node, nil, { fragment = xray_settings.fragment == "1" or nil }) + if outbound then + set_outbound_detour(node, outbound, outbounds) + table.insert(outbounds, outbound) end - if outbound then table.insert(outbounds, outbound) end routing = { domainStrategy = "AsIs", domainMatcher = "hybrid", diff --git a/luci-app-passwall/po/zh-cn/passwall.po b/luci-app-passwall/po/zh-cn/passwall.po index 5286a2da1..69f99ed12 100644 --- a/luci-app-passwall/po/zh-cn/passwall.po +++ b/luci-app-passwall/po/zh-cn/passwall.po @@ -1569,3 +1569,9 @@ msgstr "分片间隔(ms)" msgid "If is domain name, The requested domain name will be resolved to IP before connect." msgstr "如果是域名,域名将在请求发出之前解析为 IP。" + +msgid "Landing node" +msgstr "落地节点" + +msgid "Only support a layer of proxy." +msgstr "仅支持一层代理。" diff --git a/luci-app-passwall/root/usr/share/passwall/rules/proxy_ip b/luci-app-passwall/root/usr/share/passwall/rules/proxy_ip index 39be0de29..88309f8da 100644 --- a/luci-app-passwall/root/usr/share/passwall/rules/proxy_ip +++ b/luci-app-passwall/root/usr/share/passwall/rules/proxy_ip @@ -7,6 +7,8 @@ 8.8.8.8 208.67.222.222 208.67.220.220 +104.16.249.249 +104.16.248.249 1.1.1.1 1.1.1.2 1.0.0.1 @@ -16,4 +18,4 @@ 2001:b28:f23c::/48 2001:b28:f23d::/48 2001:b28:f23f::/48 -2001:b28:f242::/48 \ No newline at end of file +2001:b28:f242::/48 diff --git a/luci-app-passwall2/Makefile b/luci-app-passwall2/Makefile index 95b9a9c46..40b6b169d 100644 --- a/luci-app-passwall2/Makefile +++ b/luci-app-passwall2/Makefile @@ -5,7 +5,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=luci-app-passwall2 -PKG_VERSION:=1.26-3 +PKG_VERSION:=1.27-1 PKG_RELEASE:= PKG_CONFIG_DEPENDS:= \ diff --git a/luci-app-passwall2/luasrc/model/cbi/passwall2/client/type/ray.lua b/luci-app-passwall2/luasrc/model/cbi/passwall2/client/type/ray.lua index 4953985d7..19afae3ab 100644 --- a/luci-app-passwall2/luasrc/model/cbi/passwall2/client/type/ray.lua +++ b/luci-app-passwall2/luasrc/model/cbi/passwall2/client/type/ray.lua @@ -54,7 +54,8 @@ for k, e in ipairs(api.get_valid_nodes()) do if e.node_type == "normal" then nodes_table[#nodes_table + 1] = { id = e[".name"], - remarks = e["remark"] + remarks = e["remark"], + type = e["type"] } end if e.protocol == "_balancing" then @@ -80,11 +81,13 @@ local o = s:option(ListValue, option_name("balancingStrategy"), translate("Balan o:depends({ [option_name("protocol")] = "_balancing" }) o:value("random") o:value("leastPing") -o.default = "random" +o:value("leastLoad") +o.default = "leastLoad" -- 探测地址 local o = s:option(Flag, option_name("useCustomProbeUrl"), translate("Use Custome Probe URL"), translate("By default the built-in probe URL will be used, enable this option to use a custom probe URL.")) o:depends({ [option_name("balancingStrategy")] = "leastPing" }) +o:depends({ [option_name("balancingStrategy")] = "leastLoad" }) local o = s:option(Value, option_name("probeUrl"), translate("Probe URL")) o:depends({ [option_name("useCustomProbeUrl")] = true }) @@ -94,6 +97,7 @@ o.description = translate("The URL used to detect the connection status.") -- 探测间隔 local o = s:option(Value, option_name("probeInterval"), translate("Probe Interval")) o:depends({ [option_name("balancingStrategy")] = "leastPing" }) +o:depends({ [option_name("balancingStrategy")] = "leastLoad" }) o.default = "1m" o.description = translate("The interval between initiating probes. Every time this time elapses, a server status check is performed on a server. The time format is numbers + units, such as '10s', '2h45m', and the supported time units are ns, us, ms, s, m, h, which correspond to nanoseconds, microseconds, milliseconds, seconds, minutes, and hours, respectively.") @@ -523,4 +527,21 @@ o.default = 0 o = s:option(Flag, option_name("tcpNoDelay"), "tcpNoDelay") o.default = 0 +o = s:option(ListValue, option_name("to_node"), translate("Landing node"), translate("Only support a layer of proxy.")) +o.default = "" +o:value("", translate("Close(Not use)")) +for k, v in pairs(nodes_table) do + if v.type == "Xray" then + o:value(v.id, v.remarks) + end +end + +for i, v in ipairs(s.fields[option_name("protocol")].keylist) do + if not v:find("_") then + s.fields[option_name("tcpMptcp")]:depends({ [option_name("protocol")] = v }) + s.fields[option_name("tcpNoDelay")]:depends({ [option_name("protocol")] = v }) + s.fields[option_name("to_node")]:depends({ [option_name("protocol")] = v }) + end +end + api.luci_types(arg[1], m, s, type_name, option_prefix) diff --git a/luci-app-passwall2/luasrc/model/cbi/passwall2/client/type/sing-box.lua b/luci-app-passwall2/luasrc/model/cbi/passwall2/client/type/sing-box.lua index 89c0c0b3a..611a884a7 100644 --- a/luci-app-passwall2/luasrc/model/cbi/passwall2/client/type/sing-box.lua +++ b/luci-app-passwall2/luasrc/model/cbi/passwall2/client/type/sing-box.lua @@ -65,13 +65,13 @@ o.default = "eth1" o:depends({ [option_name("protocol")] = "_iface" }) local nodes_table = {} -local balancers_table = {} local iface_table = {} for k, e in ipairs(api.get_valid_nodes()) do if e.node_type == "normal" then nodes_table[#nodes_table + 1] = { id = e[".name"], - remarks = e["remark"] + remarks = e["remark"], + type = e["type"] } end if e.protocol == "_iface" then @@ -89,9 +89,6 @@ if #nodes_table > 0 then o = s:option(Value, option_name("main_node"), string.format('%s', translate("Preproxy Node")), translate("Set the node to be used as a pre-proxy. Each rule (including Default) has a separate switch that controls whether this rule uses the pre-proxy or not.")) o:depends({ [option_name("protocol")] = "_shunt", [option_name("preproxy_enabled")] = true }) - for k, v in pairs(balancers_table) do - o:value(v.id, v.remarks) - end for k, v in pairs(iface_table) do o:value(v.id, v.remarks) end @@ -110,9 +107,6 @@ uci:foreach(appname, "shunt_rules", function(e) o:depends({ [option_name("protocol")] = "_shunt" }) if #nodes_table > 0 then - for k, v in pairs(balancers_table) do - o:value(v.id, v.remarks) - end for k, v in pairs(iface_table) do o:value(v.id, v.remarks) end @@ -142,9 +136,6 @@ o:value("_direct", translate("Direct Connection")) o:value("_blackhole", translate("Blackhole")) if #nodes_table > 0 then - for k, v in pairs(balancers_table) do - o:value(v.id, v.remarks) - end for k, v in pairs(iface_table) do o:value(v.id, v.remarks) end @@ -631,4 +622,18 @@ o:value("prefer_ipv6") o:value("ipv4_only") o:value("ipv6_only") +o = s:option(ListValue, option_name("to_node"), translate("Landing node"), translate("Only support a layer of proxy.")) +o.default = "" +o:value("", translate("Close(Not use)")) +for k, v in pairs(nodes_table) do + if v.type == "sing-box" then + o:value(v.id, v.remarks) + end +end +for i, v in ipairs(s.fields[option_name("protocol")].keylist) do + if not v:find("_") then + o:depends({ [option_name("protocol")] = v }) + end +end + api.luci_types(arg[1], m, s, type_name, option_prefix) diff --git a/luci-app-passwall2/luasrc/passwall2/util_sing-box.lua b/luci-app-passwall2/luasrc/passwall2/util_sing-box.lua index 32371a478..77c1e220c 100644 --- a/luci-app-passwall2/luasrc/passwall2/util_sing-box.lua +++ b/luci-app-passwall2/luasrc/passwall2/util_sing-box.lua @@ -872,6 +872,54 @@ function gen_config(var) node.address = server_host node.port = server_port end + + local function set_outbound_detour(node, outbound, outbounds_table, shunt_rule_name) + if not node or not outbound or not outbounds_table then return nil end + local default_outTag = outbound.tag + + if node.shadowtls == "1" then + local _node = { + type = "sing-box", + protocol = "shadowtls", + shadowtls_version = node.shadowtls_version, + password = (node.shadowtls_version == "2" or node.shadowtls_version == "3") and node.shadowtls_password or nil, + address = node.address, + port = node.port, + tls = "1", + tls_serverName = node.shadowtls_serverName, + utls = node.shadowtls_utls, + fingerprint = node.shadowtls_fingerprint + } + local shadowtls_outbound = gen_outbound(nil, _node, outbound.tag .. "_shadowtls") + if shadowtls_outbound then + table.insert(outbounds_table, shadowtls_outbound) + outbound.detour = outbound.tag .. "_shadowtls" + outbound.server = nil + outbound.server_port = nil + end + end + + if node.to_node then + local to_node = uci:get_all(appname, node.to_node) + if to_node then + local to_outbound = gen_outbound(nil, to_node) + if to_outbound then + if shunt_rule_name then + to_outbound.tag = outbound.tag + outbound.tag = node[".name"] + else + to_outbound.tag = outbound.tag .. " -> " .. to_outbound.tag + end + + to_outbound.detour = outbound.tag + table.insert(outbounds_table, to_outbound) + default_outTag = to_outbound.tag + end + end + end + return default_outTag + end + if node.protocol == "_shunt" then local rules = {} @@ -900,34 +948,14 @@ function gen_config(var) elseif preproxy_node and api.is_normal_node(preproxy_node) then local preproxy_outbound = gen_outbound(flag, preproxy_node, preproxy_tag) if preproxy_outbound then - if preproxy_node.shadowtls == "1" then - local _node = { - type = "sing-box", - protocol = "shadowtls", - shadowtls_version = preproxy_node.shadowtls_version, - password = (preproxy_node.shadowtls_version == "2" or preproxy_node.shadowtls_version == "3") and preproxy_node.shadowtls_password or nil, - address = preproxy_node.address, - port = preproxy_node.port, - tls = "1", - tls_serverName = preproxy_node.shadowtls_serverName, - utls = preproxy_node.shadowtls_utls, - fingerprint = preproxy_node.shadowtls_fingerprint - } - local shadowtls_outbound = gen_outbound(flag, _node, preproxy_tag .. "_shadowtls") - if shadowtls_outbound then - table.insert(outbounds, shadowtls_outbound) - preproxy_outbound.detour = preproxy_outbound.tag .. "_shadowtls" - preproxy_outbound.server = nil - preproxy_outbound.server_port = nil - end - end + set_outbound_detour(preproxy_node, preproxy_outbound, outbounds, preproxy_tag) table.insert(outbounds, preproxy_outbound) else preproxy_enabled = false end end - local function gen_shunt_node(rule_name, _node_id, as_proxy) + local function gen_shunt_node(rule_name, _node_id) if not rule_name then return nil, nil end if not _node_id then _node_id = node[rule_name] or "nil" end local rule_outboundTag @@ -999,27 +1027,7 @@ function gen_config(var) end local _outbound = gen_outbound(flag, _node, rule_name, { proxy = proxy and 1 or 0, tag = proxy and preproxy_tag or nil }) if _outbound then - if _node.shadowtls == "1" then - local shadowtls_node = { - type = "sing-box", - protocol = "shadowtls", - shadowtls_version = _node.shadowtls_version, - password = (_node.shadowtls_version == "2" or _node.shadowtls_version == "3") and _node.shadowtls_password or nil, - address = _node.address, - port = _node.port, - tls = "1", - tls_serverName = _node.shadowtls_serverName, - utls = _node.shadowtls_utls, - fingerprint = _node.shadowtls_fingerprint - } - local shadowtls_outbound = gen_outbound(flag, shadowtls_node, rule_name .. "_shadowtls", { proxy = proxy and 1 or 0, tag = proxy and preproxy_tag or nil }) - if shadowtls_outbound then - table.insert(outbounds, shadowtls_outbound) - _outbound.detour = _outbound.tag .. "_shadowtls" - _outbound.server = nil - _outbound.server_port = nil - end - end + set_outbound_detour(_node, _outbound, outbounds, rule_name) table.insert(outbounds, _outbound) rule_outboundTag = rule_name end @@ -1196,46 +1204,23 @@ function gen_config(var) for index, value in ipairs(rules) do table.insert(route.rules, rules[index]) end - else - local outbound = nil - if node.protocol == "_iface" then - if node.iface then - outbound = { - type = "direct", - tag = node_id, - bind_interface = node.iface, - routing_mark = 255, - } - sys.call("touch /tmp/etc/passwall2/iface/" .. node.iface) - end - else - outbound = gen_outbound(flag, node) - if outbound then - if node.shadowtls == "1" then - local shadowtls_node = { - type = "sing-box", - protocol = "shadowtls", - shadowtls_version = node.shadowtls_version, - password = (node.shadowtls_version == "2" or node.shadowtls_version == "3") and node.shadowtls_password or nil, - address = node.address, - port = node.port, - tls = "1", - tls_serverName = node.shadowtls_serverName, - utls = node.shadowtls_utls, - fingerprint = node.shadowtls_fingerprint - } - local shadowtls_outbound = gen_outbound(flag, shadowtls_node, outbound.tag .. "_shadowtls") - if shadowtls_outbound then - table.insert(outbounds, shadowtls_outbound) - outbound.detour = outbound.tag .. "_shadowtls" - outbound.server = nil - outbound.server_port = nil - end - end - end - end - if outbound then + elseif node.protocol == "_iface" then + if node.iface then + local outbound = { + type = "direct", + tag = node_id, + bind_interface = node.iface, + routing_mark = 255, + } + table.insert(outbounds, outbound) default_outTag = outbound.tag + route.final = default_outTag + sys.call("touch /tmp/etc/passwall2/iface/" .. node.iface) + end + else + local outbound = gen_outbound(flag, node) + if outbound then + default_outTag = set_outbound_detour(node, outbound, outbounds) table.insert(outbounds, outbound) route.final = default_outTag end diff --git a/luci-app-passwall2/luasrc/passwall2/util_xray.lua b/luci-app-passwall2/luasrc/passwall2/util_xray.lua index 676271308..8004731c3 100644 --- a/luci-app-passwall2/luasrc/passwall2/util_xray.lua +++ b/luci-app-passwall2/luasrc/passwall2/util_xray.lua @@ -245,6 +245,11 @@ function gen_outbound(flag, node, tag, proxy_table) reserved = (node.protocol == "wireguard" and node.wireguard_reserved) and node.wireguard_reserved or nil } } + + if node.protocol == "wireguard" then + result.settings.kernelMode = false + end + local alpn = {} if node.alpn and node.alpn ~= "default" then string.gsub(node.alpn, '[^' .. "," .. ']+', function(w) @@ -658,7 +663,7 @@ function gen_config(var) selector = valid_nodes, strategy = { type = _node.balancingStrategy or "random" } } - if _node.balancingStrategy == "leastPing" then + if _node.balancingStrategy == "leastPing" or _node.balancingStrategy == "leastLoad" then if not observatory then observatory = { subjectSelector = { "blc-" }, @@ -685,6 +690,34 @@ function gen_config(var) return balancer, rule end + local function set_outbound_detour(node, outbound, outbounds_table, shunt_rule_name) + if not node or not outbound or not outbounds_table then return nil end + local default_outTag = outbound.tag + + if node.to_node then + local to_node = uci:get_all(appname, node.to_node) + if to_node then + local to_outbound = gen_outbound(nil, to_node) + if to_outbound then + if shunt_rule_name then + to_outbound.tag = outbound.tag + outbound.tag = node[".name"] + else + to_outbound.tag = outbound.tag .. " -> " .. to_outbound.tag + end + + to_outbound.proxySettings = { + tag = outbound.tag, + transportLayer = true + } + table.insert(outbounds_table, to_outbound) + default_outTag = to_outbound.tag + end + end + end + return default_outTag + end + for k, v in pairs(nodes) do if server_host and server_port then v.address = server_host @@ -722,6 +755,7 @@ function gen_config(var) elseif preproxy_node and api.is_normal_node(preproxy_node) then local preproxy_outbound = gen_outbound(flag, preproxy_node, preproxy_tag, { fragment = xray_settings.fragment == "1" or nil }) if preproxy_outbound then + set_outbound_detour(preproxy_node, preproxy_outbound, outbounds, preproxy_tag) table.insert(outbounds, preproxy_outbound) else preproxy_enabled = false @@ -737,7 +771,7 @@ function gen_config(var) end end - local function gen_shunt_node(rule_name, _node_id, as_proxy) + local function gen_shunt_node(rule_name, _node_id) if not rule_name then return nil, nil end if not _node_id then _node_id = node[rule_name] or "nil" end local rule_outboundTag @@ -831,6 +865,7 @@ function gen_config(var) end local _outbound = gen_outbound(flag, _node, rule_name, proxy_table) if _outbound then + set_outbound_detour(_node, _outbound, outbounds, rule_name) table.insert(outbounds, _outbound) if proxy then preproxy_used = true end rule_outboundTag = rule_name @@ -991,39 +1026,39 @@ function gen_config(var) } } end - else - local outbound = nil - if node.protocol == "_iface" then - if node.iface then - outbound = { - protocol = "freedom", - tag = "outbound", - streamSettings = { - sockopt = { - mark = 255, - interface = node.iface - } + elseif node.protocol == "_iface" then + if node.iface then + local outbound = { + protocol = "freedom", + tag = "outbound", + streamSettings = { + sockopt = { + mark = 255, + interface = node.iface } } - sys.call("touch /tmp/etc/passwall2/iface/" .. node.iface) - end - else - outbound = gen_outbound(flag, node, nil, { fragment = xray_settings.fragment == "1" or nil }) + } + table.insert(outbounds, outbound) + sys.call("touch /tmp/etc/passwall2/iface/" .. node.iface) + end + else + local outbound = gen_outbound(flag, node, nil, { fragment = xray_settings.fragment == "1" or nil }) + if outbound then + local default_outTag = set_outbound_detour(node, outbound, outbounds) + table.insert(outbounds, outbound) + routing = { + domainStrategy = "AsIs", + domainMatcher = "hybrid", + rules = {} + } + table.insert(routing.rules, { + _flag = "default", + type = "field", + outboundTag = default_outTag, + network = "tcp,udp" + }) end - if outbound then table.insert(outbounds, outbound) end - routing = { - domainStrategy = "AsIs", - domainMatcher = "hybrid", - rules = {} - } - table.insert(routing.rules, { - _flag = "default", - type = "field", - outboundTag = node_id, - network = "tcp,udp" - }) end - end if remote_dns_udp_server then diff --git a/luci-app-passwall2/po/zh-cn/passwall2.po b/luci-app-passwall2/po/zh-cn/passwall2.po index 4cec1a69d..7b6d6f0f6 100644 --- a/luci-app-passwall2/po/zh-cn/passwall2.po +++ b/luci-app-passwall2/po/zh-cn/passwall2.po @@ -1482,3 +1482,9 @@ msgstr "分片间隔(ms)" msgid "If is domain name, The requested domain name will be resolved to IP before connect." msgstr "如果是域名,域名将在请求发出之前解析为 IP。" + +msgid "Landing node" +msgstr "落地节点" + +msgid "Only support a layer of proxy." +msgstr "仅支持一层代理。" diff --git a/luci-app-ssr-plus/luasrc/view/shadowsocksr/check.htm b/luci-app-ssr-plus/luasrc/view/shadowsocksr/check.htm index 5f6a673a6..4a16adce6 100644 --- a/luci-app-ssr-plus/luasrc/view/shadowsocksr/check.htm +++ b/luci-app-ssr-plus/luasrc/view/shadowsocksr/check.htm @@ -13,9 +13,9 @@ if (s) { if (rv.ret=="0") - s.innerHTML =""+"<%:Connect OK%>"+""; + s.innerHTML =""+"<%:Connect OK%>"+""; else - s.innerHTML =""+"<%:Connect Error%>"+""; + s.innerHTML =""+"<%:Connect Error%>"+""; } btn.disabled = false; btn.value = '<%:Check Connect%>'; diff --git a/luci-app-ssr-plus/luasrc/view/shadowsocksr/refresh.htm b/luci-app-ssr-plus/luasrc/view/shadowsocksr/refresh.htm index da89fd537..ea4113d87 100644 --- a/luci-app-ssr-plus/luasrc/view/shadowsocksr/refresh.htm +++ b/luci-app-ssr-plus/luasrc/view/shadowsocksr/refresh.htm @@ -15,13 +15,13 @@ switch (rv.ret) { case 0: - s.innerHTML =""+"<%:Refresh OK!%> "+"<%:Total Records:%>"+rv.retcount+""; + s.innerHTML =""+"<%:Refresh OK!%> "+"<%:Total Records:%>"+rv.retcount+""; break; case 1: - s.innerHTML =""+"<%:No new data!%> "+""; + s.innerHTML =""+"<%:No new data!%> "+""; break; default: - s.innerHTML =""+"<%:Refresh Error!%> "+""; + s.innerHTML =""+"<%:Refresh Error!%> "+""; break; } } diff --git a/luci-app-ssr-plus/luasrc/view/shadowsocksr/reset.htm b/luci-app-ssr-plus/luasrc/view/shadowsocksr/reset.htm index 1882ac568..ff0c4860f 100644 --- a/luci-app-ssr-plus/luasrc/view/shadowsocksr/reset.htm +++ b/luci-app-ssr-plus/luasrc/view/shadowsocksr/reset.htm @@ -7,7 +7,7 @@ return false; } if (reset != "reset") { - s.innerHTML = "<%:The content entered is incorrect!%>"; + s.innerHTML = "<%:The content entered is incorrect!%>"; return false; } btn.disabled = true; @@ -15,7 +15,7 @@ murl=dataname; XHR.get('<%=luci.dispatcher.build_url("admin", "services", "shadowsocksr","reset")%>', { set:murl }, function(x,rv) { btn.value = '<%:Reset complete%>'; - s.innerHTML = "<%:Reset complete%>"; + s.innerHTML = "<%:Reset complete%>"; }); return false; } diff --git a/luci-app-ssr-plus/luasrc/view/shadowsocksr/server_list.htm b/luci-app-ssr-plus/luasrc/view/shadowsocksr/server_list.htm index 259cb7fff..d0b77f10f 100644 --- a/luci-app-ssr-plus/luasrc/view/shadowsocksr/server_list.htm +++ b/luci-app-ssr-plus/luasrc/view/shadowsocksr/server_list.htm @@ -18,7 +18,7 @@ const wsPath = wsPaths[index]; const tls = tlss[index]; if (!dom) res() - port.innerHTML = 'connect'; + port.innerHTML = 'connect'; XHR.get('<%=luci.dispatcher.build_url("admin/services/shadowsocksr/ping")%>', { index, domain: dom.getAttribute("hint"), @@ -34,11 +34,11 @@ if (result.ping < 200) col = '#ff7700'; if (result.ping < 100) col = '#249400'; } - dom.innerHTML = `${(result.ping ? result.ping : "--") + " ms"}` + dom.innerHTML = `${(result.ping ? result.ping : "--") + " ms"}` if (result.socket) { - port.innerHTML = 'ok'; + port.innerHTML = 'ok'; } else { - port.innerHTML = 'fail'; + port.innerHTML = 'fail'; } res(); }); diff --git a/luci-app-ssr-plus/luasrc/view/shadowsocksr/ssrurl.htm b/luci-app-ssr-plus/luasrc/view/shadowsocksr/ssrurl.htm index 5eecbee6a..479d7e2f5 100644 --- a/luci-app-ssr-plus/luasrc/view/shadowsocksr/ssrurl.htm +++ b/luci-app-ssr-plus/luasrc/view/shadowsocksr/ssrurl.htm @@ -69,9 +69,9 @@ function export_ssr_url(btn, urlname, sid) { textarea.select(); try { document.execCommand("copy"); // Security exception may be thrown by some browsers. - s.innerHTML = "<%:Copy SSR to clipboard successfully.%>"; + s.innerHTML = "<%:Copy SSR to clipboard successfully.%>"; } catch (ex) { - s.innerHTML = "<%:Unable to copy SSR to clipboard.%>"; + s.innerHTML = "<%:Unable to copy SSR to clipboard.%>"; } finally { document.body.removeChild(textarea); } @@ -83,7 +83,7 @@ function import_ssr_url(btn, urlname, sid) { if (!s) return false; var ssrurl = prompt("<%:Paste sharing link here%>", ""); if (ssrurl == null || ssrurl == "") { - s.innerHTML = "<%:User cancelled.%>"; + s.innerHTML = "<%:User cancelled.%>"; return false; } s.innerHTML = ""; @@ -118,7 +118,7 @@ function import_ssr_url(btn, urlname, sid) { document.getElementsByName('cbid.shadowsocksr.' + sid + '.insecure')[0].checked = params.get("insecure") ? true : false; document.getElementsByName('cbid.shadowsocksr.' + sid + '.alias')[0].value = url.hash ? decodeURIComponent(url.hash.slice(1)) : ""; - s.innerHTML = "<%:Import configuration information successfully.%>"; + s.innerHTML = "<%:Import configuration information successfully.%>"; return false; case "ss": var url0, param = ""; @@ -164,7 +164,7 @@ function import_ssr_url(btn, urlname, sid) { if (param != undefined) { document.getElementsByName('cbid.shadowsocksr.' + sid + '.alias')[0].value = decodeURI(param); } - s.innerHTML = "<%:Import configuration information successfully.%>"; + s.innerHTML = "<%:Import configuration information successfully.%>"; } else { var sstr = b64decsafe(url0); document.getElementsByName('cbid.shadowsocksr.' + sid + '.type')[0].value = ssu[0]; @@ -179,7 +179,7 @@ function import_ssr_url(btn, urlname, sid) { if (param != undefined) { document.getElementsByName('cbid.shadowsocksr.' + sid + '.alias')[0].value = decodeURI(param); } - s.innerHTML = "<%:Import configuration information successfully.%>"; + s.innerHTML = "<%:Import configuration information successfully.%>"; } return false; case "ssr": @@ -212,7 +212,7 @@ function import_ssr_url(btn, urlname, sid) { document.getElementsByName('cbid.shadowsocksr.' + sid + '.protocol_param')[0].value = dictvalue(pdict, 'protoparam'); var rem = pdict['remarks']; if (typeof (rem) != 'undefined' && rem != '' && rem.length > 0) document.getElementsByName('cbid.shadowsocksr.' + sid + '.alias')[0].value = b64decutf8safe(rem); - s.innerHTML = "<%:Import configuration information successfully.%>"; + s.innerHTML = "<%:Import configuration information successfully.%>"; return false; case "trojan": try { @@ -234,7 +234,7 @@ function import_ssr_url(btn, urlname, sid) { document.getElementsByName('cbid.shadowsocksr.' + sid + '.tls')[0].dispatchEvent(event); document.getElementsByName('cbid.shadowsocksr.' + sid + '.tls_host')[0].value = url.searchParams.get("sni"); - s.innerHTML = "<%:Import configuration information successfully.%>"; + s.innerHTML = "<%:Import configuration information successfully.%>"; return false; case "vmess": var sstr = b64DecodeUnicode(ssu[1]); @@ -287,7 +287,7 @@ function import_ssr_url(btn, urlname, sid) { } document.getElementsByName('cbid.shadowsocksr.' + sid + '.mux')[0].checked = true; document.getElementsByName('cbid.shadowsocksr.' + sid + '.mux')[0].dispatchEvent(event); - s.innerHTML = "<%:Import configuration information successfully.%>"; + s.innerHTML = "<%:Import configuration information successfully.%>"; return false; case "vless": try { @@ -357,10 +357,10 @@ function import_ssr_url(btn, urlname, sid) { } break; } - s.innerHTML = "<%:Import configuration information successfully.%>"; + s.innerHTML = "<%:Import configuration information successfully.%>"; return false; default: - s.innerHTML = "<%:Invalid format.%>"; + s.innerHTML = "<%:Invalid format.%>"; return false; } } diff --git a/natflow/Makefile b/natflow/Makefile index 4b8ee4473..47dd7cad6 100644 --- a/natflow/Makefile +++ b/natflow/Makefile @@ -9,10 +9,10 @@ include $(TOPDIR)/rules.mk include $(INCLUDE_DIR)/kernel.mk PKG_NAME:=natflow -PKG_VERSION:=20240210 +PKG_VERSION:=20240227 PKG_SOURCE_URL:=https://codeload.github.com/ptpt52/natflow/tar.gz/$(PKG_VERSION)? -PKG_HASH:=20dec9654f35214cc9bddc55837f6faf92227b88e315368dd1436cc893009662 +PKG_HASH:=038e1a9351aaf052410140088aa402c1a1dcbba2d28a86cb64fe56d0cda226ce PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_MAINTAINER:=Chen Minqiang diff --git a/tailscale/Makefile b/tailscale/Makefile index 4fcdb577a..2aea6b4ad 100644 --- a/tailscale/Makefile +++ b/tailscale/Makefile @@ -8,12 +8,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=tailscale -PKG_VERSION:=1.56.1 -PKG_RELEASE:=2 +PKG_VERSION:=1.58.2 +PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://codeload.github.com/tailscale/tailscale/tar.gz/v$(PKG_VERSION)? -PKG_HASH:=56b7d25c704e3c22e9e20dcb55695cd9c816878d2c172a73c64aac42e460fd41 +PKG_HASH:=452f355408e4e2179872387a863387e06346fc8a6f9887821f9b8a072c6a5b0a PKG_MAINTAINER:=Jan Pavlinec PKG_LICENSE:=BSD-3-Clause diff --git a/v2dat/Makefile b/v2dat/Makefile index d0fd37aad..a9fabfa08 100644 --- a/v2dat/Makefile +++ b/v2dat/Makefile @@ -22,6 +22,8 @@ PKG_MAINTAINER:=sbwml PKG_BUILD_DEPENDS:=golang/host PKG_BUILD_PARALLEL:=1 +PKG_USE_MIPS16:=0 +PKG_BUILD_FLAGS:=no-mips16 GO_PKG:=github.com/urlesistiana/v2dat