diff --git a/luci-app-passwall2/Makefile b/luci-app-passwall2/Makefile index 18f3585e8..6828d6fa8 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.20-2 +PKG_VERSION:=1.20-3 PKG_RELEASE:= PKG_CONFIG_DEPENDS:= \ 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 b10ba4625..c2f7b7d12 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 @@ -420,20 +420,24 @@ o.default = "0" o:depends({ [option_name("tls")] = true }) if singbox_tags:find("with_utls") then - o = s:option(Value, option_name("fingerprint"), translate("Finger Print"), translate("Avoid using randomized, unless you have to.")) - o:value("", translate("Disable")) + o = s:option(Flag, option_name("utls"), translate("uTLS")) + o.default = "0" + o:depends({ [option_name("tls")] = true, [option_name("reality")] = false }) + + o = s:option(ListValue, option_name("fingerprint"), translate("Finger Print")) o:value("chrome") o:value("firefox") - o:value("safari") - o:value("ios") - -- o:value("android") o:value("edge") - -- o:value("360") + o:value("safari") + o:value("360") o:value("qq") + o:value("ios") + o:value("android") o:value("random") o:value("randomized") - o.default = "" - o:depends({ [option_name("tls")] = true, [option_name("reality")] = false }) + o.default = "chrome" + o:depends({ [option_name("tls")] = true, [option_name("utls")] = true }) + o:depends({ [option_name("tls")] = true, [option_name("reality")] = true }) end o = s:option(ListValue, option_name("transport"), translate("Transport")) diff --git a/luci-app-passwall2/luasrc/passwall2/util_sing-box.lua b/luci-app-passwall2/luasrc/passwall2/util_sing-box.lua index b7fcde66c..55c04d2e2 100644 --- a/luci-app-passwall2/luasrc/passwall2/util_sing-box.lua +++ b/luci-app-passwall2/luasrc/passwall2/util_sing-box.lua @@ -94,7 +94,7 @@ function gen_outbound(flag, node, tag, proxy_table) --min_version = "1.2", --max_version = "1.3", utls = { - enabled = (node.fingerprint ~= "") and true or false, + enabled = (node.utls == "1" or node.reality == "1") and true or false, fingerprint = node.fingerprint or "chrome" }, reality = { @@ -657,7 +657,7 @@ function gen_config(var) local inbounds = {} local outbounds = {} - local singbox_settings = uci:get_all(appname, "@global_singbox[0]" or {}) + local singbox_settings = uci:get_all(appname, "@global_singbox[0]") or {} local route = { rules = {}, diff --git a/luci-app-passwall2/po/zh-cn/passwall2.po b/luci-app-passwall2/po/zh-cn/passwall2.po index 1ab6ab083..228242bb4 100644 --- a/luci-app-passwall2/po/zh-cn/passwall2.po +++ b/luci-app-passwall2/po/zh-cn/passwall2.po @@ -703,6 +703,9 @@ msgstr "启用自定义规则地址" msgid "Rule status" msgstr "规则版本" +msgid "Manually update" +msgstr "手动更新" + msgid "Enable auto update rules" msgstr "开启自动更新规则" diff --git a/luci-app-passwall2/root/etc/uci-defaults/luci-passwall2 b/luci-app-passwall2/root/etc/uci-defaults/luci-passwall2 index 1f4db29e6..48a59ad57 100755 --- a/luci-app-passwall2/root/etc/uci-defaults/luci-passwall2 +++ b/luci-app-passwall2/root/etc/uci-defaults/luci-passwall2 @@ -56,6 +56,17 @@ global_xray=$(uci -q get passwall2.@global_xray[0]) uci -q commit passwall2 } +global_singbox=$(uci -q get passwall2.@global_singbox[0]) +[ -z "${global_singbox}" ] && { + cfgid=$(uci add passwall2 global_singbox) + uci -q set passwall2.${cfgid}.sniff_override_destination=1 + uci -q set passwall2.${cfgid}.geoip_path="/tmp/singbox/geoip.db" + uci -q set passwall2.${cfgid}.geoip_url="https://github.com/SagerNet/sing-geoip/releases/latest/download/geoip.db" + uci -q set passwall2.${cfgid}.geosite_path="/tmp/singbox/geosite.db" + uci -q set passwall2.${cfgid}.geosite_url="https://github.com/SagerNet/sing-geosite/releases/latest/download/geosite.db" + uci -q commit passwall2 +} + rm -f /tmp/luci-indexcache rm -rf /tmp/luci-modulecache/ killall -HUP rpcd 2>/dev/null diff --git a/luci-app-passwall2/root/usr/share/passwall2/app.sh b/luci-app-passwall2/root/usr/share/passwall2/app.sh index 2cd69267e..7b3d0d379 100755 --- a/luci-app-passwall2/root/usr/share/passwall2/app.sh +++ b/luci-app-passwall2/root/usr/share/passwall2/app.sh @@ -566,7 +566,7 @@ eof } lua $UTIL_SINGBOX gen_config -node $node -redir_port $redir_port -tcp_proxy_way $tcp_proxy_way ${_extra_param} > $config_file - ln_run "$(first_type $(config_t_get global_app singbox_file) sing-box)" "sing-box" "/dev/null" run -c "$config_file" + ln_run "$(first_type $(config_t_get global_app singbox_file) sing-box)" "sing-box" "${log_file}" run -c "$config_file" } run_socks() { diff --git a/natflow/files/natflow-qos.init b/natflow/files/natflow-qos.init index 2428b0c7b..5ec1beef0 100644 --- a/natflow/files/natflow-qos.init +++ b/natflow/files/natflow-qos.init @@ -206,6 +206,12 @@ start() { else echo tc_classid_mode=0 >/dev/qos_ctl fi + + mkdir -p /tmp/config + touch /tmp/config/natflow-qos + ln -s /tmp/config/natflow-qos /etc/config/natflow-qos &>/dev/null + config_load natflow-qos + config_foreach natflow_qos_setup qos } stop() {