mirror of
https://github.com/kenzok8/small-package
synced 2025-01-08 13:27:36 +08:00
update 2024-04-01 00:18:09
This commit is contained in:
parent
93b3ff5055
commit
20cb82e002
@ -5,13 +5,13 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=daed
|
||||
PKG_RELEASE:=1
|
||||
PKG_RELEASE:=2
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://github.com/daeuniverse/daed.git
|
||||
PKG_SOURCE_DATE:=2023-11-03
|
||||
PKG_SOURCE_VERSION:=54bc33934d0e323449df11fc26dc9569edbbe13c
|
||||
PKG_MIRROR_HASH:=1d4d8b4fd163834acec3d227ef56697d79ffa374309105a9e6b35dcf4aa96b14
|
||||
PKG_SOURCE_DATE:=2024-03-27
|
||||
PKG_SOURCE_VERSION:=2841ec229ff3a0675293b95a23f0f3aac2604982
|
||||
PKG_MIRROR_HASH:=f53d172431d76fc32fb2adb8761896c07900f1a9bf55ba219e5e6b1c40ac6796
|
||||
|
||||
PKG_LICENSE:=AGPL-3.0-only MIT
|
||||
PKG_LICENSE_FILES:=LICENSE wing/LICENSE
|
||||
@ -48,7 +48,8 @@ define Package/daed
|
||||
TITLE:=A Modern Dashboard For dae
|
||||
# You need enable KERNEL_DEBUG_INFO_BTF and KERNEL_BPF_EVENTS
|
||||
DEPENDS:=$(GO_ARCH_DEPENDS) $(BPF_DEPENDS) \
|
||||
+ca-bundle +kmod-sched-core +kmod-sched-bpf +kmod-xdp-sockets-diag
|
||||
+ca-bundle +kmod-sched-core +kmod-sched-bpf +kmod-xdp-sockets-diag \
|
||||
+kmod-veth
|
||||
endef
|
||||
|
||||
define Package/daed-geoip
|
||||
@ -79,7 +80,7 @@ WEB_FILE:=$(PKG_NAME)-web-$(PKG_VERSION).zip
|
||||
define Download/daed-web
|
||||
URL:=@IMMORTALWRT
|
||||
FILE:=$(WEB_FILE)
|
||||
HASH:=8cbff499a250ab5af859e3374f566c683925ef9b3efddce7ceeefdf44ef6fe04
|
||||
HASH:=dee10f5c646cddb47b0ef1e377a956b7d4841dc90931ab720299f73da705f10b
|
||||
endef
|
||||
|
||||
define Build/Prepare
|
||||
|
@ -56,10 +56,10 @@ o.rewrite_option = o.option
|
||||
o = s:option(Value, option_name("hop_interval"), translate("Hop Interval"))
|
||||
o.rewrite_option = o.option
|
||||
|
||||
o = s:option(Value, option_name("recv_window_conn"), translate("QUIC stream receive window"))
|
||||
o = s:option(Value, option_name("recv_window_conn"), translate("QUIC connection receive window"))
|
||||
o.rewrite_option = o.option
|
||||
|
||||
o = s:option(Value, option_name("recv_window"), translate("QUIC connection receive window"))
|
||||
o = s:option(Value, option_name("recv_window"), translate("QUIC stream receive window"))
|
||||
o.rewrite_option = o.option
|
||||
|
||||
o = s:option(Value, option_name("idle_timeout"), translate("Idle Timeout"))
|
||||
|
@ -94,6 +94,15 @@ o:value("leastPing")
|
||||
o:value("leastLoad")
|
||||
o.default = "leastLoad"
|
||||
|
||||
-- Fallback Node
|
||||
if api.compare_versions(api.get_app_version("xray"), ">=", "1.8.10") then
|
||||
local o = s:option(ListValue, option_name("fallback_node"), translate("Fallback Node"))
|
||||
o:depends({ [option_name("protocol")] = "_balancing" })
|
||||
o:value("",translate("Null"))
|
||||
o.default = ""
|
||||
for k, v in pairs(nodes_table) do o:value(v.id, v.remark) end
|
||||
end
|
||||
|
||||
-- 探测地址
|
||||
local o = s:option(Flag, option_name("useCustomProbeUrl"), translate("Use Custome Probe URL"), translate("By default the built-in probe URL will be used, enable this option to use a custom probe URL."))
|
||||
o:depends({ [option_name("balancingStrategy")] = "leastPing" })
|
||||
|
@ -646,6 +646,7 @@ function gen_config(var)
|
||||
|
||||
local function gen_balancer(_node, loopbackTag)
|
||||
local blc_nodes = _node.balancing_node
|
||||
local fallback_node_id = _node.fallback_node
|
||||
local length = #blc_nodes
|
||||
local valid_nodes = {}
|
||||
for i = 1, length do
|
||||
@ -668,6 +669,27 @@ function gen_config(var)
|
||||
end
|
||||
end
|
||||
end
|
||||
if fallback_node_id == "" then
|
||||
fallback_node_id = nil
|
||||
end
|
||||
if fallback_node_id then
|
||||
local is_new_node = true
|
||||
for _, outbound in ipairs(outbounds) do
|
||||
if outbound.tag == fallback_node_id then
|
||||
is_new_node = false
|
||||
break
|
||||
end
|
||||
end
|
||||
if is_new_node then
|
||||
local fallback_node = uci:get_all(appname, fallback_node_id)
|
||||
local outbound = gen_outbound(flag, fallback_node, fallback_node_id, { fragment = xray_settings.fragment == "1" or nil })
|
||||
if outbound then
|
||||
table.insert(outbounds, outbound)
|
||||
else
|
||||
fallback_node_id = nil
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
local balancer, rule
|
||||
if #valid_nodes > 0 then
|
||||
@ -675,6 +697,7 @@ function gen_config(var)
|
||||
balancer = {
|
||||
tag = balancerTag,
|
||||
selector = valid_nodes,
|
||||
fallbackTag = fallback_node_id,
|
||||
strategy = { type = _node.balancingStrategy or "random" }
|
||||
}
|
||||
if _node.balancingStrategy == "leastPing" or _node.balancingStrategy == "leastLoad" then
|
||||
@ -683,23 +706,22 @@ function gen_config(var)
|
||||
subjectSelector = { "blc-" },
|
||||
probeUrl = _node.useCustomProbeUrl and _node.probeUrl or nil,
|
||||
probeInterval = _node.probeInterval or "1m",
|
||||
enableConcurrency = node.type == "Xray" and true or nil --这里只判断顶层节点(分流总节点/单独的负载均衡节点)类型为Xray,就可以启用并发
|
||||
enableConcurrency = true
|
||||
}
|
||||
end
|
||||
end
|
||||
if loopbackTag and loopbackTag ~= "" then
|
||||
local inboundTag = loopbackTag .. "-in"
|
||||
table.insert(outbounds, {
|
||||
protocol = "loopback",
|
||||
tag = loopbackTag,
|
||||
settings = { inboundTag = inboundTag }
|
||||
})
|
||||
rule = {
|
||||
type = "field",
|
||||
inboundTag = { inboundTag },
|
||||
balancerTag = balancerTag
|
||||
}
|
||||
end
|
||||
if loopbackTag == nil or loopbackTag =="" then loopbackTag = _node[".name"] end
|
||||
local inboundTag = loopbackTag .. "-in"
|
||||
table.insert(outbounds, {
|
||||
protocol = "loopback",
|
||||
tag = loopbackTag,
|
||||
settings = { inboundTag = inboundTag }
|
||||
})
|
||||
rule = {
|
||||
type = "field",
|
||||
inboundTag = { inboundTag },
|
||||
balancerTag = balancerTag
|
||||
}
|
||||
end
|
||||
return balancer, rule
|
||||
end
|
||||
@ -891,9 +913,10 @@ function gen_config(var)
|
||||
end
|
||||
end
|
||||
if is_new_balancer then
|
||||
local balancer = gen_balancer(_node)
|
||||
local balancer, rule = gen_balancer(_node)
|
||||
if balancer then
|
||||
table.insert(balancers, balancer)
|
||||
table.insert(rules, rule)
|
||||
rule_balancerTag = balancer.tag
|
||||
end
|
||||
end
|
||||
@ -1020,11 +1043,12 @@ function gen_config(var)
|
||||
}
|
||||
elseif node.protocol == "_balancing" then
|
||||
if node.balancing_node then
|
||||
local balancer = gen_balancer(node)
|
||||
local balancer, rule = gen_balancer(node)
|
||||
routing = {
|
||||
balancers = { balancer },
|
||||
rules = {
|
||||
{ type = "field", network = "tcp,udp", balancerTag = balancer.tag }
|
||||
{ type = "field", network = "tcp,udp", balancerTag = balancer.tag },
|
||||
rule
|
||||
}
|
||||
}
|
||||
end
|
||||
@ -1286,7 +1310,7 @@ function gen_config(var)
|
||||
-- }
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if xray_settings.fragment == "1" then
|
||||
table.insert(outbounds, {
|
||||
protocol = "freedom",
|
||||
@ -1305,9 +1329,9 @@ function gen_config(var)
|
||||
tcpNoDelay = true
|
||||
}
|
||||
}
|
||||
})
|
||||
})
|
||||
end
|
||||
|
||||
|
||||
table.insert(outbounds, {
|
||||
protocol = "freedom",
|
||||
tag = "direct",
|
||||
|
@ -388,6 +388,9 @@ msgstr "负载均衡"
|
||||
msgid "Balancing Strategy"
|
||||
msgstr "负载均衡策略"
|
||||
|
||||
msgid "Fallback Node"
|
||||
msgstr "后备节点"
|
||||
|
||||
msgid "Use Custome Probe URL"
|
||||
msgstr "使用自定义探测网址"
|
||||
|
||||
|
@ -21,13 +21,13 @@ define Download/geoip
|
||||
HASH:=c4a43c690153b91e69c66808840841dd7fb37e5e6326658c592d32f0519b50f3
|
||||
endef
|
||||
|
||||
GEOSITE_VER:=20240324094850
|
||||
GEOSITE_VER:=20240331083526
|
||||
GEOSITE_FILE:=dlc.dat.$(GEOSITE_VER)
|
||||
define Download/geosite
|
||||
URL:=https://github.com/v2fly/domain-list-community/releases/download/$(GEOSITE_VER)/
|
||||
URL_FILE:=dlc.dat
|
||||
FILE:=$(GEOSITE_FILE)
|
||||
HASH:=402d4bdbec16f1d3fce3f5a29dcd5a08725b8e071a507a4b2650d2c2e72f0e9d
|
||||
HASH:=544454d37f044d30d21f771e848ee7d956cc3b2a99f7e040434db62d7288d32e
|
||||
endef
|
||||
|
||||
GEOSITE_IRAN_VER:=202403250026
|
||||
|
Loading…
Reference in New Issue
Block a user