From 367e0dc932ace7e83b05089331113673ef742ac9 Mon Sep 17 00:00:00 2001 From: "Ycarus (Yannick Chabanois)" Date: Fri, 4 Sep 2020 21:54:34 +0200 Subject: [PATCH] add v2ray encryption support from wizard --- .../luasrc/controller/openmptcprouter.lua | 22 ++++++++++--------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/luci-app-openmptcprouter/luasrc/controller/openmptcprouter.lua b/luci-app-openmptcprouter/luasrc/controller/openmptcprouter.lua index 9d5fb76ea..55ea6526d 100644 --- a/luci-app-openmptcprouter/luasrc/controller/openmptcprouter.lua +++ b/luci-app-openmptcprouter/luasrc/controller/openmptcprouter.lua @@ -486,29 +486,31 @@ function wizard_add() if encryption == "none" then ucic:set("shadowsocks-libev","sss0","method","none") ucic:set("openvpn","omr","cipher","none") - ucic:save("shadowsocks-libev") + ucic:set("v2ray","omrout","s_vmess_user_security","none") + ucic:set("v2ray","omrout","s_vless_user_security","none") elseif encryption == "aes-256-gcm" then ucic:set("shadowsocks-libev","sss0","method","aes-256-gcm") ucic:set("glorytun","vpn","chacha20","0") ucic:set("openvpn","omr","cipher","AES-256-GCM") - ucic:save("openvpn") - ucic:save("glorytun") - ucic:save("shadowsocks-libev") + ucic:set("v2ray","omrout","s_vmess_user_security","aes-128-gcm") + ucic:set("v2ray","omrout","s_vless_user_security","aes-128-gcm") elseif encryption == "aes-256-cfb" then ucic:set("shadowsocks-libev","sss0","method","aes-256-cfb") ucic:set("glorytun","vpn","chacha20","0") ucic:set("openvpn","omr","cipher","AES-256-CFB") - ucic:save("openvpn") - ucic:save("glorytun") - ucic:save("shadowsocks-libev") + ucic:set("v2ray","omrout","s_vmess_user_security","aes-128-gcm") + ucic:set("v2ray","omrout","s_vless_user_security","aes-128-gcm") elseif encryption == "chacha20-ietf-poly1305" then ucic:set("shadowsocks-libev","sss0","method","chacha20-ietf-poly1305") ucic:set("glorytun","vpn","chacha20","1") ucic:set("openvpn","omr","cipher","AES-256-CBC") - ucic:save("openvpn") - ucic:save("glorytun") - ucic:save("shadowsocks-libev") + ucic:set("v2ray","omrout","s_vmess_user_security","chacha20-poly1305") + ucic:set("v2ray","omrout","s_vless_user_security","chacha20-poly1305") end + ucic:save("openvpn") + ucic:save("glorytun") + ucic:save("shadowsocks-libev") + ucic:save("v2ray") -- Set ShadowSocks settings local shadowsocks_key = luci.http.formvalue("shadowsocks_key")