mirror of
https://github.com/kiddin9/op-packages.git
synced 2026-11-16 21:43:33 +08:00
🔥 Sync 2026-10-24 23:19:23
This commit is contained in:
1 parent
9886197604
commit
37e1475e87
59 files changed
+5167
-1483
No files matched your search
@@ -579,11 +579,15 @@ function gen_config_server(node)
|
||||
end
|
||||
end
|
||||
|
||||
if node.protocol == "vmess" or node.protocol == "vless" then
|
||||
if node.protocol == "vless" then
|
||||
settings = {
|
||||
users = users,
|
||||
decryption = (node.decryption and node.decryption ~= "") and node.decryption or "none"
|
||||
}
|
||||
elseif node.protocol == "vmess" then
|
||||
if users then
|
||||
settings = {
|
||||
users = users,
|
||||
decryption = (node.protocol == "vless") and ((node.decryption and node.decryption ~= "") and node.decryption or "none") or nil
|
||||
users = users
|
||||
}
|
||||
end
|
||||
elseif node.protocol == "socks" then
|
||||
@@ -1479,8 +1483,21 @@ function gen_config(var)
|
||||
local bin = api.finded_com("geoview")
|
||||
if bin then
|
||||
local geo_file = (api.uci_get_c("@global_rules[0]", "v2ray_location_asset") or "/usr/share/v2ray/"):match("^(.*)/") .. "/geosite.dat"
|
||||
if luci.sys.call('"' .. bin .. '" -type geosite -input "' .. geo_file .. '" | grep -q "^GFW$"') == 0 then
|
||||
domain_list = (domain_list == "") and "geosite:gfw" or domain_list .. "\ngeosite:gfw"
|
||||
local gfw_rule
|
||||
if sys.call('"' .. bin .. '" -type geosite -input "' .. geo_file .. '" 2>/dev/null | grep -q "^GFW$"') == 0 then
|
||||
gfw_rule = "geosite:gfw"
|
||||
elseif api.compare_versions(api.get_app_version("geoview"), ">=", "0.2.8") then
|
||||
local output = api.CACHE_PATH .. "/geodata/gfwlist.dat"
|
||||
if not fs.access(output) then
|
||||
fs.mkdirr(api.CACHE_PATH .. "/geodata")
|
||||
local cmd = string.format("%s -type geosite -action convert -input /usr/share/passwall/rules/gfwlist -list '*' -output %s -format geosite",
|
||||
api.util.shellquote(bin), api.util.shellquote(output))
|
||||
if api.exec_call(cmd) ~= 0 then fs.unlink(output) end
|
||||
end
|
||||
gfw_rule = fs.access(output) and "ext:gfwlist.dat:all" or nil
|
||||
end
|
||||
if gfw_rule then
|
||||
domain_list = (domain_list == "") and gfw_rule or domain_list .. "\n" .. gfw_rule
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1539,7 +1556,7 @@ function gen_config(var)
|
||||
w = api.trim(w)
|
||||
if w == "" or w:find("#") == 1 then return end
|
||||
if w:find("rule-set:", 1, true) == 1 or w:find("rs:") == 1 then return end
|
||||
if w:find("ext:", 1, true) == 1 then return end -- Rule currently not support ext:
|
||||
if w:find("ext:", 1, true) == 1 and not (e[".name"] == "GFW_Mode_List" and w == "ext:gfwlist.dat:all") then return end
|
||||
table.insert(domains, w)
|
||||
table.insert(domain_table.domain, w)
|
||||
end)
|
||||
@@ -2051,10 +2068,7 @@ function gen_config(var)
|
||||
|
||||
if inbounds or outbounds then
|
||||
local config = {
|
||||
env = (function()
|
||||
local asset_location = api.uci_get_c("@global_rules[0]", "v2ray_location_asset") or "/usr/share/v2ray/"
|
||||
return { XRAY_LOCATION_ASSET = asset_location }
|
||||
end)(),
|
||||
env = { XRAY_LOCATION_ASSET = api.CACHE_PATH .. "/geodata" },
|
||||
log = {
|
||||
-- error = string.format("/tmp/etc/passwall/%s.log", node[".name"]),
|
||||
loglevel = get_log_level(loglevel)
|
||||
|
||||
Reference in new issue
Block a user