mirror of
https://github.com/kiddin9/op-packages.git
synced 2026-11-03 02:23:56 +08:00
🐶 Sync 2026-06-03 21:58:23
This commit is contained in:
1 parent
4a70c88048
commit
c9c56d7f6e
33 files changed
+485
-162
No files matched your search
@@ -498,9 +498,9 @@ function gen_config_server(node)
|
||||
|
||||
if node.protocol == "vmess" or node.protocol == "vless" then
|
||||
if node.uuid then
|
||||
local clients = {}
|
||||
local users = {}
|
||||
for i = 1, #node.uuid do
|
||||
clients[i] = {
|
||||
users[i] = {
|
||||
id = node.uuid[i],
|
||||
flow = (node.protocol == "vless"
|
||||
and (node.tls == "1" or (node.decryption and node.decryption ~= "" and node.decryption ~= "none"))
|
||||
@@ -508,7 +508,7 @@ function gen_config_server(node)
|
||||
}
|
||||
end
|
||||
settings = {
|
||||
clients = clients,
|
||||
users = users,
|
||||
decryption = (node.protocol == "vless") and ((node.decryption and node.decryption ~= "") and node.decryption or "none") or nil
|
||||
}
|
||||
end
|
||||
@@ -516,7 +516,7 @@ function gen_config_server(node)
|
||||
settings = {
|
||||
udp = ("1" == node.udp_forward) and true or false,
|
||||
auth = ("1" == node.auth) and "password" or "noauth",
|
||||
accounts = ("1" == node.auth) and {
|
||||
users = ("1" == node.auth) and {
|
||||
{
|
||||
user = node.username,
|
||||
pass = node.password
|
||||
@@ -526,7 +526,7 @@ function gen_config_server(node)
|
||||
elseif node.protocol == "http" then
|
||||
settings = {
|
||||
allowTransparent = false,
|
||||
accounts = ("1" == node.auth) and {
|
||||
users = ("1" == node.auth) and {
|
||||
{
|
||||
user = node.username,
|
||||
pass = node.password
|
||||
@@ -544,20 +544,20 @@ function gen_config_server(node)
|
||||
}
|
||||
elseif node.protocol == "trojan" then
|
||||
if node.uuid then
|
||||
local clients = {}
|
||||
local users = {}
|
||||
for i = 1, #node.uuid do
|
||||
clients[i] = {
|
||||
users[i] = {
|
||||
password = node.uuid[i],
|
||||
}
|
||||
end
|
||||
settings = {
|
||||
clients = clients
|
||||
users = users
|
||||
}
|
||||
end
|
||||
elseif node.protocol == "hysteria2" then
|
||||
settings = {
|
||||
version = 2,
|
||||
clients = node.hysteria2_auth_password and {
|
||||
users = node.hysteria2_auth_password and {
|
||||
{ auth = node.hysteria2_auth_password }
|
||||
}
|
||||
}
|
||||
@@ -946,7 +946,7 @@ function gen_config(var)
|
||||
end
|
||||
if local_socks_username and local_socks_password and local_socks_username ~= "" and local_socks_password ~= "" then
|
||||
inbound.settings.auth = "password"
|
||||
inbound.settings.accounts = {
|
||||
inbound.settings.users = {
|
||||
{
|
||||
user = local_socks_username,
|
||||
pass = local_socks_password
|
||||
@@ -963,7 +963,7 @@ function gen_config(var)
|
||||
settings = {allowTransparent = false}
|
||||
}
|
||||
if local_http_username and local_http_password and local_http_username ~= "" and local_http_password ~= "" then
|
||||
inbound.settings.accounts = {
|
||||
inbound.settings.users = {
|
||||
{
|
||||
user = local_http_username,
|
||||
pass = local_http_password
|
||||
@@ -1422,7 +1422,8 @@ function gen_config(var)
|
||||
}
|
||||
domains = {}
|
||||
string.gsub(e.domain_list, '[^' .. "\r\n" .. ']+', function(w)
|
||||
if w:find("#") == 1 then return end
|
||||
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
|
||||
table.insert(domains, w)
|
||||
table.insert(domain_table.domain, w)
|
||||
@@ -1430,16 +1431,17 @@ function gen_config(var)
|
||||
if inner_fakedns == "1" and node[e[".name"] .. "_fakedns"] == "1" and #domains > 0 then
|
||||
domain_table.fakedns = true
|
||||
end
|
||||
if outbound_tag then
|
||||
if #domains == 0 then domains = nil end
|
||||
if outbound_tag and domains then
|
||||
table.insert(dns_domain_rules, api.clone(domain_table))
|
||||
end
|
||||
if #domains == 0 then domains = nil end
|
||||
end
|
||||
local ip = nil
|
||||
if e.ip_list then
|
||||
ip = {}
|
||||
string.gsub(e.ip_list, '[^' .. "\r\n" .. ']+', function(w)
|
||||
if w:find("#") == 1 then return end
|
||||
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
|
||||
table.insert(ip, w)
|
||||
end)
|
||||
@@ -2036,7 +2038,7 @@ function gen_proto_config(var)
|
||||
}
|
||||
if local_socks_username and local_socks_password and local_socks_username ~= "" and local_socks_password ~= "" then
|
||||
inbound.settings.auth = "password"
|
||||
inbound.settings.accounts = {
|
||||
inbound.settings.users = {
|
||||
{
|
||||
user = local_socks_username,
|
||||
pass = local_socks_password
|
||||
@@ -2056,7 +2058,7 @@ function gen_proto_config(var)
|
||||
}
|
||||
}
|
||||
if local_http_username and local_http_password and local_http_username ~= "" and local_http_password ~= "" then
|
||||
inbound.settings.accounts = {
|
||||
inbound.settings.users = {
|
||||
{
|
||||
user = local_http_username,
|
||||
pass = local_http_password
|
||||
|
||||
Reference in new issue
Block a user