diff --git a/luci-app-openmptcprouter/luasrc/controller/openmptcprouter.lua b/luci-app-openmptcprouter/luasrc/controller/openmptcprouter.lua index 6a860cfcc..e88d669f2 100644 --- a/luci-app-openmptcprouter/luasrc/controller/openmptcprouter.lua +++ b/luci-app-openmptcprouter/luasrc/controller/openmptcprouter.lua @@ -385,17 +385,28 @@ function wizard_add() ucic:save("nginx-ha") ucic:commit("nginx-ha") ucic:save("openvpn") - ucic:commit("openvpn") + --ucic:commit("openvpn") ucic:save("mlvpn") - ucic:commit("mlvpn") + --ucic:commit("mlvpn") ucic:save("dsvpn") - ucic:commit("dsvpn") + --ucic:commit("dsvpn") ucic:save("glorytun") - ucic:commit("glorytun") + --ucic:commit("glorytun") ucic:save("shadowsocks-libev") - ucic:commit("shadowsocks-libev") + --ucic:commit("shadowsocks-libev") + local encryption = luci.http.formvalue("encryption") + if encryption == "none" then + ucic:set("shadowsocks-libev","sss0","method","none") + elseif encryption == "aes-256-gcm" then + ucic:set("shadowsocks-libev","sss0","method","aes-256-gcm") + ucic:set("glorytun","vpn","chacha20","0") + elseif encryption == "chacha20" then + ucic:set("shadowsocks-libev","sss0","method","chacha20") + ucic:set("glorytun","vpn","chacha20","1") + end + -- Set ShadowSocks settings local shadowsocks_key = luci.http.formvalue("shadowsocks_key") local shadowsocks_disable = luci.http.formvalue("disableshadowsocks") or "0" @@ -429,7 +440,6 @@ function wizard_add() ucic:set("glorytun","vpn","port","65001") ucic:set("glorytun","vpn","key",glorytun_key) ucic:set("glorytun","vpn","mptcp",1) - ucic:set("glorytun","vpn","chacha20",1) if default_vpn == "glorytun_udp" then ucic:set("glorytun","vpn","proto","udp") ucic:set("glorytun","vpn","localip","10.255.254.2") diff --git a/luci-app-openmptcprouter/luasrc/view/openmptcprouter/wizard.htm b/luci-app-openmptcprouter/luasrc/view/openmptcprouter/wizard.htm index 95ada85d1..22cec0de6 100644 --- a/luci-app-openmptcprouter/luasrc/view/openmptcprouter/wizard.htm +++ b/luci-app-openmptcprouter/luasrc/view/openmptcprouter/wizard.htm @@ -5,6 +5,7 @@ local net = require "luci.model.network".init() local fs = require "nixio.fs" local sys = require "luci.sys" + local ut = require "luci.util" local ifaces = sys.net:devices() local servers_ip = {} local server_ip = uci:get("shadowsocks-libev","sss0","server") @@ -148,6 +149,30 @@ end checked<% end %> /> +
+ +
+ +
+
+ <% + if ut.trim(sys.exec("cat /proc/cpuinfo | grep aes")) ~= "" then + %> + <%:An Advanced Encryption Standard (AES) instruction set is integrated in the processor.%> + <% else %> + <%:There is no Advanced Encryption Standard (AES) instruction set integrated in the processor, you should use chacha20.%> + <% end %> +
+
+
<%:VPN settings%>