From b50cf2822f3607f8c97a833ce2987db327d4bae9 Mon Sep 17 00:00:00 2001 From: action Date: Sun, 9 Aug 2026 16:35:03 +0800 Subject: [PATCH] update 2026-08-09 16:35:03 --- hysteria/Makefile | 4 +- .../luasrc/controller/passwall.lua | 36 +++++++------- .../luasrc/model/cbi/passwall/client/acl.lua | 27 +++++++---- .../model/cbi/passwall/client/acl_config.lua | 34 ++++++++----- .../model/cbi/passwall/client/global.lua | 17 ++++--- .../model/cbi/passwall/client/haproxy.lua | 5 +- .../cbi/passwall/client/node_subscribe.lua | 11 ++--- .../model/cbi/passwall/client/other.lua | 5 +- .../model/cbi/passwall/client/type/ray.lua | 3 ++ .../cbi/passwall/client/type/sing-box.lua | 3 ++ .../model/cbi/passwall/server/index.lua | 7 ++- .../model/cbi/passwall/server/type/ray.lua | 2 +- .../cbi/passwall/server/type/sing-box.lua | 2 +- luci-app-passwall/luasrc/passwall/api.lua | 7 +-- .../luasrc/passwall/util_sing-box.lua | 15 ++++-- .../luasrc/passwall/util_xray.lua | 14 ++++-- luci-app-passwall/po/zh-cn/passwall.po | 12 +++++ .../root/usr/share/passwall/app.sh | 3 +- .../root/usr/share/passwall/iptables.sh | 5 ++ .../root/usr/share/passwall/nftables.sh | 5 ++ .../root/usr/share/passwall/subscribe.lua | 8 ++-- luci-app-syncthing/Makefile | 22 --------- luci-app-syncthing/README.md | 2 - .../luasrc/controller/syncthing.lua | 17 ------- .../luasrc/model/cbi/syncthing.lua | 48 ------------------- .../view/syncthing/syncthing_status.htm | 27 ----------- .../root/etc/uci-defaults/luci-syncthing | 12 ----- .../share/rpcd/acl.d/luci-app-syncthing.json | 11 ----- 28 files changed, 137 insertions(+), 227 deletions(-) delete mode 100644 luci-app-syncthing/Makefile delete mode 100644 luci-app-syncthing/README.md delete mode 100644 luci-app-syncthing/luasrc/controller/syncthing.lua delete mode 100644 luci-app-syncthing/luasrc/model/cbi/syncthing.lua delete mode 100644 luci-app-syncthing/luasrc/view/syncthing/syncthing_status.htm delete mode 100644 luci-app-syncthing/root/etc/uci-defaults/luci-syncthing delete mode 100644 luci-app-syncthing/root/usr/share/rpcd/acl.d/luci-app-syncthing.json diff --git a/hysteria/Makefile b/hysteria/Makefile index 8e8a4b00..859454a3 100644 --- a/hysteria/Makefile +++ b/hysteria/Makefile @@ -5,12 +5,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=hysteria -PKG_VERSION:=2.12.0 +PKG_VERSION:=2.12.1 PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://codeload.github.com/apernet/hysteria/tar.gz/app/v$(PKG_VERSION)? -PKG_HASH:=0c37f3ddc51a80e0c33425380d09c045045ce68b7fa6453e2ba27a986e65d9f5 +PKG_HASH:=6bdd78678f25b27ac984fa6bf394cdbb586c0d02ba8057b5f598da690c61115c PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-app-v$(PKG_VERSION) PKG_LICENSE:=MIT diff --git a/luci-app-passwall/luasrc/controller/passwall.lua b/luci-app-passwall/luasrc/controller/passwall.lua index 43217ffb..92ac0185 100644 --- a/luci-app-passwall/luasrc/controller/passwall.lua +++ b/luci-app-passwall/luasrc/controller/passwall.lua @@ -495,22 +495,22 @@ end function add_node() local redirect = http.formvalue("redirect") - local uuid = api.gen_short_uuid() - uci:section(appname, "nodes", uuid) + local uid = api.gen_random_char() + uci:section(appname, "nodes", uid) local group = http.formvalue("group") if group and group ~= "default" then - uci:set(appname, uuid, "group", group) + uci:set(appname, uid, "group", group) end - uci:set(appname, uuid, "type", "Socks") + uci:set(appname, uid, "type", "Socks") if redirect == "1" then api.uci_save(uci, appname) - http.redirect(api.url("node_config", uuid)) + http.redirect(api.url("node_config", uid)) else api.uci_save(uci, appname, true, true) - http_write_json({result = uuid}) + http_write_json({result = uid}) end end @@ -538,17 +538,17 @@ end function copy_node() local section = http.formvalue("section") - local uuid = api.gen_short_uuid() - uci:section(appname, "nodes", uuid) + local uid = api.gen_random_char() + uci:section(appname, "nodes", uid) for k, v in pairs(uci:get_all(appname, section)) do if not k:match("^%.") and k ~= "group" then if k == "remarks" then v = (v or "") .. "(1)" end - uci:set(appname, uuid, k, v) + uci:set(appname, uid, k, v) end end - uci:set(appname, uuid, "add_mode", 1) + uci:set(appname, uid, "add_mode", 1) api.uci_save(uci, appname) - http.redirect(api.url("node_config", uuid)) + http.redirect(api.url("node_config", uid)) end function clear_all_nodes() @@ -1165,29 +1165,29 @@ function add_shunt_rule() local add_name = http.formvalue("add_name") local redirect = http.formvalue("redirect") - local uuid = add_name + local uid = add_name if add_name then - local has = uci:get(appname, uuid) + local has = uci:get(appname, uid) if has then http_write_json_error({ message = "This ID already exists." }) return end else - uuid = api.gen_short_uuid() + uid = api.gen_random_char() end - uci:section(appname, "shunt_rules", uuid) + uci:section(appname, "shunt_rules", uid) local group = http.formvalue("group") if group and group ~= "default" then - uci:set(appname, uuid, "group", group) + uci:set(appname, uid, "group", group) end if redirect == "1" then api.uci_save(uci, appname) - http.redirect(api.url("shunt_rules", uuid)) + http.redirect(api.url("shunt_rules", uid)) else api.uci_save(uci, appname) - http_write_json_ok({uuid = uuid, redirect_url = api.url("shunt_rules", uuid)}) + http_write_json_ok({uid = uid, redirect_url = api.url("shunt_rules", uid)}) end end diff --git a/luci-app-passwall/luasrc/model/cbi/passwall/client/acl.lua b/luci-app-passwall/luasrc/model/cbi/passwall/client/acl.lua index cc1edcf4..03765191 100644 --- a/luci-app-passwall/luasrc/model/cbi/passwall/client/acl.lua +++ b/luci-app-passwall/luasrc/model/cbi/passwall/client/acl.lua @@ -23,10 +23,9 @@ s.anonymous = true s.addremove = true s.extedit = api.url("acl_config", "%s") function s.create(e, t) - local uuid = api.gen_short_uuid(5) - uuid = "acl_" .. uuid - TypedSection.create(e, uuid) - luci.http.redirect(e.extedit:format(uuid)) + local uid = "acl_" .. api.gen_random_char(5) + TypedSection.create(e, uid) + luci.http.redirect(e.extedit:format(uid)) end function s.remove(e, t) sys.call("rm -rf /tmp/etc/passwall_tmp/dns_" .. t .. "*") @@ -50,6 +49,15 @@ sys.net.mac_hints(function(e, t) } end) +i = s:option(DummyValue, "interface", translate("Source Interface")) +i.cfgvalue = function(t, n) + local v = Value.cfgvalue(t, n) or '' + if v == "" then + return translate("All") + end + return v +end + o = s:option(DummyValue, "sources", translate("Source")) o.rawhtml = true o.cfgvalue = function(t, n) @@ -68,10 +76,13 @@ o.cfgvalue = function(t, n) return e end -o = s:option(DummyValue, "interface", translate("Source Interface")) -o.cfgvalue = function(t, n) - local v = Value.cfgvalue(t, n) or '-' - return v +i = s:option(DummyValue, "mode", translate("Mode")) +i.cfgvalue = function(t, n) + local v = Value.cfgvalue(t, n) or '0' + if v == "1" then + return translate("Proxy") + end + return translate("No Proxy") end --[[ diff --git a/luci-app-passwall/luasrc/model/cbi/passwall/client/acl_config.lua b/luci-app-passwall/luasrc/model/cbi/passwall/client/acl_config.lua index 2160416a..7d428241 100644 --- a/luci-app-passwall/luasrc/model/cbi/passwall/client/acl_config.lua +++ b/luci-app-passwall/luasrc/model/cbi/passwall/client/acl_config.lua @@ -84,19 +84,6 @@ o = s:option(Value, "remarks", translate("Remarks")) o.default = cfgid o.rmempty = false ----- Log -o = s:option(Flag, "log", translate("Log")) -o.default = 0 -o.rmempty = false - -o = s:option(ListValue, "loglevel", "Sing-Box/Xray " .. translate("Log Level")) -o.default = "warning" -o:value("debug") -o:value("info") -o:value("warning") -o:value("error") -o:depends("log", "1") - o = s:option(Value, "interface", translate("Source Interface")) o:value("", translate("All")) local iface = api.get_network_devices() @@ -196,12 +183,17 @@ sources.validate = function(self, value, t) end sources.write = dynamicList_write +o = s:option(ListValue, "mode", translate("Mode")) +o:value("0", translate("No Proxy")) +o:value("1", translate("Proxy")) + ---- TCP No Redir Ports local TCP_NO_REDIR_PORTS = m:get("@global_forwarding[0]", "tcp_no_redir_ports") o = s:option(Value, "tcp_no_redir_ports", translate("TCP No Redir Ports")) o:value("", translate("Use global config") .. "(" .. TCP_NO_REDIR_PORTS .. ")") o:value("disable", translate("No patterns are used")) o:value("1:65535", translate("All")) +o:depends("mode", "1") o.validate = port_validate ---- UDP No Redir Ports @@ -213,11 +205,13 @@ o = s:option(Value, "udp_no_redir_ports", translate("UDP No Redir Ports"), o:value("", translate("Use global config") .. "(" .. UDP_NO_REDIR_PORTS .. ")") o:value("disable", translate("No patterns are used")) o:value("1:65535", translate("All")) +o:depends("mode", "1") o.validate = port_validate o = s:option(DummyValue, "_hide_node_option", "") o.template = "passwall/cbi/hidevalue" o.value = "1" +o:depends("mode", "0") o:depends({ tcp_no_redir_ports = "1:65535", udp_no_redir_ports = "1:65535" }) if TCP_NO_REDIR_PORTS == "1:65535" and UDP_NO_REDIR_PORTS == "1:65535" then o:depends({ tcp_no_redir_ports = "", udp_no_redir_ports = "" }) @@ -280,6 +274,20 @@ o.value = "1" o:depends({ udp_node = "", ['!reverse'] = true }) o:depends({ shunt_udp_node = "tcp" }) +---- Log +o = s:option(Flag, "log", translate("Enable Node Log")) +o.default = 0 +o.rmempty = false +o:depends({ _hide_node_option = false, use_global_config = false }) + +o = s:option(ListValue, "loglevel", "Sing-Box/Xray " .. translate("Log Level")) +o.default = "warn" +o:value("debug", "Debug") +o:value("info", "Info") +o:value("warn", "Warning") +o:value("error", "Error") +o:depends("log", "1") + ---- TCP Proxy Drop Ports local TCP_PROXY_DROP_PORTS = m:get("@global_forwarding[0]", "tcp_proxy_drop_ports") o = s:option(Value, "tcp_proxy_drop_ports", translate("TCP Proxy Drop Ports")) diff --git a/luci-app-passwall/luasrc/model/cbi/passwall/client/global.lua b/luci-app-passwall/luasrc/model/cbi/passwall/client/global.lua index 7f8760bb..62f9071f 100644 --- a/luci-app-passwall/luasrc/model/cbi/passwall/client/global.lua +++ b/luci-app-passwall/luasrc/model/cbi/passwall/client/global.lua @@ -650,11 +650,11 @@ o.default = "0" o.rmempty = false o = s:taboption("log", ListValue, "loglevel", "Sing-Box/Xray " .. translate("Log Level")) -o.default = "warning" -o:value("debug") -o:value("info") -o:value("warning") -o:value("error") +o.default = "warn" +o:value("debug", "Debug") +o:value("info", "Info") +o:value("warn", "Warning") +o:value("error", "Error") o = s:taboption("log", Flag, "advanced_log_feature", translate("Advanced log feature"), translate("For professionals only.")) o.default = "0" @@ -696,10 +696,9 @@ s2.anonymous = true s2.addremove = true s2.extedit = api.url("socks_config", "%s") function s2.create(e, t) - local uuid = api.gen_short_uuid(5) - uuid = "socks_" .. uuid - TypedSection.create(e, uuid) - luci.http.redirect(e.extedit:format(uuid)) + local uid = "socks_" .. api.gen_random_char(5) + TypedSection.create(e, uid) + luci.http.redirect(e.extedit:format(uid)) end function s2.remove(e, t) local socks = "Socks_" .. t diff --git a/luci-app-passwall/luasrc/model/cbi/passwall/client/haproxy.lua b/luci-app-passwall/luasrc/model/cbi/passwall/client/haproxy.lua index 9818b537..bc3046ce 100644 --- a/luci-app-passwall/luasrc/model/cbi/passwall/client/haproxy.lua +++ b/luci-app-passwall/luasrc/model/cbi/passwall/client/haproxy.lua @@ -114,9 +114,8 @@ s.anonymous = true s.addremove = true s.create = function(e, t) - local uuid = api.gen_short_uuid(5) - uuid = "haproxy_" .. uuid - TypedSection.create(e, uuid) + local uid = "haproxy_" .. api.gen_random_char(5) + TypedSection.create(e, uid) end s.remove = function(self, section) diff --git a/luci-app-passwall/luasrc/model/cbi/passwall/client/node_subscribe.lua b/luci-app-passwall/luasrc/model/cbi/passwall/client/node_subscribe.lua index 49b8cf88..6080e87f 100644 --- a/luci-app-passwall/luasrc/model/cbi/passwall/client/node_subscribe.lua +++ b/luci-app-passwall/luasrc/model/cbi/passwall/client/node_subscribe.lua @@ -138,12 +138,11 @@ s.template = "cbi/tblsection" s.extedit = api.url("node_subscribe_config", "%s") function s.create(e, t) m.no_commit = true - local uuid = api.gen_short_uuid(5) - uuid = "sub_" .. uuid - TypedSection.create(e, uuid) - m:set(uuid, "hysteria_up_mbps", "100") - m:set(uuid, "hysteria_down_mbps", "100") - luci.http.redirect(e.extedit:format(uuid)) + local uid = "sub_" .. api.gen_random_char(5) + TypedSection.create(e, uid) + m:set(uid, "hysteria_up_mbps", "100") + m:set(uid, "hysteria_down_mbps", "100") + luci.http.redirect(e.extedit:format(uid)) end o = s:option(Value, "remark", translate("Remarks")) diff --git a/luci-app-passwall/luasrc/model/cbi/passwall/client/other.lua b/luci-app-passwall/luasrc/model/cbi/passwall/client/other.lua index 069aad75..9ef39d15 100644 --- a/luci-app-passwall/luasrc/model/cbi/passwall/client/other.lua +++ b/luci-app-passwall/luasrc/model/cbi/passwall/client/other.lua @@ -222,9 +222,8 @@ if has_xray then s_xray_noise.addremove = true s_xray_noise.create = function(e, t) - local uuid = api.gen_short_uuid(5) - uuid = "xray_noise_" .. uuid - TypedSection.create(e, uuid) + local uid = "xray_noise_" .. api.gen_random_char(5) + TypedSection.create(e, uid) end s_xray_noise.remove = function(self, section) 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 d45ae3c0..ab44838c 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 @@ -513,6 +513,9 @@ o.default = "chrome" o:depends({ [_n("tls")] = true, [_n("utls")] = true }) o:depends({ [_n("tls")] = true, [_n("reality")] = true }) +o = s:option(Value, _n("cipherSuites"), translate("Cipher Suites"), '***' .. " " .. translate("Configures the list of supported cipher suites, separated by :")) +o:depends({ [_n("tls")] = true, [_n("reality")] = false }) + o = s:option(Flag, _n("use_mldsa65Verify"), translate("ML-DSA-65")) o.default = "0" o:depends({ [_n("tls")] = true, [_n("reality")] = true }) 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 a62cfeeb..7bcce0ba 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 @@ -536,6 +536,9 @@ o.validate = function(self, value) return value end +o = s:option(Value, _n("cipherSuites"), translate("Cipher Suites"), '***' .. " " .. translate("Configures the list of supported cipher suites, separated by :")) +o:depends({ [_n("tls")] = true }) + o = s:option(Flag, _n("ech"), translate("ECH")) o.default = "0" o:depends({ [_n("tls")] = true, [_n("flow")] = "", [_n("reality")] = false }) diff --git a/luci-app-passwall/luasrc/model/cbi/passwall/server/index.lua b/luci-app-passwall/luasrc/model/cbi/passwall/server/index.lua index d9a8b50d..0cca99bc 100644 --- a/luci-app-passwall/luasrc/model/cbi/passwall/server/index.lua +++ b/luci-app-passwall/luasrc/model/cbi/passwall/server/index.lua @@ -26,10 +26,9 @@ t.sortable = true t.template = "cbi/tblsection" t.extedit = api.url("server_user", "%s") function t.create(e, t) - local uuid = api.gen_uuid() - t = uuid - TypedSection.create(e, t) - luci.http.redirect(e.extedit:format(t)) + local uid = api.gen_random_char() + TypedSection.create(e, uid) + luci.http.redirect(e.extedit:format(uid)) end function t.remove(e, t) e.map.proceed = true diff --git a/luci-app-passwall/luasrc/model/cbi/passwall/server/type/ray.lua b/luci-app-passwall/luasrc/model/cbi/passwall/server/type/ray.lua index 7e1cf876..b3efefdb 100644 --- a/luci-app-passwall/luasrc/model/cbi/passwall/server/type/ray.lua +++ b/luci-app-passwall/luasrc/model/cbi/passwall/server/type/ray.lua @@ -111,7 +111,7 @@ o:depends({ [_n("protocol")] = "socks" }) o = s:option(DynamicList, _n("uuid"), translate("ID") .. "/" .. translate("Password")) for i = 1, 3 do - o:value(api.gen_uuid(1)) + o:value(api.gen_uuid()) end o:depends({ [_n("protocol")] = "vmess" }) o:depends({ [_n("protocol")] = "vless" }) diff --git a/luci-app-passwall/luasrc/model/cbi/passwall/server/type/sing-box.lua b/luci-app-passwall/luasrc/model/cbi/passwall/server/type/sing-box.lua index 75d2553b..8ac9630e 100644 --- a/luci-app-passwall/luasrc/model/cbi/passwall/server/type/sing-box.lua +++ b/luci-app-passwall/luasrc/model/cbi/passwall/server/type/sing-box.lua @@ -235,7 +235,7 @@ o:depends({ [_n("protocol")] = "shadowsocks" }) o = s:option(DynamicList, _n("uuid"), translate("ID") .. "/" .. translate("Password")) for i = 1, 3 do - o:value(api.gen_uuid(1)) + o:value(api.gen_uuid()) end o:depends({ [_n("protocol")] = "vmess" }) o:depends({ [_n("protocol")] = "vless" }) diff --git a/luci-app-passwall/luasrc/passwall/api.lua b/luci-app-passwall/luasrc/passwall/api.lua index 3cf885fd..6dc1b152 100644 --- a/luci-app-passwall/luasrc/passwall/api.lua +++ b/luci-app-passwall/luasrc/passwall/api.lua @@ -642,15 +642,12 @@ function get_full_node_remarks(n) return remarks end -function gen_uuid(format) +function gen_uuid() local uuid = sys.exec("echo -n $(cat /proc/sys/kernel/random/uuid)") - if format == nil then - uuid = string.gsub(uuid, "-", "") - end return uuid end -function gen_short_uuid(length) +function gen_random_char(length) if not length then length = 8 end return sys.exec("echo -n $(head /dev/urandom | tr -dc A-Za-z0-9 | head -c %s)" % length) end diff --git a/luci-app-passwall/luasrc/passwall/util_sing-box.lua b/luci-app-passwall/luasrc/passwall/util_sing-box.lua index e17d3e33..dc871255 100644 --- a/luci-app-passwall/luasrc/passwall/util_sing-box.lua +++ b/luci-app-passwall/luasrc/passwall/util_sing-box.lua @@ -5,7 +5,6 @@ local sys = api.sys local jsonc = api.jsonc local appname = "passwall" local fs = api.fs -local split = api.split local ech_domain = {} local local_version = api.get_app_version("sing-box"):match("[^v]+") @@ -88,6 +87,11 @@ local function convert_geofile() convert(GEO_VAR.IP_PATH, "geoip", GEO_VAR.IP_TAGS) end +local function get_log_level(s) + if s == "warning" then s = "warn" end + return s +end + function gen_outbound(flag, node, tag, proxy_table) local result = nil if node then @@ -190,7 +194,7 @@ function gen_outbound(flag, node, tag, proxy_table) if not GLOBAL.DNS_SERVER[dns_key] then GLOBAL.DNS_SERVER[dns_key] = { server = { - tag = "dns-node-" .. api.gen_short_uuid(), + tag = "dns-node-" .. api.gen_random_char(), type = dns_proto, server = server_address, server_port = server_port, @@ -232,7 +236,8 @@ function gen_outbound(flag, node, tag, proxy_table) --max_version = "1.3", fragment = fragment, record_fragment = record_fragment, - certificate = (node.tls_certificate == "1" and node.tls_certificate_pem ~= "") and split(node.tls_certificate_pem, "\n") or nil, + certificate = (node.tls_certificate == "1" and node.tls_certificate_pem ~= "") and api.split(node.tls_certificate_pem, "\n") or nil, + cipher_suites = (node.cipherSuites and node.cipherSuites ~= "") and api.split(node.cipherSuites, ":") or nil, ech = (node.ech == "1") and (function() local function get_ech_domain(s) --兼容xray "域名+DNS" 格式ech local domain, dns = s:match("^([^+]+)%+(.+)$") @@ -1042,7 +1047,7 @@ function gen_config_server(node) local config = { log = { disabled = (not node or node.log == "0") and true or false, - level = node.loglevel or "info", + level = get_log_level(node.loglevel) or "info", timestamp = true, --output = logfile, }, @@ -2169,7 +2174,7 @@ function gen_config(var) local config = { log = { disabled = log == "0" and true or false, - level = loglevel, + level = get_log_level(loglevel), timestamp = true, output = logfile, }, diff --git a/luci-app-passwall/luasrc/passwall/util_xray.lua b/luci-app-passwall/luasrc/passwall/util_xray.lua index 985a4577..35287bda 100644 --- a/luci-app-passwall/luasrc/passwall/util_xray.lua +++ b/luci-app-passwall/luasrc/passwall/util_xray.lua @@ -31,6 +31,11 @@ local function get_domain_excluded() return hosts end +local function get_log_level(s) + if s == "warn" then s = "warning" end + return s +end + function gen_outbound(flag, node, tag, proxy_table) local result = nil if node then @@ -165,7 +170,8 @@ function gen_outbound(flag, node, tag, proxy_table) certificates = (node.tls_certificate == "1" and node.tls_certificate_pem ~= "") and { certificate = api.split(node.tls_certificate_pem, "\n"), usage = "verify" - } or nil + } or nil, + cipherSuites = node.cipherSuites or nil } or nil, realitySettings = (node.stream_security == "reality") and { serverName = node.tls_serverName, @@ -453,7 +459,7 @@ function gen_outbound(flag, node, tag, proxy_table) local dns_key = dns_proto .. "|" .. config_address .. "|" .. tostring(config_port) if not GLOBAL.DNS_SERVER[dns_key] then GLOBAL.DNS_SERVER[dns_key] = { - tag = "dns-node-" .. api.gen_short_uuid(), + tag = "dns-node-" .. api.gen_random_char(), -- queryStrategy = node.domain_strategy or "UseIP", address = config_address, port = config_port, @@ -635,7 +641,7 @@ function gen_config_server(node) local config = { log = { -- error = "/tmp/etc/passwall_server/log/" .. user[".name"] .. ".log", - loglevel = ("1" == node.log) and node.loglevel or "none" + loglevel = ("1" == node.log) and get_log_level(node.loglevel) or "none" }, -- 传入连接 inbounds = { @@ -1966,7 +1972,7 @@ function gen_config(var) end)(), log = { -- error = string.format("/tmp/etc/%s/%s.log", appname, node[".name"]), - loglevel = loglevel + loglevel = get_log_level(loglevel) }, -- DNS dns = dns, diff --git a/luci-app-passwall/po/zh-cn/passwall.po b/luci-app-passwall/po/zh-cn/passwall.po index d2c3c321..acf6c98b 100644 --- a/luci-app-passwall/po/zh-cn/passwall.po +++ b/luci-app-passwall/po/zh-cn/passwall.po @@ -1631,6 +1631,9 @@ msgstr "日志" msgid "Log" msgstr "日志" +msgid "Enable Node Log" +msgstr "启用节点日志" + msgid "%s Node Log" msgstr "%s 节点日志" @@ -2156,3 +2159,12 @@ msgstr "Gecko 包大小(最大)" msgid "valid time (hh:mm)" msgstr "有效时间(hh:mm)" + +msgid "Not Set" +msgstr "未设置" + +msgid "Cipher Suites" +msgstr "密码套件" + +msgid "Configures the list of supported cipher suites, separated by :" +msgstr "配置支持的密码套件列表,以冒号 (:) 分隔。" diff --git a/luci-app-passwall/root/usr/share/passwall/app.sh b/luci-app-passwall/root/usr/share/passwall/app.sh index ad8ceb2f..f44b6fbd 100755 --- a/luci-app-passwall/root/usr/share/passwall/app.sh +++ b/luci-app-passwall/root/usr/share/passwall/app.sh @@ -115,7 +115,6 @@ run_singbox() { json_add_string "logfile" "${log_file}" fi [ -z "$loglevel" ] && local loglevel=$(config_t_get global loglevel "warn") - [ "$loglevel" = "warning" ] && loglevel="warn" json_add_string "loglevel" "$loglevel" [ -n "$flag" ] && json_add_string "flag" "$flag" @@ -1527,7 +1526,7 @@ acl_app() { eval $(uci -q show "${CONFIG}.${sid}" | cut -d'.' -sf 3-) log=${log:-0} - loglevel=${loglevel:-warning} + loglevel=${loglevel:-warn} if [ -n "${sources}" ]; then for s in $sources; do diff --git a/luci-app-passwall/root/usr/share/passwall/iptables.sh b/luci-app-passwall/root/usr/share/passwall/iptables.sh index b73c2ed4..3f83f602 100755 --- a/luci-app-passwall/root/usr/share/passwall/iptables.sh +++ b/luci-app-passwall/root/usr/share/passwall/iptables.sh @@ -203,6 +203,7 @@ load_acl() { for sid in $(ls -F ${TMP_ACL_PATH} | grep '/$' | awk -F '/' '{print $1}' | grep -v 'default'); do eval "$(uci -q show "${CONFIG}.${sid}" | cut -d'.' -sf 3-)" + mode=${mode:-0} tcp_no_redir_ports=${tcp_no_redir_ports:-default} udp_no_redir_ports=${udp_no_redir_ports:-default} use_global_config=${use_global_config:-0} @@ -217,6 +218,10 @@ load_acl() { chn_list=${chn_list:-direct} tcp_proxy_mode=${tcp_proxy_mode:-proxy} udp_proxy_mode=${udp_proxy_mode:-proxy} + [ "$mode" = "0" ] && { + tcp_no_redir_ports="1:65535" + udp_no_redir_ports="1:65535" + } [ "$tcp_no_redir_ports" = "default" ] && tcp_no_redir_ports=$TCP_NO_REDIR_PORTS [ "$udp_no_redir_ports" = "default" ] && udp_no_redir_ports=$UDP_NO_REDIR_PORTS [ "$tcp_proxy_drop_ports" = "default" ] && tcp_proxy_drop_ports=$TCP_PROXY_DROP_PORTS diff --git a/luci-app-passwall/root/usr/share/passwall/nftables.sh b/luci-app-passwall/root/usr/share/passwall/nftables.sh index fa66a8fc..6414376c 100755 --- a/luci-app-passwall/root/usr/share/passwall/nftables.sh +++ b/luci-app-passwall/root/usr/share/passwall/nftables.sh @@ -263,6 +263,7 @@ load_acl() { for sid in $(ls -F ${TMP_ACL_PATH} | grep '/$' | awk -F '/' '{print $1}' | grep -v 'default'); do eval "$(uci -q show "${CONFIG}.${sid}" | cut -d'.' -sf 3-)" + mode=${mode:-0} tcp_no_redir_ports=${tcp_no_redir_ports:-default} udp_no_redir_ports=${udp_no_redir_ports:-default} use_global_config=${use_global_config:-0} @@ -277,6 +278,10 @@ load_acl() { chn_list=${chn_list:-direct} tcp_proxy_mode=${tcp_proxy_mode:-proxy} udp_proxy_mode=${udp_proxy_mode:-proxy} + [ "$mode" = "0" ] && { + tcp_no_redir_ports="1:65535" + udp_no_redir_ports="1:65535" + } [ "$tcp_no_redir_ports" = "default" ] && tcp_no_redir_ports=$TCP_NO_REDIR_PORTS [ "$udp_no_redir_ports" = "default" ] && udp_no_redir_ports=$UDP_NO_REDIR_PORTS [ "$tcp_proxy_drop_ports" = "default" ] && tcp_proxy_drop_ports=$TCP_PROXY_DROP_PORTS diff --git a/luci-app-passwall/root/usr/share/passwall/subscribe.lua b/luci-app-passwall/root/usr/share/passwall/subscribe.lua index 3437b004..fa6924ab 100755 --- a/luci-app-passwall/root/usr/share/passwall/subscribe.lua +++ b/luci-app-passwall/root/usr/share/passwall/subscribe.lua @@ -180,9 +180,9 @@ do local flag = "Socks节点列表[" .. i .. "]备用节点的列表" local currentNodes = {} local newNodes = {} - for k, asb_node in ipairs(t.autoswitch_backup_node) do - if asb_node then - local currentNode = uci:get_all(appname, asb_node) or {} + for k, asb_node_id in ipairs(t.autoswitch_backup_node) do + if asb_node_id then + local currentNode = uci:get_all(appname, asb_node_id) or {} if currentNode[".type"] == "nodes" then currentNodes[#currentNodes + 1] = { log = true, @@ -1931,7 +1931,7 @@ local function update_node(manual) chain_node_type = (outbound_iface_group ~= "") and "iface" or chain_node_type end for _, vv in ipairs(list) do - local cfgid = uci:section(appname, "nodes", api.gen_short_uuid()) + local cfgid = uci:section(appname, "nodes", api.gen_random_char()) for kkk, vvv in pairs(vv) do if type(vvv) == "table" and next(vvv) ~= nil then uci:set_list(appname, cfgid, kkk, vvv) diff --git a/luci-app-syncthing/Makefile b/luci-app-syncthing/Makefile deleted file mode 100644 index 2219fcb2..00000000 --- a/luci-app-syncthing/Makefile +++ /dev/null @@ -1,22 +0,0 @@ -# Copyright (C) 2020 Gyj1109 -# 适配 OpenWrt 25.12 修改版 - -include $(TOPDIR)/rules.mk - -PKG_NAME:=luci-app-syncthing -PKG_VERSION:=1.0 -PKG_RELEASE:=3 - -LUCI_TITLE:=LuCI support for Syncthing -LUCI_PKGARCH:=all -# 适配 25.12:确保安装了 syncthing 后,LuCI 界面能正确拉起 -LUCI_DEPENDS:=+syncthing - -include $(TOPDIR)/feeds/luci/luci.mk - -# 明确定义配置文件的归属,这对 25.12 的 apk 管理器非常重要 -define Package/$(PKG_NAME)/conffiles -/etc/config/syncthing -endef - -$(eval $(call BuildPackage,$(PKG_NAME))) diff --git a/luci-app-syncthing/README.md b/luci-app-syncthing/README.md deleted file mode 100644 index b07298c1..00000000 --- a/luci-app-syncthing/README.md +++ /dev/null @@ -1,2 +0,0 @@ -# luci-app-syncthing -在Potat0000源码基础上进行了汉化优化,官方openwrt23.05.3编译后可使用 diff --git a/luci-app-syncthing/luasrc/controller/syncthing.lua b/luci-app-syncthing/luasrc/controller/syncthing.lua deleted file mode 100644 index ee2ca7ef..00000000 --- a/luci-app-syncthing/luasrc/controller/syncthing.lua +++ /dev/null @@ -1,17 +0,0 @@ -module("luci.controller.syncthing", package.seeall) - -function index() - if not nixio.fs.access("/etc/config/syncthing") then - return - end - - entry({"admin", "services", "syncthing"}, cbi("syncthing"), _("文件同步"), 10).dependent = true - entry({"admin", "services", "syncthing", "status"}, call("act_status")).leaf = true -end - -function act_status() - local e = {} - e.running = luci.sys.call("pgrep syncthing >/dev/null") == 0 - luci.http.prepare_content("application/json") - luci.http.write_json(e) -end diff --git a/luci-app-syncthing/luasrc/model/cbi/syncthing.lua b/luci-app-syncthing/luasrc/model/cbi/syncthing.lua deleted file mode 100644 index 324ea054..00000000 --- a/luci-app-syncthing/luasrc/model/cbi/syncthing.lua +++ /dev/null @@ -1,48 +0,0 @@ -require("nixio.fs") - -m = Map("syncthing", translate("Syncthing同步工具")) - -m:section(SimpleSection).template = "syncthing/syncthing_status" - -s = m:section(TypedSection, "syncthing") - -s.anonymous = true - -o = s:option(Flag, "enabled", translate("启用")) -o.default = 0 -o.rmempty = false - -gui_address = s:option(Value, "gui_address", translate("GUI访问地址")) -gui_address.description = translate("使用0.0.0.0以监控所有访问。") -gui_address.default = "http://0.0.0.0:8384" -gui_address.placeholder = "http://0.0.0.0:8384" -gui_address.rmempty = false - -home = s:option(Value, "home", translate("配置文件目录")) -home.description = translate("只有保存在/etc/syncthing中的配置会自动备份!") -home.default = "/etc/syncthing" -home.placeholder = "/etc/syncthing" -home.rmempty = false - -user = s:option(ListValue, "user", translate("用户")) -user.description = translate("默认是syncthing,但这可能会导致权限被拒绝。Syncthing官方不建议以root身份运行。") -user:value("", translate("syncthing")) -for u in luci.util.execi("cat /etc/passwd | cut -d ':' -f1") do - user:value(u) -end - -macprocs = s:option(Value, "macprocs", translate("线程限制")) -macprocs.description = translate("0表示匹配CPU数量(默认),>0表示显式指定并发数。") -macprocs.default = "0" -macprocs.placeholder = "0" -macprocs.datatype = "range(0,32)" -macprocs.rmempty = false - -nice = s:option(Value, "nice", translate("优先级")) -nice.description = translate("显式指定优先级值。0是最高,19是最低。(暂时不允许设置负值)") -nice.default = "19" -nice.placeholder = "19" -nice.datatype = "range(0,19)" -nice.rmempty = false - -return m diff --git a/luci-app-syncthing/luasrc/view/syncthing/syncthing_status.htm b/luci-app-syncthing/luasrc/view/syncthing/syncthing_status.htm deleted file mode 100644 index 566cc020..00000000 --- a/luci-app-syncthing/luasrc/view/syncthing/syncthing_status.htm +++ /dev/null @@ -1,27 +0,0 @@ - - -
-

- <%:正在收集数据...%> -

-
diff --git a/luci-app-syncthing/root/etc/uci-defaults/luci-syncthing b/luci-app-syncthing/root/etc/uci-defaults/luci-syncthing deleted file mode 100644 index 3adb7997..00000000 --- a/luci-app-syncthing/root/etc/uci-defaults/luci-syncthing +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/sh -touch /etc/config/syncthing - -uci -q batch <<-EOF >/dev/null - delete ucitrack.@syncthing[-1] - add ucitrack syncthing - set ucitrack.@syncthing[-1].exec='/etc/init.d/syncthing stop && /etc/init.d/syncthing start' - commit ucitrack -EOF -# remove LuCI cache -rm -f /tmp/luci* -exit 0 diff --git a/luci-app-syncthing/root/usr/share/rpcd/acl.d/luci-app-syncthing.json b/luci-app-syncthing/root/usr/share/rpcd/acl.d/luci-app-syncthing.json deleted file mode 100644 index 9fc9cc54..00000000 --- a/luci-app-syncthing/root/usr/share/rpcd/acl.d/luci-app-syncthing.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "luci-app-syncthing": { - "description": "Grant UCI access for luci-app-syncthing", - "read": { - "uci": [ "syncthing" ] - }, - "write": { - "uci": [ "syncthing" ] - } - } -}