1
0
Fork 0
mirror of https://github.com/Ysurac/openmptcprouter-feeds.git synced 2025-03-09 15:40:03 +00:00

Merge pull request #346 from Ysurac/develop

sync
This commit is contained in:
suyuan 2023-08-26 18:13:57 +08:00 committed by GitHub
commit 896c29c4be
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
15 changed files with 392 additions and 59 deletions

View file

@ -675,9 +675,18 @@ function wizard_add()
ucic:set("shadowsocks-libev",sectionname,"disabled","0")
end
end)
elseif default_proxy == "v2ray" and serversnb > 0 and serversnb > disablednb then
elseif (default_proxy == "v2ray" or default_proxy == "v2ray-vmess" or default_proxy == "v2ray-trojan" or default_proxy == "v2ray-socks") and serversnb > 0 and serversnb > disablednb then
--ucic:set("shadowsocks-libev","sss0","disabled","1")
ucic:set("v2ray","main","enabled","1")
if default_proxy == "v2ray" then
ucic:set("v2ray","omrout","protocol","vless")
elseif default_proxy == "v2ray-vmess" then
ucic:set("v2ray","omrout","protocol","vmess")
elseif default_proxy == "v2ray-trojan" then
ucic:set("v2ray","omrout","protocol","trojan")
elseif default_proxy == "v2ray-socks" then
ucic:set("v2ray","omrout","protocol","socks")
end
ucic:foreach("shadowsocks-libev", "server", function(s)
local sectionname = s[".name"]
ucic:set("shadowsocks-libev",sectionname,"disabled","1")
@ -733,6 +742,8 @@ function wizard_add()
ucic:set("ubond","general","host",server_ip)
ucic:set("v2ray","omrout","s_vmess_address",server_ip)
ucic:set("v2ray","omrout","s_vless_address",server_ip)
ucic:set("v2ray","omrout","s_trojan_address",server_ip)
ucic:set("v2ray","omrout","s_socks_address",server_ip)
luci.sys.call("uci -q del openvpn.omr.remote")
luci.sys.call("uci -q add_list openvpn.omr.remote=" .. server_ip)
ucic:set("qos","serverin","srchost",server_ip)
@ -771,6 +782,8 @@ function wizard_add()
ucic:set("ubond","general","host",server_ip)
ucic:set("v2ray","omrout","s_vmess_address",server_ip)
ucic:set("v2ray","omrout","s_vless_address",server_ip)
ucic:set("v2ray","omrout","s_trojan_address",server_ip)
ucic:set("v2ray","omrout","s_socks_address",server_ip)
luci.sys.call("uci -q del openvpn.omr.remote")
luci.sys.call("uci -q add_list openvpn.omr.remote=" .. server_ip)
ucic:set("qos","serverin","srchost",server_ip)
@ -822,6 +835,8 @@ function wizard_add()
ucic:set("mlvpn","general","cleartext_data","1")
ucic:set("v2ray","omrout","s_vmess_user_security","none")
ucic:set("v2ray","omrout","s_vless_user_security","none")
ucic:set("v2ray","omrout","s_trojan_user_security","none")
ucic:set("v2ray","omrout","s_socks_user_security","none")
elseif encryption == "aes-256-gcm" then
ucic:set("openmptcprouter","settings","encryption","aes-256-gcm")
ucic:set("shadowsocks-libev","sss0","method","aes-256-gcm")
@ -832,6 +847,8 @@ function wizard_add()
ucic:set("mlvpn","general","cleartext_data","0")
ucic:set("v2ray","omrout","s_vmess_user_security","aes-128-gcm")
ucic:set("v2ray","omrout","s_vless_user_security","aes-128-gcm")
ucic:set("v2ray","omrout","s_trojan_user_security","aes-128-gcm")
ucic:set("v2ray","omrout","s_socks_user_security","aes-128-gcm")
elseif encryption == "aes-256-cfb" then
ucic:set("openmptcprouter","settings","encryption","aes-256-cfb")
ucic:set("shadowsocks-libev","sss0","method","aes-256-cfb")
@ -842,6 +859,8 @@ function wizard_add()
ucic:set("mlvpn","general","cleartext_data","0")
ucic:set("v2ray","omrout","s_vmess_user_security","aes-128-gcm")
ucic:set("v2ray","omrout","s_vless_user_security","aes-128-gcm")
ucic:set("v2ray","omrout","s_trojan_user_security","aes-128-gcm")
ucic:set("v2ray","omrout","s_socks_user_security","aes-128-gcm")
elseif encryption == "chacha20-ietf-poly1305" then
ucic:set("openmptcprouter","settings","encryption","chacha20")
ucic:set("shadowsocks-libev","sss0","method","chacha20-ietf-poly1305")
@ -852,6 +871,8 @@ function wizard_add()
ucic:set("mlvpn","general","cleartext_data","0")
ucic:set("v2ray","omrout","s_vmess_user_security","chacha20-poly1305")
ucic:set("v2ray","omrout","s_vless_user_security","chacha20-poly1305")
ucic:set("v2ray","omrout","s_trojan_user_security","chacha20-poly1305")
ucic:set("v2ray","omrout","s_socks_user_security","chacha20-poly1305")
else
ucic:set("openmptcprouter","settings","encryption","other")
end
@ -892,6 +913,8 @@ function wizard_add()
local v2ray_user = luci.http.formvalue("v2ray_user")
ucic:set("v2ray","omrout","s_vmess_user_id",v2ray_user)
ucic:set("v2ray","omrout","s_vless_user_id",v2ray_user)
ucic:set("v2ray","omrout","s_trojan_user_id",v2ray_user)
ucic:set("v2ray","omrout","s_socks_user_id",v2ray_user)
ucic:save("v2ray")
ucic:commit("v2ray")