update 2024-01-09 06:44:45
This commit is contained in:
parent
f2dddf50a3
commit
1cb5012d3b
|
@ -6,7 +6,7 @@
|
|||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=luci-app-passwall
|
||||
PKG_VERSION:=4.71-3
|
||||
PKG_VERSION:=4.72-1
|
||||
PKG_RELEASE:=
|
||||
|
||||
PKG_CONFIG_DEPENDS:= \
|
||||
|
|
|
@ -6,27 +6,46 @@ local has_trojan_plus = api.is_finded("trojan-plus")
|
|||
local has_singbox = api.finded_com("singbox")
|
||||
local has_xray = api.finded_com("xray")
|
||||
local has_trojan_go = api.finded_com("trojan-go")
|
||||
local has_hysteria2 = api.finded_com("hysteria")
|
||||
local ss_aead_type = {}
|
||||
local trojan_type = {}
|
||||
local vmess_type = {}
|
||||
local vless_type = {}
|
||||
local hysteria2_type = {}
|
||||
if has_ss then
|
||||
ss_aead_type[#ss_aead_type + 1] = "shadowsocks-libev"
|
||||
local s = "shadowsocks-libev"
|
||||
table.insert(ss_aead_type, s)
|
||||
end
|
||||
if has_ss_rust then
|
||||
ss_aead_type[#ss_aead_type + 1] = "shadowsocks-rust"
|
||||
local s = "shadowsocks-rust"
|
||||
table.insert(ss_aead_type, s)
|
||||
end
|
||||
if has_trojan_plus then
|
||||
trojan_type[#trojan_type + 1] = "trojan-plus"
|
||||
local s = "trojan-plus"
|
||||
table.insert(trojan_type, s)
|
||||
end
|
||||
if has_singbox then
|
||||
trojan_type[#trojan_type + 1] = "sing-box"
|
||||
ss_aead_type[#ss_aead_type + 1] = "sing-box"
|
||||
local s = "sing-box"
|
||||
table.insert(trojan_type, s)
|
||||
table.insert(ss_aead_type, s)
|
||||
table.insert(vmess_type, s)
|
||||
table.insert(vless_type, s)
|
||||
table.insert(hysteria2_type, s)
|
||||
end
|
||||
if has_xray then
|
||||
trojan_type[#trojan_type + 1] = "xray"
|
||||
ss_aead_type[#ss_aead_type + 1] = "xray"
|
||||
local s = "xray"
|
||||
table.insert(trojan_type, s)
|
||||
table.insert(ss_aead_type, s)
|
||||
table.insert(vmess_type, s)
|
||||
table.insert(vless_type, s)
|
||||
end
|
||||
if has_trojan_go then
|
||||
trojan_type[#trojan_type + 1] = "trojan-go"
|
||||
local s = "trojan-go"
|
||||
table.insert(trojan_type, s)
|
||||
end
|
||||
if has_hysteria2 then
|
||||
local s = "hysteria2"
|
||||
table.insert(hysteria2_type, s)
|
||||
end
|
||||
|
||||
m = Map(appname)
|
||||
|
@ -48,16 +67,46 @@ o = s:option(DynamicList, "filter_discard_list", translate("Discard List"))
|
|||
o = s:option(DynamicList, "filter_keep_list", translate("Keep List"))
|
||||
|
||||
if #ss_aead_type > 0 then
|
||||
o = s:option(ListValue, "ss_aead_type", translate("SS AEAD Node Use Type"))
|
||||
o = s:option(ListValue, "ss_aead_type", translatef("%s Node Use Type", "SS AEAD"))
|
||||
for key, value in pairs(ss_aead_type) do
|
||||
o:value(value, translate(value:gsub("^%l",string.upper)))
|
||||
o:value(value)
|
||||
end
|
||||
end
|
||||
|
||||
if #trojan_type > 0 then
|
||||
o = s:option(ListValue, "trojan_type", translate("Trojan Node Use Type"))
|
||||
o = s:option(ListValue, "trojan_type", translatef("%s Node Use Type", "Trojan"))
|
||||
for key, value in pairs(trojan_type) do
|
||||
o:value(value, translate(value:gsub("^%l",string.upper)))
|
||||
o:value(value)
|
||||
end
|
||||
end
|
||||
|
||||
if #vmess_type > 0 then
|
||||
o = s:option(ListValue, "vmess_type", translatef("%s Node Use Type", "VMess"))
|
||||
for key, value in pairs(vmess_type) do
|
||||
o:value(value)
|
||||
end
|
||||
if has_xray then
|
||||
o.default = "xray"
|
||||
end
|
||||
end
|
||||
|
||||
if #vless_type > 0 then
|
||||
o = s:option(ListValue, "vless_type", translatef("%s Node Use Type", "VLESS"))
|
||||
for key, value in pairs(vless_type) do
|
||||
o:value(value)
|
||||
end
|
||||
if has_xray then
|
||||
o.default = "xray"
|
||||
end
|
||||
end
|
||||
|
||||
if #hysteria2_type > 0 then
|
||||
o = s:option(ListValue, "hysteria2_type", translatef("%s Node Use Type", "Hysteria2"))
|
||||
for key, value in pairs(hysteria2_type) do
|
||||
o:value(value)
|
||||
end
|
||||
if has_hysteria2 then
|
||||
o.default = "hysteria2"
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -1,33 +1,51 @@
|
|||
local api = require "luci.passwall.api"
|
||||
local appname = api.appname
|
||||
local sys = api.sys
|
||||
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")
|
||||
local has_singbox = api.finded_com("singbox")
|
||||
local has_xray = api.finded_com("xray")
|
||||
local has_trojan_go = api.finded_com("trojan-go")
|
||||
local has_hysteria2 = api.finded_com("hysteria")
|
||||
local ss_aead_type = {}
|
||||
local trojan_type = {}
|
||||
local vmess_type = {}
|
||||
local vless_type = {}
|
||||
local hysteria2_type = {}
|
||||
if has_ss then
|
||||
ss_aead_type[#ss_aead_type + 1] = "shadowsocks-libev"
|
||||
local s = "shadowsocks-libev"
|
||||
table.insert(ss_aead_type, s)
|
||||
end
|
||||
if has_ss_rust then
|
||||
ss_aead_type[#ss_aead_type + 1] = "shadowsocks-rust"
|
||||
local s = "shadowsocks-rust"
|
||||
table.insert(ss_aead_type, s)
|
||||
end
|
||||
if has_trojan_plus then
|
||||
trojan_type[#trojan_type + 1] = "trojan-plus"
|
||||
local s = "trojan-plus"
|
||||
table.insert(trojan_type, s)
|
||||
end
|
||||
if has_singbox then
|
||||
trojan_type[#trojan_type + 1] = "sing-box"
|
||||
ss_aead_type[#ss_aead_type + 1] = "sing-box"
|
||||
local s = "sing-box"
|
||||
table.insert(trojan_type, s)
|
||||
table.insert(ss_aead_type, s)
|
||||
table.insert(vmess_type, s)
|
||||
table.insert(vless_type, s)
|
||||
table.insert(hysteria2_type, s)
|
||||
end
|
||||
if has_xray then
|
||||
trojan_type[#trojan_type + 1] = "xray"
|
||||
ss_aead_type[#ss_aead_type + 1] = "xray"
|
||||
local s = "xray"
|
||||
table.insert(trojan_type, s)
|
||||
table.insert(ss_aead_type, s)
|
||||
table.insert(vmess_type, s)
|
||||
table.insert(vless_type, s)
|
||||
end
|
||||
if has_trojan_go then
|
||||
trojan_type[#trojan_type + 1] = "trojan-go"
|
||||
local s = "trojan-go"
|
||||
table.insert(trojan_type, s)
|
||||
end
|
||||
if has_hysteria2 then
|
||||
local s = "hysteria2"
|
||||
table.insert(hysteria2_type, s)
|
||||
end
|
||||
|
||||
m = Map(appname)
|
||||
|
@ -69,20 +87,47 @@ o:depends("filter_keyword_mode", "3")
|
|||
o:depends("filter_keyword_mode", "4")
|
||||
|
||||
if #ss_aead_type > 0 then
|
||||
o = s:option(ListValue, "ss_aead_type", translate("SS AEAD Node Use Type"))
|
||||
o = s:option(ListValue, "ss_aead_type", translatef("%s Node Use Type", "SS AEAD"))
|
||||
o.default = "global"
|
||||
o:value("global", translate("Use global config"))
|
||||
for key, value in pairs(ss_aead_type) do
|
||||
o:value(value, translate(value:gsub("^%l",string.upper)))
|
||||
o:value(value)
|
||||
end
|
||||
end
|
||||
|
||||
if #trojan_type > 0 then
|
||||
o = s:option(ListValue, "trojan_type", translate("Trojan Node Use Type"))
|
||||
o = s:option(ListValue, "trojan_type", translatef("%s Node Use Type", "Trojan"))
|
||||
o.default = "global"
|
||||
o:value("global", translate("Use global config"))
|
||||
for key, value in pairs(trojan_type) do
|
||||
o:value(value, translate(value:gsub("^%l",string.upper)))
|
||||
o:value(value)
|
||||
end
|
||||
end
|
||||
|
||||
if #vmess_type > 0 then
|
||||
o = s:option(ListValue, "vmess_type", translatef("%s Node Use Type", "VMess"))
|
||||
o.default = "global"
|
||||
o:value("global", translate("Use global config"))
|
||||
for key, value in pairs(vmess_type) do
|
||||
o:value(value)
|
||||
end
|
||||
end
|
||||
|
||||
if #vless_type > 0 then
|
||||
o = s:option(ListValue, "vless_type", translatef("%s Node Use Type", "VLESS"))
|
||||
o.default = "global"
|
||||
o:value("global", translate("Use global config"))
|
||||
for key, value in pairs(vless_type) do
|
||||
o:value(value)
|
||||
end
|
||||
end
|
||||
|
||||
if #hysteria2_type > 0 then
|
||||
o = s:option(ListValue, "hysteria2_type", translatef("%s Node Use Type", "Hysteria2"))
|
||||
o.default = "global"
|
||||
o:value("global", translate("Use global config"))
|
||||
for key, value in pairs(hysteria2_type) do
|
||||
o:value(value)
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -200,6 +200,20 @@ if has_singbox then
|
|||
o.default = "https://github.com/SagerNet/sing-geosite/releases/latest/download/geosite.db"
|
||||
o:value("https://github.com/SagerNet/sing-geosite/releases/latest/download/geosite.db")
|
||||
o.rmempty = false
|
||||
|
||||
o = s:option(Button, "_remove_resource", translate("Remove resource files"))
|
||||
o.description = translate("Sing-Box will automatically download resource files when starting, you can use this feature achieve upgrade resource files.")
|
||||
o.inputstyle = "remove"
|
||||
function o.write(self, section, value)
|
||||
local geoip_path = s.fields["geoip_path"] and s.fields["geoip_path"]:formvalue(section) or nil
|
||||
if geoip_path then
|
||||
os.remove(geoip_path)
|
||||
end
|
||||
local geosite_path = s.fields["geosite_path"] and s.fields["geosite_path"]:formvalue(section) or nil
|
||||
if geosite_path then
|
||||
os.remove(geosite_path)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
return m
|
||||
|
|
|
@ -19,6 +19,87 @@ protocol:value("http")
|
|||
protocol:value("tls")
|
||||
protocol:value("bittorrent")
|
||||
|
||||
o = s:option(MultiValue, "inbound", translate("Inbound Tag"))
|
||||
o:value("tproxy", translate("Transparent proxy"))
|
||||
o:value("socks", "Socks")
|
||||
|
||||
network = s:option(ListValue, "network", translate("Network"))
|
||||
network:value("tcp,udp", "TCP UDP")
|
||||
network:value("tcp", "TCP")
|
||||
network:value("udp", "UDP")
|
||||
|
||||
source = s:option(DynamicList, "source", translate("Source"))
|
||||
source.description = "<ul><li>" .. translate("Example:")
|
||||
.. "</li><li>" .. translate("IP") .. ": 192.168.1.100"
|
||||
.. "</li><li>" .. translate("IP CIDR") .. ": 192.168.1.0/24"
|
||||
.. "</li><li>" .. translate("GeoIP") .. ": geoip:private"
|
||||
.. "</li></ul>"
|
||||
source.cast = "string"
|
||||
source.cfgvalue = function(self, section)
|
||||
local value
|
||||
if self.tag_error[section] then
|
||||
value = self:formvalue(section)
|
||||
else
|
||||
value = self.map:get(section, self.option)
|
||||
if type(value) == "string" then
|
||||
local value2 = {}
|
||||
string.gsub(value, '[^' .. " " .. ']+', function(w) table.insert(value2, w) end)
|
||||
value = value2
|
||||
end
|
||||
end
|
||||
return value
|
||||
end
|
||||
source.validate = function(self, value, t)
|
||||
local err = {}
|
||||
for _, v in ipairs(value) do
|
||||
local flag = false
|
||||
if datatypes.ip4addr(v) then
|
||||
flag = true
|
||||
end
|
||||
|
||||
if flag == false and v:find("geoip:") and v:find("geoip:") == 1 then
|
||||
flag = true
|
||||
end
|
||||
|
||||
if flag == false then
|
||||
err[#err + 1] = v
|
||||
end
|
||||
end
|
||||
|
||||
if #err > 0 then
|
||||
self:add_error(t, "invalid", translate("Not true format, please re-enter!"))
|
||||
for _, v in ipairs(err) do
|
||||
self:add_error(t, "invalid", v)
|
||||
end
|
||||
end
|
||||
|
||||
return value
|
||||
end
|
||||
|
||||
local dynamicList_write = function(self, section, value)
|
||||
local t = {}
|
||||
local t2 = {}
|
||||
if type(value) == "table" then
|
||||
local x
|
||||
for _, x in ipairs(value) do
|
||||
if x and #x > 0 then
|
||||
if not t2[x] then
|
||||
t2[x] = x
|
||||
t[#t+1] = x
|
||||
end
|
||||
end
|
||||
end
|
||||
else
|
||||
t = { value }
|
||||
end
|
||||
t = table.concat(t, " ")
|
||||
return DynamicList.write(self, section, t)
|
||||
end
|
||||
|
||||
source.write = dynamicList_write
|
||||
|
||||
port = s:option(Value, "port", translate("port"))
|
||||
|
||||
domain_list = s:option(TextValue, "domain_list", translate("Domain"))
|
||||
domain_list.rows = 10
|
||||
domain_list.wrap = "off"
|
||||
|
|
|
@ -108,10 +108,8 @@ o.default = "https://www.google.com/generate_204"
|
|||
o:depends("enable_autoswitch", true)
|
||||
|
||||
for k, v in pairs(nodes_table) do
|
||||
if v.node_type == "normal" then
|
||||
autoswitch_backup_node:value(v.id, v["remark"])
|
||||
socks_node:value(v.id, v["remark"])
|
||||
end
|
||||
end
|
||||
|
||||
m:append(Template(appname .. "/socks_auto_switch/footer"))
|
||||
|
|
|
@ -1053,7 +1053,30 @@ function gen_config(var)
|
|||
end)
|
||||
end
|
||||
|
||||
local inboundTag = nil
|
||||
if e["inbound"] and e["inbound"] ~= "" then
|
||||
inboundTag = {}
|
||||
if e["inbound"]:find("tproxy") then
|
||||
if tcp_redir_port then
|
||||
if tcp_proxy_way == "tproxy" then
|
||||
table.insert(inboundTag, "tproxy_tcp")
|
||||
else
|
||||
table.insert(inboundTag, "redirect_tcp")
|
||||
end
|
||||
end
|
||||
if udp_redir_port then
|
||||
table.insert(inboundTag, "tproxy_udp")
|
||||
end
|
||||
end
|
||||
if e["inbound"]:find("socks") then
|
||||
if local_socks_port then
|
||||
table.insert(inboundTag, "socks-in")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
local rule = {
|
||||
inbound = inboundTag,
|
||||
outbound = outboundTag,
|
||||
invert = false, --匹配反选
|
||||
protocol = protocols
|
||||
|
|
|
@ -547,6 +547,7 @@ function gen_config(var)
|
|||
local node = uci:get_all(appname, node_id)
|
||||
if local_socks_port then
|
||||
local inbound = {
|
||||
tag = "socks-in",
|
||||
listen = local_socks_address,
|
||||
port = tonumber(local_socks_port),
|
||||
protocol = "socks",
|
||||
|
@ -870,39 +871,70 @@ function gen_config(var)
|
|||
table.insert(protocols, w)
|
||||
end)
|
||||
end
|
||||
local inboundTag = nil
|
||||
if e["inbound"] and e["inbound"] ~= "" then
|
||||
inboundTag = {}
|
||||
if e["inbound"]:find("tproxy") then
|
||||
if tcp_redir_port then
|
||||
table.insert(inboundTag, "tcp_redir")
|
||||
end
|
||||
if udp_redir_port then
|
||||
table.insert(inboundTag, "udp_redir")
|
||||
end
|
||||
end
|
||||
if e["inbound"]:find("socks") then
|
||||
if local_socks_port then
|
||||
table.insert(inboundTag, "socks-in")
|
||||
end
|
||||
end
|
||||
end
|
||||
local domains = nil
|
||||
if e.domain_list then
|
||||
local _domain = {}
|
||||
domains = {}
|
||||
string.gsub(e.domain_list, '[^' .. "\r\n" .. ']+', function(w)
|
||||
table.insert(_domain, w)
|
||||
table.insert(domains, w)
|
||||
end)
|
||||
table.insert(rules, {
|
||||
type = "field",
|
||||
outboundTag = outboundTag,
|
||||
balancerTag = balancerTag,
|
||||
domain = _domain,
|
||||
protocol = protocols
|
||||
})
|
||||
end
|
||||
local ip = nil
|
||||
if e.ip_list then
|
||||
local _ip = {}
|
||||
ip = {}
|
||||
string.gsub(e.ip_list, '[^' .. "\r\n" .. ']+', function(w)
|
||||
table.insert(_ip, w)
|
||||
table.insert(ip, w)
|
||||
end)
|
||||
table.insert(rules, {
|
||||
type = "field",
|
||||
outboundTag = outboundTag,
|
||||
balancerTag = balancerTag,
|
||||
ip = _ip,
|
||||
protocol = protocols
|
||||
})
|
||||
end
|
||||
if not e.domain_list and not e.ip_list and protocols then
|
||||
table.insert(rules, {
|
||||
local source = nil
|
||||
if e.source then
|
||||
source = {}
|
||||
string.gsub(e.source, '[^' .. " " .. ']+', function(w)
|
||||
table.insert(source, w)
|
||||
end)
|
||||
end
|
||||
local rule = {
|
||||
_flag = e.remarks,
|
||||
type = "field",
|
||||
inboundTag = inboundTag,
|
||||
outboundTag = outboundTag,
|
||||
balancerTag = balancerTag,
|
||||
network = e["network"] or "tcp,udp",
|
||||
source = source,
|
||||
sourcePort = nil,
|
||||
port = e["port"] ~= "" and e["port"] or nil,
|
||||
protocol = protocols
|
||||
})
|
||||
}
|
||||
if domains then
|
||||
local _rule = api.clone(rule)
|
||||
_rule["_flag"] = _rule["_flag"] .. "_domains"
|
||||
_rule.domains = domains
|
||||
table.insert(rules, _rule)
|
||||
end
|
||||
if ip then
|
||||
local _rule = api.clone(rule)
|
||||
_rule["_flag"] = _rule["_flag"] .. "_ip"
|
||||
_rule.ip = ip
|
||||
table.insert(rules, _rule)
|
||||
end
|
||||
if not domains and not ip and protocols then
|
||||
table.insert(rules, rule)
|
||||
end
|
||||
end
|
||||
end)
|
||||
|
|
|
@ -5,6 +5,7 @@ local api = require "luci.passwall.api"
|
|||
<script type="text/javascript">//<![CDATA[
|
||||
let has_singbox = "<%=api.finded_com("singbox")%>"
|
||||
let has_xray = "<%=api.finded_com("xray")%>"
|
||||
let has_hysteria2 = "<%=api.finded_com("hysteria")%>"
|
||||
|
||||
function padright(str, cnt, pad) {
|
||||
return str + Array(cnt + 1).join(pad);
|
||||
|
@ -453,14 +454,21 @@ local api = require "luci.passwall.api"
|
|||
}
|
||||
url += url_protocol;
|
||||
url += params;
|
||||
} else if (v_type === "Hysteria2") {
|
||||
} else if ((v_type === "Hysteria2") || (v_type === "sing-box" && opt.get(dom_prefix + "protocol").value === "hysteria2")) {
|
||||
var v_port = opt.get(dom_prefix + "port");
|
||||
var params = "";
|
||||
params += opt.query("auth", dom_prefix + "auth_password");
|
||||
params += opt.query("sni", dom_prefix + "tls_serverName");
|
||||
params += opt.query("insecure", dom_prefix + "tls_allowInsecure");
|
||||
|
||||
params += opt.query("obfs", "salamander");
|
||||
params += opt.query("obfs-password", dom_prefix + "obfs");
|
||||
if (v_type === "Hysteria2") {
|
||||
params += opt.query("obfs-password", "hysteria2_obfs");
|
||||
params += opt.query("auth", "hysteria2_auth_password");
|
||||
params += opt.query("pinSHA256", "hysteria2_tls_pinSHA256");
|
||||
} else {
|
||||
params += opt.query("obfs-password", dom_prefix + "hysteria2_obfs_password");
|
||||
params += opt.query("auth", dom_prefix + "hysteria2_auth_password");
|
||||
}
|
||||
var url =
|
||||
_address + ":" +
|
||||
v_port.value + "?" +
|
||||
|
@ -839,7 +847,8 @@ local api = require "luci.passwall.api"
|
|||
if (has_singbox) {
|
||||
opt.set('type', "sing-box");
|
||||
dom_prefix = "singbox_"
|
||||
} else if (has_xray) {
|
||||
}
|
||||
if (has_xray) {
|
||||
opt.set('type', "Xray");
|
||||
dom_prefix = "xray_"
|
||||
}
|
||||
|
@ -888,12 +897,13 @@ local api = require "luci.passwall.api"
|
|||
}
|
||||
}
|
||||
if (ssu[0] === "vless") {
|
||||
if (has_singbox) {
|
||||
opt.set('type', "sing-box");
|
||||
dom_prefix = "singbox_"
|
||||
}
|
||||
if (has_xray) {
|
||||
opt.set('type', "Xray");
|
||||
dom_prefix = "xray_"
|
||||
} else if (has_singbox) {
|
||||
opt.set('type', "sing-box");
|
||||
dom_prefix = "singbox_"
|
||||
}
|
||||
opt.set(dom_prefix + 'protocol', "vless");
|
||||
var m = parseNodeUrl(ssrurl);
|
||||
|
@ -1037,14 +1047,7 @@ local api = require "luci.passwall.api"
|
|||
opt.set('remarks', decodeURI(m.hash.substr(1)));
|
||||
}
|
||||
}
|
||||
if (ssu[0] === "hysteria2") {
|
||||
if (has_singbox) {
|
||||
opt.set('type', "sing-box");
|
||||
dom_prefix = "singbox_"
|
||||
} else {
|
||||
opt.set('type', "Hysteria2");
|
||||
dom_prefix = "hysteria2_"
|
||||
}
|
||||
if (ssu[0] === "hysteria2" || ssu[0] === "hy2") {
|
||||
var m = parseNodeUrl(ssrurl);
|
||||
var queryParam = {};
|
||||
if (m.search.length > 1) {
|
||||
|
@ -1057,10 +1060,28 @@ local api = require "luci.passwall.api"
|
|||
queryParam[decodeURIComponent(params[0])] = decodeURIComponent(params[1] || '');
|
||||
}
|
||||
}
|
||||
|
||||
if (has_singbox) {
|
||||
opt.set('type', "sing-box");
|
||||
dom_prefix = "singbox_"
|
||||
opt.set(dom_prefix + 'protocol', "hysteria2");
|
||||
opt.set(dom_prefix + 'hysteria2_obfs_type', "salamander");
|
||||
opt.set(dom_prefix + 'hysteria2_obfs_password', queryParam["obfs-password"]);
|
||||
opt.set(dom_prefix + 'hysteria2_auth_password', queryParam.auth);
|
||||
}
|
||||
if (has_hysteria2) {
|
||||
opt.set('type', "Hysteria2");
|
||||
dom_prefix = "hysteria2_"
|
||||
opt.set(dom_prefix + 'obfs', queryParam["obfs-password"]);
|
||||
opt.set(dom_prefix + 'auth_password', queryParam.auth);
|
||||
if (queryParam.pinSHA256) {
|
||||
opt.set(dom_prefix + 'tls_pinSHA256', queryParam.pinSHA256);
|
||||
}
|
||||
}
|
||||
|
||||
opt.set(dom_prefix + 'address', m.hostname);
|
||||
opt.set(dom_prefix + 'port', m.port || "443");
|
||||
opt.set(dom_prefix + 'obfs', queryParam["obfs-password"]);
|
||||
opt.set(dom_prefix + 'auth', queryParam.auth);
|
||||
|
||||
opt.set(dom_prefix + 'tls_serverName', queryParam.sni);
|
||||
if (queryParam.insecure && queryParam.insecure == "1") {
|
||||
opt.set(dom_prefix + 'tls_allowInsecure', true);
|
||||
|
|
|
@ -1018,6 +1018,12 @@ msgstr "配置路由etc/hosts文件,如果你不知道自己在做什么,请
|
|||
msgid "These had been joined ip addresses will be block. Please input the ip address or ip address segment, every line can input only one ip address."
|
||||
msgstr "加入的IP段将屏蔽。可输入IP地址或地址段,每个地址段一行。"
|
||||
|
||||
msgid "Inbound Tag"
|
||||
msgstr "入站标签"
|
||||
|
||||
msgid "Transparent proxy"
|
||||
msgstr "透明代理"
|
||||
|
||||
msgid "Not valid domain name, please re-enter!"
|
||||
msgstr "不是有效域名,请重新输入!"
|
||||
|
||||
|
@ -1174,11 +1180,8 @@ msgstr "允许不安全连接"
|
|||
msgid "Whether unsafe connections are allowed. When checked, Certificate validation will be skipped."
|
||||
msgstr "是否允许不安全连接。当勾选时,将跳过证书验证。"
|
||||
|
||||
msgid "SS AEAD Node Use Type"
|
||||
msgstr "SS AEAD节点使用类型"
|
||||
|
||||
msgid "Trojan Node Use Type"
|
||||
msgstr "Trojan节点使用类型"
|
||||
msgid "%s Node Use Type"
|
||||
msgstr "%s 节点使用类型"
|
||||
|
||||
msgid "Set the TUIC proxy server ip address"
|
||||
msgstr "指定远程TUIC服务器IP"
|
||||
|
@ -1510,6 +1513,12 @@ msgstr "自定义geosite文件路径"
|
|||
msgid "Custom geosite URL"
|
||||
msgstr "自定义geosite文件更新链接"
|
||||
|
||||
msgid "Remove resource files"
|
||||
msgstr "删除资源文件"
|
||||
|
||||
msgid "Sing-Box will automatically download resource files when starting, you can use this feature achieve upgrade resource files."
|
||||
msgstr "Sing-Box 会在启动时自动下载资源文件,您可以使用此功能实现升级资源文件。"
|
||||
|
||||
msgid "Override the connection destination address"
|
||||
msgstr "覆盖连接目标地址"
|
||||
|
||||
|
|
|
@ -47,9 +47,9 @@ config global_xray
|
|||
config global_singbox
|
||||
option sniff_override_destination '0'
|
||||
option geoip_path '/usr/share/singbox/geoip.db'
|
||||
option geoip_url 'https://github.com/SagerNet/sing-geoip/releases/latest/download/geoip.db'
|
||||
option geoip_url 'https://github.com/MetaCubeX/meta-rules-dat/releases/download/latest/geoip.db'
|
||||
option geosite_path '/usr/share/singbox/geosite.db'
|
||||
option geosite_url 'https://github.com/SagerNet/sing-geosite/releases/latest/download/geosite.db'
|
||||
option geosite_url 'https://github.com/MetaCubeX/meta-rules-dat/releases/download/latest/geosite.db'
|
||||
|
||||
config global_other
|
||||
option nodes_ping 'auto_ping tcping'
|
||||
|
@ -69,7 +69,6 @@ config global_rules
|
|||
list chnroute6_url 'https://fastly.jsdelivr.net/gh/gaoyifan/china-operator-ip@ip-lists/china6.txt'
|
||||
list chnlist_url 'https://fastly.jsdelivr.net/gh/felixonmars/dnsmasq-china-list/accelerated-domains.china.conf'
|
||||
list chnlist_url 'https://fastly.jsdelivr.net/gh/felixonmars/dnsmasq-china-list/apple.china.conf'
|
||||
list chnlist_url 'https://fastly.jsdelivr.net/gh/felixonmars/dnsmasq-china-list/google.china.conf'
|
||||
option v2ray_location_asset '/usr/share/v2ray/'
|
||||
|
||||
config global_app
|
||||
|
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -432,6 +432,7 @@ babynet.com.hk
|
|||
backchina.com
|
||||
backpackers.com.tw
|
||||
backtotiananmen.com
|
||||
bad.news
|
||||
badiucao.com
|
||||
badjojo.com
|
||||
badoo.com
|
||||
|
@ -824,6 +825,7 @@ cahr.org.tw
|
|||
caijinglengyan.com
|
||||
calameo.com
|
||||
calebelston.com
|
||||
calendarz.com
|
||||
calgarychinese.ca
|
||||
calgarychinese.com
|
||||
calgarychinese.net
|
||||
|
@ -890,6 +892,7 @@ cdef.org
|
|||
cdig.info
|
||||
cdjp.org
|
||||
cdn-images.mailchimp.com
|
||||
cdn-telegram.org
|
||||
cdn.assets.lfpcontent.com
|
||||
cdn.helixstudios.net
|
||||
cdn.printfriendly.com
|
||||
|
@ -1142,6 +1145,7 @@ com.google
|
|||
comefromchina.com
|
||||
comic-mega.me
|
||||
commandarms.com
|
||||
comments.app
|
||||
commentshk.com
|
||||
communistcrimes.org
|
||||
community.windy.com
|
||||
|
@ -1155,6 +1159,7 @@ contactmagazine.net
|
|||
contests.twilio.com
|
||||
convio.net
|
||||
coobay.com
|
||||
cool18.com
|
||||
coolaler.com
|
||||
coolder.com
|
||||
coolloud.org.tw
|
||||
|
@ -1352,6 +1357,7 @@ discuss.com.hk
|
|||
discuss4u.com
|
||||
dish.com
|
||||
disk.yandex.com
|
||||
disk.yandex.ru
|
||||
disp.cc
|
||||
disqus.com
|
||||
dit-inc.us
|
||||
|
@ -1996,6 +2002,7 @@ geekerhome.com
|
|||
geekheart.info
|
||||
gekikame.com
|
||||
gelbooru.com
|
||||
generated.photos
|
||||
genius.com
|
||||
geocities.co.jp
|
||||
geocities.com
|
||||
|
@ -2356,10 +2363,10 @@ gr8name.biz
|
|||
grammaly.com
|
||||
grandtrial.org
|
||||
grangorz.org
|
||||
graph.org
|
||||
graphis.ne.jp
|
||||
graphql.org
|
||||
gravatar.com
|
||||
greasespot.net
|
||||
great-firewall.com
|
||||
great-roc.org
|
||||
greatfire.org
|
||||
|
@ -2665,6 +2672,8 @@ hub.docker.com
|
|||
hudatoriq.web.id
|
||||
hudson.org
|
||||
huffingtonpost.com
|
||||
huffpost.com
|
||||
huggingface.co
|
||||
hugoroy.eu
|
||||
huhaitai.com
|
||||
huhamhire.com
|
||||
|
@ -2796,6 +2805,7 @@ indiandefensenews.in
|
|||
indiemerch.com
|
||||
info-graf.fr
|
||||
initiativesforchina.org
|
||||
inkbunny.net
|
||||
inkui.com
|
||||
inmediahk.net
|
||||
innermongolia.org
|
||||
|
@ -3306,6 +3316,7 @@ matome-plus.net
|
|||
matrix.org
|
||||
matsushimakaede.com
|
||||
matters.news
|
||||
matters.town
|
||||
matthewdgreen.wordpress.com
|
||||
mattwilcox.net
|
||||
maturejp.com
|
||||
|
@ -3802,6 +3813,7 @@ oanda.com
|
|||
oann.com
|
||||
observechina.net
|
||||
obutu.com
|
||||
obyte.org
|
||||
ocaspro.com
|
||||
occupytiananmen.com
|
||||
oclp.hk
|
||||
|
@ -4158,6 +4170,7 @@ psiphon.ca
|
|||
psiphon.civisec.org
|
||||
psiphon3.com
|
||||
psiphontoday.com
|
||||
pstatic.net
|
||||
pt.im
|
||||
pts.org.tw
|
||||
ptt.cc
|
||||
|
@ -4213,6 +4226,7 @@ quantumbooter.net
|
|||
questvisual.com
|
||||
quitccp.net
|
||||
quitccp.org
|
||||
quiz.directory
|
||||
quora.com
|
||||
quoracdn.net
|
||||
quran.com
|
||||
|
@ -4373,6 +4387,7 @@ ruyiseek.com
|
|||
rxhj.net
|
||||
s-cute.com
|
||||
s-dragon.org
|
||||
s.yimg.com
|
||||
s1.nudezz.com
|
||||
s1heng.com
|
||||
s1s1s1.com
|
||||
|
@ -4909,9 +4924,11 @@ teensinasia.com
|
|||
tehrantimes.com
|
||||
telecomspace.com
|
||||
telegra.ph
|
||||
telegram-cdn.org
|
||||
telegram.dog
|
||||
telegram.me
|
||||
telegram.org
|
||||
telegram.space
|
||||
telegramdownload.com
|
||||
telegraph.co.uk
|
||||
telesco.pe
|
||||
|
@ -4980,6 +4997,7 @@ thlib.org
|
|||
thomasbernhard.org
|
||||
thongdreams.com
|
||||
threadreaderapp.com
|
||||
threads.net
|
||||
threatchaos.com
|
||||
throughnightsfire.com
|
||||
thumbzilla.com
|
||||
|
@ -5642,6 +5660,7 @@ wattpad.com
|
|||
wav.tv
|
||||
waveprotocol.org
|
||||
waymo.com
|
||||
wd.bible
|
||||
wda.gov.tw
|
||||
wdf5.com
|
||||
wealth.com.tw
|
||||
|
@ -5760,13 +5779,13 @@ wizcrafts.net
|
|||
wjbk.org
|
||||
wlcnew.jigsy.com
|
||||
wlx.sowiki.net
|
||||
wmflabs.org
|
||||
wn.com
|
||||
wnacg.com
|
||||
wnacg.org
|
||||
wo.tc
|
||||
wo3ttt.wordpress.com
|
||||
woeser.com
|
||||
woesermiddle-way.net
|
||||
wokar.org
|
||||
wolfax.com
|
||||
wombo.ai
|
||||
|
@ -5820,7 +5839,6 @@ www.antd.org
|
|||
www.aolnews.com
|
||||
www.businessinsider.com.au
|
||||
www.cmoinc.org
|
||||
www.cool18.com
|
||||
www.dmm.com
|
||||
www.dwheeler.com
|
||||
www.eastturkistan.net
|
||||
|
|
|
@ -28,9 +28,13 @@ local has_trojan_plus = api.is_finded("trojan-plus")
|
|||
local has_singbox = api.finded_com("singbox")
|
||||
local has_xray = api.finded_com("xray")
|
||||
local has_trojan_go = api.finded_com("trojan-go")
|
||||
local has_hysteria2 = api.finded_com("hysteria")
|
||||
local allowInsecure_default = nil
|
||||
local ss_aead_type_default = uci:get(appname, "@global_subscribe[0]", "ss_aead_type") or "shadowsocks-libev"
|
||||
local trojan_type_default = uci:get(appname, "@global_subscribe[0]", "trojan_type") or "trojan-plus"
|
||||
local vmess_type_default = uci:get(appname, "@global_subscribe[0]", "vmess_type") or "xray"
|
||||
local vless_type_default = uci:get(appname, "@global_subscribe[0]", "vless_type") or "xray"
|
||||
local hysteria2_type_default = uci:get(appname, "@global_subscribe[0]", "hysteria2_type") or "hysteria2"
|
||||
-- 判断是否过滤节点关键字
|
||||
local filter_keyword_mode_default = uci:get(appname, "@global_subscribe[0]", "filter_keyword_mode") or "0"
|
||||
local filter_keyword_discard_list_default = uci:get(appname, "@global_subscribe[0]", "filter_discard_list") or {}
|
||||
|
@ -376,9 +380,16 @@ local function processData(szType, content, add_mode, add_from)
|
|||
local info = jsonParse(content)
|
||||
if has_singbox then
|
||||
result.type = 'sing-box'
|
||||
elseif has_xray then
|
||||
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
|
||||
result.type = "Xray"
|
||||
end
|
||||
result.alter_id = info.aid
|
||||
result.address = info.add
|
||||
result.port = info.port
|
||||
|
@ -706,6 +717,12 @@ local function processData(szType, content, add_mode, add_from)
|
|||
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
|
||||
result.type = "Xray"
|
||||
end
|
||||
result.protocol = "vless"
|
||||
local alias = ""
|
||||
if content:find("#") then
|
||||
|
@ -806,7 +823,6 @@ local function processData(szType, content, add_mode, add_from)
|
|||
content = content:sub(0, idx_sp - 1)
|
||||
end
|
||||
result.remarks = UrlDecode(alias)
|
||||
result.type = "Hysteria"
|
||||
|
||||
local dat = split(content, '%?')
|
||||
local host_port = dat[1]
|
||||
|
@ -844,6 +860,62 @@ local function processData(szType, content, add_mode, add_from)
|
|||
result.hysteria_alpn = params.alpn
|
||||
result.hysteria_up_mbps = params.upmbps
|
||||
result.hysteria_down_mbps = params.downmbps
|
||||
|
||||
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
|
||||
local idx_sp = content:find("#")
|
||||
alias = content:sub(idx_sp + 1, -1)
|
||||
content = content:sub(0, idx_sp - 1)
|
||||
end
|
||||
result.remarks = UrlDecode(alias)
|
||||
|
||||
local dat = split(content, '%?')
|
||||
local host_port = dat[1]
|
||||
local params = {}
|
||||
for _, v in pairs(split(dat[2], '&')) do
|
||||
local t = split(v, '=')
|
||||
if #t > 0 then
|
||||
params[t[1]] = t[2]
|
||||
end
|
||||
end
|
||||
-- [2001:4860:4860::8888]:443
|
||||
-- 8.8.8.8:443
|
||||
if host_port:find(":") then
|
||||
local sp = split(host_port, ":")
|
||||
result.port = sp[#sp]
|
||||
if api.is_ipv6addrport(host_port) then
|
||||
result.address = api.get_ipv6_only(host_port)
|
||||
else
|
||||
result.address = sp[1]
|
||||
end
|
||||
else
|
||||
result.address = host_port
|
||||
end
|
||||
result.hysteria2_auth_password = params.auth
|
||||
result.tls_serverName = params.sni
|
||||
if params.insecure and (params.insecure == "1" or params.insecure == "0") then
|
||||
result.tls_allowInsecure = params.insecure
|
||||
--log(result.remarks ..' 使用节点AllowInsecure设定: '.. result.tls_allowInsecure)
|
||||
else
|
||||
result.tls_allowInsecure = allowInsecure_default and "1" or "0"
|
||||
end
|
||||
result.hysteria2_tls_pinSHA256 = params.pinSHA256
|
||||
|
||||
if has_hysteria2 then
|
||||
result.type = "Hysteria2"
|
||||
result.hysteria2_obfs = params["obfs-password"]
|
||||
end
|
||||
if hysteria2_type_default == "sing-box" and has_singbox then
|
||||
result.type = 'sing-box'
|
||||
result.protocol = "hysteria2"
|
||||
result.hysteria2_obfs_type = "salamander"
|
||||
result.hysteria2_obfs_password = params["obfs-password"]
|
||||
end
|
||||
else
|
||||
log('暂时不支持' .. szType .. "类型的节点订阅,跳过此节点。")
|
||||
return nil
|
||||
|
@ -1216,6 +1288,18 @@ local execute = function()
|
|||
if trojan_type ~= "global" then
|
||||
trojan_type_default = trojan_type
|
||||
end
|
||||
local vmess_type = value.vmess_type or "global"
|
||||
if vmess_type ~= "global" then
|
||||
vmess_type_default = vmess_type
|
||||
end
|
||||
local vless_type = value.vless_type or "global"
|
||||
if vless_type ~= "global" then
|
||||
vless_type_default = vless_type
|
||||
end
|
||||
local hysteria2_type = value.hysteria2_type or "global"
|
||||
if hysteria2_type ~= "global" then
|
||||
hysteria2_type_default = hysteria2_type
|
||||
end
|
||||
local ua = value.user_agent
|
||||
log('正在订阅:【' .. remark .. '】' .. url)
|
||||
local raw = curl(url, "/tmp/" .. cfgid, ua)
|
||||
|
@ -1235,6 +1319,9 @@ local execute = function()
|
|||
filter_keyword_keep_list_default = uci:get(appname, "@global_subscribe[0]", "filter_keep_list") or {}
|
||||
ss_aead_type_default = uci:get(appname, "@global_subscribe[0]", "ss_aead_type") or "shadowsocks-libev"
|
||||
trojan_type_default = uci:get(appname, "@global_subscribe[0]", "trojan_type") or "trojan-plus"
|
||||
vmess_type_default = uci:get(appname, "@global_subscribe[0]", "vmess_type") or "xray"
|
||||
vless_type_default = uci:get(appname, "@global_subscribe[0]", "vless_type") or "xray"
|
||||
hysteria2_type_default = uci:get(appname, "@global_subscribe[0]", "hysteria2_type") or "hysteria2"
|
||||
end
|
||||
|
||||
if #fail_list > 0 then
|
||||
|
|
Loading…
Reference in New Issue