mirror of https://github.com/kenzok8/small.git
update 2023-12-30 20:14:29
This commit is contained in:
parent
2207bf0c82
commit
62d7c26a29
|
@ -5,12 +5,12 @@
|
||||||
include $(TOPDIR)/rules.mk
|
include $(TOPDIR)/rules.mk
|
||||||
|
|
||||||
PKG_NAME:=hysteria
|
PKG_NAME:=hysteria
|
||||||
PKG_VERSION:=2.2.2
|
PKG_VERSION:=2.2.3
|
||||||
PKG_RELEASE:=1
|
PKG_RELEASE:=1
|
||||||
|
|
||||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
||||||
PKG_SOURCE_URL:=https://codeload.github.com/apernet/hysteria/tar.gz/app/v$(PKG_VERSION)?
|
PKG_SOURCE_URL:=https://codeload.github.com/apernet/hysteria/tar.gz/app/v$(PKG_VERSION)?
|
||||||
PKG_HASH:=b4088f9ea4cf1299a1c372b39a088063e57d9dde61dfdf2a3ca7f04b89bc9536
|
PKG_HASH:=123bc416b21bc7288a24504915d81b87651f4b1e1b93805a69864e9adccf1066
|
||||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-app-v$(PKG_VERSION)
|
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-app-v$(PKG_VERSION)
|
||||||
|
|
||||||
PKG_LICENSE:=MIT
|
PKG_LICENSE:=MIT
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
include $(TOPDIR)/rules.mk
|
include $(TOPDIR)/rules.mk
|
||||||
|
|
||||||
PKG_NAME:=luci-app-passwall2
|
PKG_NAME:=luci-app-passwall2
|
||||||
PKG_VERSION:=1.21-4
|
PKG_VERSION:=1.22-1
|
||||||
PKG_RELEASE:=
|
PKG_RELEASE:=
|
||||||
|
|
||||||
PKG_CONFIG_DEPENDS:= \
|
PKG_CONFIG_DEPENDS:= \
|
||||||
|
|
|
@ -185,6 +185,20 @@ if has_singbox then
|
||||||
o.default = "https://github.com/SagerNet/sing-geosite/releases/latest/download/geosite.db"
|
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:value("https://github.com/SagerNet/sing-geosite/releases/latest/download/geosite.db")
|
||||||
o.rmempty = false
|
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
|
end
|
||||||
|
|
||||||
return m
|
return m
|
||||||
|
|
|
@ -19,6 +19,10 @@ protocol:value("http")
|
||||||
protocol:value("tls")
|
protocol:value("tls")
|
||||||
protocol:value("bittorrent")
|
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 = s:option(ListValue, "network", translate("Network"))
|
||||||
network:value("tcp,udp", "TCP UDP")
|
network:value("tcp,udp", "TCP UDP")
|
||||||
network:value("tcp", "TCP")
|
network:value("tcp", "TCP")
|
||||||
|
|
|
@ -106,6 +106,29 @@ function trim(s)
|
||||||
return (s:gsub("^%s*(.-)%s*$", "%1"))
|
return (s:gsub("^%s*(.-)%s*$", "%1"))
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- 分割字符串
|
||||||
|
function split(full, sep)
|
||||||
|
if full then
|
||||||
|
full = full:gsub("%z", "") -- 这里不是很清楚 有时候结尾带个\0
|
||||||
|
local off, result = 1, {}
|
||||||
|
while true do
|
||||||
|
local nStart, nEnd = full:find(sep, off)
|
||||||
|
if not nEnd then
|
||||||
|
local res = string.sub(full, off, string.len(full))
|
||||||
|
if #res > 0 then -- 过滤掉 \0
|
||||||
|
table.insert(result, res)
|
||||||
|
end
|
||||||
|
break
|
||||||
|
else
|
||||||
|
table.insert(result, string.sub(full, off, nStart - 1))
|
||||||
|
off = nEnd + 1
|
||||||
|
end
|
||||||
|
end
|
||||||
|
return result
|
||||||
|
end
|
||||||
|
return {}
|
||||||
|
end
|
||||||
|
|
||||||
function is_exist(table, value)
|
function is_exist(table, value)
|
||||||
for index, k in ipairs(table) do
|
for index, k in ipairs(table) do
|
||||||
if k == value then
|
if k == value then
|
||||||
|
|
|
@ -129,19 +129,6 @@ function gen_outbound(flag, node, tag, proxy_table)
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
local mux = nil
|
|
||||||
if node.mux == "1" then
|
|
||||||
mux = {
|
|
||||||
enabled = true,
|
|
||||||
padding = (node.mux_padding == "1") and true or false,
|
|
||||||
brutal = {
|
|
||||||
enabled = (node.tcpbrutal == "1") and true or false,
|
|
||||||
up_mbps = tonumber(node.tcpbrutal_up_mbps) or 10,
|
|
||||||
down_mbps = tonumber(node.tcpbrutal_down_mbps) or 50,
|
|
||||||
},
|
|
||||||
}
|
|
||||||
end
|
|
||||||
|
|
||||||
local v2ray_transport = nil
|
local v2ray_transport = nil
|
||||||
|
|
||||||
if node.transport == "http" then
|
if node.transport == "http" then
|
||||||
|
@ -429,6 +416,19 @@ function gen_config_server(node)
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local mux = nil
|
||||||
|
if node.mux == "1" then
|
||||||
|
mux = {
|
||||||
|
enabled = true,
|
||||||
|
padding = (node.mux_padding == "1") and true or false,
|
||||||
|
brutal = {
|
||||||
|
enabled = (node.tcpbrutal == "1") and true or false,
|
||||||
|
up_mbps = tonumber(node.tcpbrutal_up_mbps) or 10,
|
||||||
|
down_mbps = tonumber(node.tcpbrutal_down_mbps) or 50,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
local v2ray_transport = nil
|
local v2ray_transport = nil
|
||||||
|
|
||||||
if node.transport == "http" then
|
if node.transport == "http" then
|
||||||
|
@ -1052,7 +1052,28 @@ function gen_config(var)
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local inboundTag = nil
|
||||||
|
if e["inbound"] and e["inbound"] ~= "" then
|
||||||
|
inboundTag = {}
|
||||||
|
if e["inbound"]:find("tproxy") then
|
||||||
|
if redir_port then
|
||||||
|
if tcp_proxy_way == "tproxy" then
|
||||||
|
table.insert(inboundTag, "tproxy")
|
||||||
|
else
|
||||||
|
table.insert(inboundTag, "redirect_tcp")
|
||||||
|
table.insert(inboundTag, "tproxy_udp")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
if e["inbound"]:find("socks") then
|
||||||
|
if local_socks_port then
|
||||||
|
table.insert(inboundTag, "socks-in")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
local rule = {
|
local rule = {
|
||||||
|
inbound = inboundTag,
|
||||||
outbound = outboundTag,
|
outbound = outboundTag,
|
||||||
invert = false, --匹配反选
|
invert = false, --匹配反选
|
||||||
protocol = protocols
|
protocol = protocols
|
||||||
|
@ -1352,6 +1373,7 @@ function gen_config(var)
|
||||||
}
|
}
|
||||||
if value.outboundTag ~= "block" and value.outboundTag ~= "direct" then
|
if value.outboundTag ~= "block" and value.outboundTag ~= "direct" then
|
||||||
dns_rule.server = "remote"
|
dns_rule.server = "remote"
|
||||||
|
dns_rule.rewrite_ttl = 30
|
||||||
if value.outboundTag ~= "default" and remote_server.address and remote_server.detour ~= "direct" then
|
if value.outboundTag ~= "default" and remote_server.address and remote_server.detour ~= "direct" then
|
||||||
local remote_dns_server = api.clone(remote_server)
|
local remote_dns_server = api.clone(remote_server)
|
||||||
remote_dns_server.tag = value.outboundTag
|
remote_dns_server.tag = value.outboundTag
|
||||||
|
@ -1403,11 +1425,14 @@ function gen_config(var)
|
||||||
end
|
end
|
||||||
if direct_nftset then
|
if direct_nftset then
|
||||||
string.gsub(direct_nftset, '[^' .. "," .. ']+', function(w)
|
string.gsub(direct_nftset, '[^' .. "," .. ']+', function(w)
|
||||||
local s = string.reverse(w)
|
local split = api.split(w, "#")
|
||||||
local _, i = string.find(s, "#")
|
if #split > 3 then
|
||||||
local m = string.len(s) - i + 1
|
local ip_type = split[1]
|
||||||
local n = w:sub(m + 1)
|
local family = split[2]
|
||||||
sys.call("nft flush set inet fw4 " .. n .. " 2>/dev/null")
|
local table_name = split[3]
|
||||||
|
local set_name = split[4]
|
||||||
|
sys.call(string.format("nft flush set %s %s %s 2>/dev/null", family, table_name, set_name))
|
||||||
|
end
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -554,6 +554,7 @@ function gen_config(var)
|
||||||
|
|
||||||
if local_socks_port then
|
if local_socks_port then
|
||||||
local inbound = {
|
local inbound = {
|
||||||
|
tag = "socks-in",
|
||||||
listen = local_socks_address,
|
listen = local_socks_address,
|
||||||
port = tonumber(local_socks_port),
|
port = tonumber(local_socks_port),
|
||||||
protocol = "socks",
|
protocol = "socks",
|
||||||
|
@ -874,6 +875,21 @@ function gen_config(var)
|
||||||
table.insert(protocols, w)
|
table.insert(protocols, w)
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
local inboundTag = nil
|
||||||
|
if e["inbound"] and e["inbound"] ~= "" then
|
||||||
|
inboundTag = {}
|
||||||
|
if e["inbound"]:find("tproxy") then
|
||||||
|
if redir_port then
|
||||||
|
table.insert(inboundTag, "tcp_redir")
|
||||||
|
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
|
local domains = nil
|
||||||
if e.domain_list then
|
if e.domain_list then
|
||||||
domains = {}
|
domains = {}
|
||||||
|
@ -912,6 +928,7 @@ function gen_config(var)
|
||||||
local rule = {
|
local rule = {
|
||||||
_flag = e.remarks,
|
_flag = e.remarks,
|
||||||
type = "field",
|
type = "field",
|
||||||
|
inboundTag = inboundTag,
|
||||||
outboundTag = outboundTag,
|
outboundTag = outboundTag,
|
||||||
balancerTag = balancerTag,
|
balancerTag = balancerTag,
|
||||||
network = e["network"] or "tcp,udp",
|
network = e["network"] or "tcp,udp",
|
||||||
|
@ -1244,11 +1261,14 @@ function gen_config(var)
|
||||||
end
|
end
|
||||||
if direct_nftset then
|
if direct_nftset then
|
||||||
string.gsub(direct_nftset, '[^' .. "," .. ']+', function(w)
|
string.gsub(direct_nftset, '[^' .. "," .. ']+', function(w)
|
||||||
local s = string.reverse(w)
|
local split = api.split(w, "#")
|
||||||
local _, i = string.find(s, "#")
|
if #split > 3 then
|
||||||
local m = string.len(s) - i + 1
|
local ip_type = split[1]
|
||||||
local n = w:sub(m + 1)
|
local family = split[2]
|
||||||
sys.call("nft flush set inet fw4 " .. n .. " 2>/dev/null")
|
local table_name = split[3]
|
||||||
|
local set_name = split[4]
|
||||||
|
sys.call(string.format("nft flush set %s %s %s 2>/dev/null", family, table_name, set_name))
|
||||||
|
end
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -1607,7 +1627,7 @@ function gen_dns_config(var)
|
||||||
tag = "dns-in",
|
tag = "dns-in",
|
||||||
settings = {
|
settings = {
|
||||||
address = other_type_dns_server or "1.1.1.1",
|
address = other_type_dns_server or "1.1.1.1",
|
||||||
port = 53,
|
port = other_type_dns_port or 53,
|
||||||
network = "tcp,udp"
|
network = "tcp,udp"
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
|
@ -955,6 +955,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."
|
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地址或地址段,每个地址段一行。"
|
msgstr "加入的IP段将屏蔽。可输入IP地址或地址段,每个地址段一行。"
|
||||||
|
|
||||||
|
msgid "Inbound Tag"
|
||||||
|
msgstr "入站标签"
|
||||||
|
|
||||||
|
msgid "Transparent proxy"
|
||||||
|
msgstr "透明代理"
|
||||||
|
|
||||||
msgid "Not valid domain name, please re-enter!"
|
msgid "Not valid domain name, please re-enter!"
|
||||||
msgstr "不是有效域名,请重新输入!"
|
msgstr "不是有效域名,请重新输入!"
|
||||||
|
|
||||||
|
@ -1414,6 +1420,12 @@ msgstr "端口跳跃时间 "
|
||||||
msgid "Additional ports for hysteria hop"
|
msgid "Additional ports for hysteria hop"
|
||||||
msgstr "端口跳跃额外端口"
|
msgstr "端口跳跃额外端口"
|
||||||
|
|
||||||
|
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"
|
msgid "Override the connection destination address"
|
||||||
msgstr "覆盖连接目标地址"
|
msgstr "覆盖连接目标地址"
|
||||||
|
|
||||||
|
|
|
@ -16,6 +16,7 @@ local datatypes = require "luci.cbi.datatypes"
|
||||||
-- so caching them is worth the effort
|
-- so caching them is worth the effort
|
||||||
local tinsert = table.insert
|
local tinsert = table.insert
|
||||||
local ssub, slen, schar, sbyte, sformat, sgsub = string.sub, string.len, string.char, string.byte, string.format, string.gsub
|
local ssub, slen, schar, sbyte, sformat, sgsub = string.sub, string.len, string.char, string.byte, string.format, string.gsub
|
||||||
|
local split = api.split
|
||||||
local jsonParse, jsonStringify = luci.jsonc.parse, luci.jsonc.stringify
|
local jsonParse, jsonStringify = luci.jsonc.parse, luci.jsonc.stringify
|
||||||
local base64Decode = api.base64Decode
|
local base64Decode = api.base64Decode
|
||||||
local uci = luci.model.uci.cursor()
|
local uci = luci.model.uci.cursor()
|
||||||
|
@ -309,28 +310,6 @@ do
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
-- 分割字符串
|
|
||||||
local function split(full, sep)
|
|
||||||
if full then
|
|
||||||
full = full:gsub("%z", "") -- 这里不是很清楚 有时候结尾带个\0
|
|
||||||
local off, result = 1, {}
|
|
||||||
while true do
|
|
||||||
local nStart, nEnd = full:find(sep, off)
|
|
||||||
if not nEnd then
|
|
||||||
local res = ssub(full, off, slen(full))
|
|
||||||
if #res > 0 then -- 过滤掉 \0
|
|
||||||
tinsert(result, res)
|
|
||||||
end
|
|
||||||
break
|
|
||||||
else
|
|
||||||
tinsert(result, ssub(full, off, nStart - 1))
|
|
||||||
off = nEnd + 1
|
|
||||||
end
|
|
||||||
end
|
|
||||||
return result
|
|
||||||
end
|
|
||||||
return {}
|
|
||||||
end
|
|
||||||
-- urlencode
|
-- urlencode
|
||||||
-- local function get_urlencode(c) return sformat("%%%02X", sbyte(c)) end
|
-- local function get_urlencode(c) return sformat("%%%02X", sbyte(c)) end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue