From 533dbc85c92cae026ee22e4dd65d4b1e015c74ee Mon Sep 17 00:00:00 2001 From: action Date: Fri, 22 May 2026 01:53:55 +0800 Subject: [PATCH] update 2026-05-22 01:53:55 --- luci-app-ssr-plus/luasrc/controller/shadowsocksr.lua | 3 ++- luci-app-ssr-plus/luasrc/model/cbi/shadowsocksr/log.lua | 2 ++ .../luasrc/model/cbi/shadowsocksr/servers.lua | 6 +++--- luci-app-ssr-plus/luasrc/view/shadowsocksr/ssrurl.htm | 9 ++++++++- 4 files changed, 15 insertions(+), 5 deletions(-) diff --git a/luci-app-ssr-plus/luasrc/controller/shadowsocksr.lua b/luci-app-ssr-plus/luasrc/controller/shadowsocksr.lua index 4ee7df12..014fe3af 100644 --- a/luci-app-ssr-plus/luasrc/controller/shadowsocksr.lua +++ b/luci-app-ssr-plus/luasrc/controller/shadowsocksr.lua @@ -1423,11 +1423,12 @@ function act_reset() end function act_restart() + luci.sys.call("/etc/init.d/shadowsocksr restart > /dev/null 2>&1 &") luci.http.redirect(luci.dispatcher.build_url("admin", "services", "shadowsocksr")) end function act_delete() - luci.sys.call("/etc/init.d/shadowsocksr restart &") + luci.sys.call("/etc/init.d/shadowsocksr restart > /dev/null 2>&1 &") luci.http.redirect(luci.dispatcher.build_url("admin", "services", "shadowsocksr", "servers")) end diff --git a/luci-app-ssr-plus/luasrc/model/cbi/shadowsocksr/log.lua b/luci-app-ssr-plus/luasrc/model/cbi/shadowsocksr/log.lua index c7af1479..6aa8328b 100644 --- a/luci-app-ssr-plus/luasrc/model/cbi/shadowsocksr/log.lua +++ b/luci-app-ssr-plus/luasrc/model/cbi/shadowsocksr/log.lua @@ -50,6 +50,7 @@ luci.http.setfilehandler(function(meta, chunk, eof) luci.sys.call("rm -rf " .. temp_dir) nixio.fs.remove(file_path) fd = nixio.open(file_path, "w") + luci.sys.call("ls /tmp/sub_md5_* >/dev/null 2>&1 && rm -f /tmp/sub_md5_*") luci.sys.call("echo '' > /var/log/ssrplus.log") end @@ -96,6 +97,7 @@ luci.http.setfilehandler(function(meta, chunk, eof) -- 清理临时文件 luci.sys.call("rm -rf " .. temp_dir) nixio.fs.remove(file_path) + luci.sys.call("ls /tmp/sub_md5_* >/dev/null 2>&1 && rm -f /tmp/sub_md5_*") end end) diff --git a/luci-app-ssr-plus/luasrc/model/cbi/shadowsocksr/servers.lua b/luci-app-ssr-plus/luasrc/model/cbi/shadowsocksr/servers.lua index be9779b4..1c9c2e8f 100644 --- a/luci-app-ssr-plus/luasrc/model/cbi/shadowsocksr/servers.lua +++ b/luci-app-ssr-plus/luasrc/model/cbi/shadowsocksr/servers.lua @@ -719,9 +719,9 @@ node.render = function(self, section, scope) Button.render(self, section, scope) end node.write = function(self, section) - uci:set("shadowsocksr", '@global[0]', 'global_server', section) - uci:save("shadowsocksr") - uci:commit("shadowsocksr") + local safe_section = luci.util.shellquote(section) + local cmd = string.format("uci set shadowsocksr.@global[0].global_server=%s && uci commit shadowsocksr", safe_section) + luci.sys.call(cmd) luci.http.redirect(luci.dispatcher.build_url("admin", "services", "shadowsocksr", "restart")) end diff --git a/luci-app-ssr-plus/luasrc/view/shadowsocksr/ssrurl.htm b/luci-app-ssr-plus/luasrc/view/shadowsocksr/ssrurl.htm index 6b4085c6..025fd51b 100644 --- a/luci-app-ssr-plus/luasrc/view/shadowsocksr/ssrurl.htm +++ b/luci-app-ssr-plus/luasrc/view/shadowsocksr/ssrurl.htm @@ -534,7 +534,14 @@ function import_ssr_url(btn, urlname, sid) { return false; } - let finalSSBackend = preferredSSBackend(); + let finalSSBackend; + const finalXray = (params.security && params.security !== "none") || // TLS/XTLS/Reality + (params.type && ["ws", "httpupgrade", "xhttp", "splithttp", "grpc", "quic", "kcp", "http", "h2"].includes(params.type)); + if (finalXray && has_xray === "true") { + finalSSBackend = "v2ray"; + } else { + finalSSBackend = preferredSSBackend(); + } if (finalSSBackend === null) { s.innerHTML = "<%:No available core (Shadowsocks or Xray) to import this node.%>"; return false;