update 2025-07-23 09:39:23
This commit is contained in:
parent
c302f688c7
commit
cba4222c57
@ -100,6 +100,4 @@ o:value("1:65535", translate("All"))
|
||||
o:value("53", "53")
|
||||
]]--
|
||||
|
||||
m:append(Template(appname .. "/acl/js"))
|
||||
|
||||
return m
|
||||
|
@ -59,6 +59,11 @@ function m.commit_handler(self)
|
||||
end)
|
||||
end
|
||||
|
||||
m.render = function(self, ...)
|
||||
Map.render(self, ...)
|
||||
api.optimize_cbi_ui()
|
||||
end
|
||||
|
||||
o = s:option(ListValue, "filter_keyword_mode", translate("Filter keyword Mode"))
|
||||
o:value("0", translate("Close"))
|
||||
o:value("1", translate("Discard List"))
|
||||
@ -134,8 +139,7 @@ end
|
||||
o = s:option(Button, "_update", translate("Manual subscription All"))
|
||||
o.inputstyle = "apply"
|
||||
function o.write(t, n)
|
||||
luci.sys.call("lua /usr/share/" .. appname .. "/subscribe.lua start > /dev/null 2>&1 &")
|
||||
m.no_commit = true
|
||||
luci.sys.call("lua /usr/share/" .. appname .. "/subscribe.lua start all manual > /dev/null 2>&1 &")
|
||||
luci.http.redirect(api.url("log"))
|
||||
end
|
||||
|
||||
@ -203,8 +207,7 @@ end
|
||||
o = s:option(Button, "_update", translate("Manual subscription"))
|
||||
o.inputstyle = "apply"
|
||||
function o.write(t, n)
|
||||
luci.sys.call("lua /usr/share/" .. appname .. "/subscribe.lua start " .. n .. " > /dev/null 2>&1 &")
|
||||
m.no_commit = true
|
||||
luci.sys.call("lua /usr/share/" .. appname .. "/subscribe.lua start " .. n .. " manual > /dev/null 2>&1 &")
|
||||
luci.http.redirect(api.url("log"))
|
||||
end
|
||||
|
||||
|
@ -9,6 +9,11 @@ if not arg[1] or not m:get(arg[1]) then
|
||||
luci.http.redirect(m.redirect)
|
||||
end
|
||||
|
||||
m.render = function(self, ...)
|
||||
Map.render(self, ...)
|
||||
api.optimize_cbi_ui()
|
||||
end
|
||||
|
||||
local has_ss = api.is_finded("ss-redir")
|
||||
local has_ss_rust = api.is_finded("sslocal")
|
||||
local has_trojan_plus = api.is_finded("trojan-plus")
|
||||
|
@ -250,6 +250,4 @@ if has_singbox then
|
||||
o.description = translate("Override the connection destination address with the sniffed domain.<br />When enabled, traffic will match only by domain, ignoring IP rules.<br />If using shunt nodes, configure the domain shunt rules correctly.")
|
||||
end
|
||||
|
||||
m:append(Template(appname .. "/other/js"))
|
||||
|
||||
return m
|
||||
|
@ -1290,3 +1290,27 @@ function format_go_time(input)
|
||||
if s > 0 or result == "" then result = result .. s .. "s" end
|
||||
return result
|
||||
end
|
||||
|
||||
function optimize_cbi_ui()
|
||||
luci.http.write([[
|
||||
<script type="text/javascript">
|
||||
//修正上移、下移按钮名称
|
||||
document.querySelectorAll("input.btn.cbi-button.cbi-button-up").forEach(function(btn) {
|
||||
btn.value = "]] .. i18n.translate("Move up") .. [[";
|
||||
});
|
||||
document.querySelectorAll("input.btn.cbi-button.cbi-button-down").forEach(function(btn) {
|
||||
btn.value = "]] .. i18n.translate("Move down") .. [[";
|
||||
});
|
||||
//删除控件和说明之间的多余换行
|
||||
document.querySelectorAll("div.cbi-value-description").forEach(function(descDiv) {
|
||||
var prev = descDiv.previousSibling;
|
||||
while (prev && prev.nodeType === Node.TEXT_NODE && prev.textContent.trim() === "") {
|
||||
prev = prev.previousSibling;
|
||||
}
|
||||
if (prev && prev.nodeType === Node.ELEMENT_NODE && prev.tagName === "BR") {
|
||||
prev.remove();
|
||||
}
|
||||
});
|
||||
</script>
|
||||
]])
|
||||
end
|
||||
|
@ -1,15 +0,0 @@
|
||||
<script type="text/javascript">
|
||||
//<![CDATA[
|
||||
//修正上移、下移按钮名称
|
||||
window.onload = function() {
|
||||
var ups = document.querySelectorAll("input.btn.cbi-button.cbi-button-up");
|
||||
var downs = document.querySelectorAll("input.btn.cbi-button.cbi-button-down");
|
||||
for (var i = 0; i < ups.length; i++) {
|
||||
ups[i].value = "<%:Move up%>";
|
||||
}
|
||||
for (var i = 0; i < downs.length; i++) {
|
||||
downs[i].value = "<%:Move down%>";
|
||||
}
|
||||
}
|
||||
//]]>
|
||||
</script>
|
@ -45,17 +45,5 @@
|
||||
}
|
||||
}, 300);
|
||||
});
|
||||
|
||||
//修正上移、下移按钮名称
|
||||
window.onload = function() {
|
||||
var ups = document.querySelectorAll("input.btn.cbi-button.cbi-button-up");
|
||||
var downs = document.querySelectorAll("input.btn.cbi-button.cbi-button-down");
|
||||
for (var i = 0; i < ups.length; i++) {
|
||||
ups[i].value = "<%:Move up%>";
|
||||
}
|
||||
for (var i = 0; i < downs.length; i++) {
|
||||
downs[i].value = "<%:Move down%>";
|
||||
}
|
||||
}
|
||||
//]]>
|
||||
</script>
|
||||
|
@ -421,12 +421,6 @@ table td, .table .td {
|
||||
obj.port = port_dom.value;
|
||||
}
|
||||
|
||||
//修正上移、下移按钮名称
|
||||
var up = td.querySelector(".cbi-button-up");
|
||||
var down = td.querySelector(".cbi-button-down");
|
||||
if (up) up.value = "<%:Move up%>";
|
||||
if (down) down.value = "<%:Move down%>";
|
||||
|
||||
node_count++;
|
||||
var add_from = document.getElementById("cbid.passwall." + id + ".add_from").value;
|
||||
if (node_list[add_from])
|
||||
|
@ -34,17 +34,5 @@ local api = require "luci.passwall.api"
|
||||
});
|
||||
return false;
|
||||
}
|
||||
|
||||
//修正上移、下移按钮名称
|
||||
window.onload = function() {
|
||||
var ups = document.querySelectorAll("input.btn.cbi-button.cbi-button-up");
|
||||
var downs = document.querySelectorAll("input.btn.cbi-button.cbi-button-down");
|
||||
for (var i = 0; i < ups.length; i++) {
|
||||
ups[i].value = "<%:Move up%>";
|
||||
}
|
||||
for (var i = 0; i < downs.length; i++) {
|
||||
downs[i].value = "<%:Move down%>";
|
||||
}
|
||||
}
|
||||
//]]>
|
||||
</script>
|
||||
|
@ -1,15 +0,0 @@
|
||||
<script type="text/javascript">
|
||||
//<![CDATA[
|
||||
//修正上移、下移按钮名称
|
||||
window.onload = function() {
|
||||
var ups = document.querySelectorAll("input.btn.cbi-button.cbi-button-up");
|
||||
var downs = document.querySelectorAll("input.btn.cbi-button.cbi-button-down");
|
||||
for (var i = 0; i < ups.length; i++) {
|
||||
ups[i].value = "<%:Move up%>";
|
||||
}
|
||||
for (var i = 0; i < downs.length; i++) {
|
||||
downs[i].value = "<%:Move down%>";
|
||||
}
|
||||
}
|
||||
//]]>
|
||||
</script>
|
@ -38,18 +38,6 @@ local geosite_update = api.uci_get_type("@global_rules[0]", "geosite_update", "1
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
//修正上移、下移按钮名称
|
||||
window.onload = function() {
|
||||
var ups = document.querySelectorAll("input.btn.cbi-button.cbi-button-up");
|
||||
var downs = document.querySelectorAll("input.btn.cbi-button.cbi-button-down");
|
||||
for (var i = 0; i < ups.length; i++) {
|
||||
ups[i].value = "<%:Move up%>";
|
||||
}
|
||||
for (var i = 0; i < downs.length; i++) {
|
||||
downs[i].value = "<%:Move down%>";
|
||||
}
|
||||
}
|
||||
//]]>
|
||||
</script>
|
||||
<div class="cbi-value" id="_rule_div">
|
||||
|
@ -29,11 +29,6 @@ local api = require "luci.passwall.api"
|
||||
//添加"日志"按钮
|
||||
new_div += '<input class="btn cbi-button cbi-button-add" type="button" value="<%:Log%>" onclick="window.open(\'' + '<%=api.url("server_user_log")%>' + '?id=' + id + '\', \'_blank\')"/> ';
|
||||
td.innerHTML = new_div + td.innerHTML;
|
||||
//修正上移、下移按钮名称
|
||||
var up = td.querySelector(".cbi-button-up");
|
||||
var down = td.querySelector(".cbi-button-down");
|
||||
if (up) up.value = "<%:Move up%>";
|
||||
if (down) down.value = "<%:Move down%>";
|
||||
}
|
||||
catch(err) {
|
||||
console.error(err);
|
||||
|
@ -465,4 +465,4 @@ if reboot == 1 then
|
||||
uci:set(name, "@global[0]", "flush_set", "1")
|
||||
api.uci_save(uci, name, true, true)
|
||||
end
|
||||
log("规则更新完毕...")
|
||||
log("规则更新完毕...\n")
|
||||
|
@ -43,20 +43,3 @@ gh-proxy.com
|
||||
gitmirror.com
|
||||
ghfast.top
|
||||
|
||||
# Synology ddns
|
||||
account.synology.com
|
||||
checkip.dyndns.org
|
||||
checkip.synology.com
|
||||
checkipv6.dyndns.org
|
||||
checkipv6.synology.com
|
||||
checkport.synology.com
|
||||
ddns.synology.com
|
||||
|
||||
# google
|
||||
dl.google.com
|
||||
|
||||
# github proxy
|
||||
gh-proxy.com
|
||||
gitmirror.com
|
||||
ghfast.top
|
||||
|
||||
|
@ -23,6 +23,7 @@ uci:revert(appname)
|
||||
|
||||
local has_ss = api.is_finded("ss-redir")
|
||||
local has_ss_rust = api.is_finded("sslocal")
|
||||
local has_ssr = api.is_finded("ssr-local") and api.is_finded("ssr-redir")
|
||||
local has_trojan_plus = api.is_finded("trojan-plus")
|
||||
local has_singbox = api.finded_com("sing-box")
|
||||
local has_xray = api.finded_com("xray")
|
||||
@ -446,6 +447,10 @@ local function processData(szType, content, add_mode, add_from)
|
||||
}
|
||||
--ssr://base64(host:port:protocol:method:obfs:base64pass/?obfsparam=base64param&protoparam=base64param&remarks=base64remarks&group=base64group&udpport=0&uot=0)
|
||||
if szType == 'ssr' then
|
||||
if not has_ssr then
|
||||
log("跳过 SSR 节点,因未安装 SSR 核心程序 shadowsocksr-libev。")
|
||||
return nil
|
||||
end
|
||||
result.type = "SSR"
|
||||
|
||||
local dat = split(content, "/%?")
|
||||
@ -472,17 +477,13 @@ local function processData(szType, content, add_mode, add_from)
|
||||
result.remarks = base64Decode(params.remarks)
|
||||
elseif szType == 'vmess' then
|
||||
local info = jsonParse(content)
|
||||
if has_singbox then
|
||||
result.type = 'sing-box'
|
||||
end
|
||||
if has_xray then
|
||||
result.type = 'Xray'
|
||||
end
|
||||
if vmess_type_default == "sing-box" and has_singbox then
|
||||
result.type = 'sing-box'
|
||||
end
|
||||
if vmess_type_default == "xray" and has_xray then
|
||||
elseif vmess_type_default == "xray" and has_xray then
|
||||
result.type = "Xray"
|
||||
else
|
||||
log("跳过 VMess 节点,因未适配到 VMess 核心程序,或未正确设置节点使用类型。")
|
||||
return nil
|
||||
end
|
||||
result.alter_id = info.aid
|
||||
result.address = info.add
|
||||
@ -590,7 +591,21 @@ local function processData(szType, content, add_mode, add_from)
|
||||
return nil
|
||||
end
|
||||
elseif szType == "ss" then
|
||||
if ss_type_default == "shadowsocks-libev" and has_ss then
|
||||
result.type = "SS"
|
||||
elseif ss_type_default == "shadowsocks-rust" and has_ss_rust then
|
||||
result.type = 'SS-Rust'
|
||||
elseif ss_type_default == "xray" and has_xray then
|
||||
result.type = 'Xray'
|
||||
result.protocol = 'shadowsocks'
|
||||
result.transport = 'raw'
|
||||
elseif ss_type_default == "sing-box" and has_singbox then
|
||||
result.type = 'sing-box'
|
||||
result.protocol = 'shadowsocks'
|
||||
else
|
||||
log("跳过 SS 节点,因未适配到 SS 核心程序,或未正确设置节点使用类型。")
|
||||
return nil
|
||||
end
|
||||
|
||||
--SS-URI = "ss://" userinfo "@" hostname ":" port [ "/" ] [ "?" plugin ] [ "#" tag ]
|
||||
--userinfo = websafe-base64-encode-utf8(method ":" password)
|
||||
@ -678,19 +693,6 @@ local function processData(szType, content, add_mode, add_from)
|
||||
result.method = method
|
||||
result.password = password
|
||||
|
||||
if ss_type_default == "shadowsocks-rust" and has_ss_rust then
|
||||
result.type = 'SS-Rust'
|
||||
end
|
||||
if ss_type_default == "xray" and has_xray then
|
||||
result.type = 'Xray'
|
||||
result.protocol = 'shadowsocks'
|
||||
result.transport = 'raw'
|
||||
end
|
||||
if ss_type_default == "sing-box" and has_singbox then
|
||||
result.type = 'sing-box'
|
||||
result.protocol = 'shadowsocks'
|
||||
end
|
||||
|
||||
if result.type ~= "Xray" then
|
||||
result.method = (method:lower() == "chacha20-poly1305" and "chacha20-ietf-poly1305") or
|
||||
(method:lower() == "xchacha20-poly1305" and "xchacha20-ietf-poly1305") or method
|
||||
@ -884,10 +886,15 @@ local function processData(szType, content, add_mode, add_from)
|
||||
result.type = "Trojan-Plus"
|
||||
elseif trojan_type_default == "sing-box" and has_singbox then
|
||||
result.type = 'sing-box'
|
||||
result.protocol = 'trojan'
|
||||
elseif trojan_type_default == "xray" and has_xray then
|
||||
result.type = 'Xray'
|
||||
end
|
||||
result.protocol = 'trojan'
|
||||
else
|
||||
log("跳过 Trojan 节点,因未适配到 Trojan 核心程序,或未正确设置节点使用类型。")
|
||||
return nil
|
||||
end
|
||||
|
||||
local alias = ""
|
||||
if content:find("#") then
|
||||
local idx_sp = content:find("#")
|
||||
@ -1043,17 +1050,13 @@ local function processData(szType, content, add_mode, add_from)
|
||||
result.group = content.airport
|
||||
result.remarks = content.remarks
|
||||
elseif szType == "vless" then
|
||||
if has_singbox then
|
||||
result.type = 'sing-box'
|
||||
end
|
||||
if has_xray then
|
||||
result.type = 'Xray'
|
||||
end
|
||||
if vless_type_default == "sing-box" and has_singbox then
|
||||
result.type = 'sing-box'
|
||||
end
|
||||
if vless_type_default == "xray" and has_xray then
|
||||
elseif vless_type_default == "xray" and has_xray then
|
||||
result.type = "Xray"
|
||||
else
|
||||
log("跳过 VLESS 节点,因未适配到 VLESS 核心程序,或未正确设置节点使用类型。")
|
||||
return nil
|
||||
end
|
||||
result.protocol = "vless"
|
||||
local alias = ""
|
||||
@ -1216,6 +1219,14 @@ local function processData(szType, content, add_mode, add_from)
|
||||
end
|
||||
end
|
||||
elseif szType == 'hysteria' then
|
||||
if has_singbox then
|
||||
result.type = 'sing-box'
|
||||
result.protocol = "hysteria"
|
||||
else
|
||||
log("跳过 Hysteria 节点,因未安装 Hysteria 核心程序 Sing-box。")
|
||||
return nil
|
||||
end
|
||||
|
||||
local alias = ""
|
||||
if content:find("#") then
|
||||
local idx_sp = content:find("#")
|
||||
@ -1263,10 +1274,6 @@ local function processData(szType, content, add_mode, add_from)
|
||||
result.hysteria_down_mbps = params.downmbps
|
||||
result.hysteria_hop = params.mport
|
||||
|
||||
if has_singbox then
|
||||
result.type = 'sing-box'
|
||||
result.protocol = "hysteria"
|
||||
end
|
||||
elseif szType == 'hysteria2' or szType == 'hy2' then
|
||||
local alias = ""
|
||||
if content:find("#") then
|
||||
@ -1326,8 +1333,19 @@ local function processData(szType, content, add_mode, add_from)
|
||||
if params["obfs-password"] or params["obfs_password"] then
|
||||
result.hysteria2_obfs = params["obfs-password"] or params["obfs_password"]
|
||||
end
|
||||
else
|
||||
log("跳过 Hysteria2 节点,因未适配到 Hysteria2 核心程序,或未正确设置节点使用类型。")
|
||||
return nil
|
||||
end
|
||||
elseif szType == 'tuic' then
|
||||
if has_singbox then
|
||||
result.type = 'sing-box'
|
||||
result.protocol = "tuic"
|
||||
else
|
||||
log("跳过 Tuic 节点,因未安装 Tuic 核心程序 Sing-box。")
|
||||
return nil
|
||||
end
|
||||
|
||||
local alias = ""
|
||||
if content:find("#") then
|
||||
local idx_sp = content:find("#")
|
||||
@ -1380,11 +1398,15 @@ local function processData(szType, content, add_mode, add_from)
|
||||
else
|
||||
result.tls_allowInsecure = allowInsecure_default and "1" or "0"
|
||||
end
|
||||
result.type = 'sing-box'
|
||||
result.protocol = "tuic"
|
||||
elseif szType == "anytls" then
|
||||
if has_singbox then
|
||||
result.type = 'sing-box'
|
||||
result.protocol = "anytls"
|
||||
else
|
||||
log("跳过 AnyTLS 节点,因未安装 AnyTLS 核心程序 Sing-box 1.12。")
|
||||
return nil
|
||||
end
|
||||
|
||||
local alias = ""
|
||||
if content:find("#") then
|
||||
local idx_sp = content:find("#")
|
||||
@ -1812,7 +1834,7 @@ local execute = function()
|
||||
do
|
||||
local subscribe_list = {}
|
||||
local fail_list = {}
|
||||
if arg[2] then
|
||||
if arg[2] ~= "all" then
|
||||
string.gsub(arg[2], '[^' .. "," .. ']+', function(w)
|
||||
subscribe_list[#subscribe_list + 1] = uci:get_all(appname, w) or {}
|
||||
end)
|
||||
@ -1822,6 +1844,8 @@ local execute = function()
|
||||
end)
|
||||
end
|
||||
|
||||
local manual_sub = arg[3] == "manual"
|
||||
|
||||
for index, value in ipairs(subscribe_list) do
|
||||
local cfgid = value[".name"]
|
||||
local remark = value.remark
|
||||
@ -1890,7 +1914,7 @@ local execute = function()
|
||||
local old_md5 = value.md5 or ""
|
||||
local new_md5 = luci.sys.exec("md5sum " .. tmp_file .. " 2>/dev/null | awk '{print $1}'"):gsub("\n", "")
|
||||
os.remove(tmp_file)
|
||||
if old_md5 == new_md5 then
|
||||
if not manual_sub and old_md5 == new_md5 then
|
||||
log('订阅:【' .. remark .. '】没有变化,无需更新。')
|
||||
else
|
||||
parse_link(raw_data, "2", remark, cfgid)
|
||||
@ -1930,7 +1954,7 @@ if arg[1] then
|
||||
end
|
||||
log('发生错误, 正在恢复服务')
|
||||
end)
|
||||
log('订阅完毕...')
|
||||
log('订阅完毕...\n')
|
||||
elseif arg[1] == "add" then
|
||||
local f = assert(io.open("/tmp/links.conf", 'r'))
|
||||
local raw = f:read('*all')
|
||||
|
Loading…
x
Reference in New Issue
Block a user