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

Remove ipsec server

This commit is contained in:
Ycarus (Yannick Chabanois) 2020-02-01 08:52:51 +01:00
parent 299ca28e4d
commit d085393ed1
12 changed files with 0 additions and 688 deletions

View file

@ -1,41 +0,0 @@
mp = Map("ipsec", translate("IPSec VPN Server"))
mp.description = translate("IPSec VPN connectivity using the native built-in VPN Client on iOS or Andriod (IKEv1 with PSK and Xauth)")
mp:section(SimpleSection).template = "ipsec/ipsec_status"
s = mp:section(NamedSection, "ipsec", "service")
s.anonymouse = true
enabled = s:option(Flag, "enabled", translate("Enable"))
enabled.default = 0
enabled.rmempty = false
clientip = s:option(Value, "clientip", translate("VPN Client IP"))
clientip.datatype = "ip4addr"
clientip.description = translate("LAN DHCP reserved started IP addresses with the same subnet mask")
clientip.optional = false
clientip.rmempty = false
clientdns = s:option(Value, "clientdns", translate("VPN Client DNS"))
clientdns.datatype = "ip4addr"
clientdns.description = translate("DNS using in VPN tunnel.Set to the router's LAN IP is recommended")
clientdns.optional = false
clientdns.rmempty = false
secret = s:option(Value, "secret", translate("Secret Pre-Shared Key"))
secret.password = true
local apply = luci.http.formvalue("cbi.apply")
if apply then
local bbrbox = luci.http.formvalue("cbid.ipsec.ipsec.enabled")
if bbrbox then
luci.sys.exec("ipsec reload")
luci.sys.exec("ipsec start")
else
luci.sys.exec("ipsec stop")
end
end
return mp

View file

@ -1,24 +0,0 @@
local fs = require "nixio.fs"
local conffile = "/etc/config/ipsec.users"
f = SimpleForm("custom", translate("IPSec VPN User List"), translate("Please refer to the following writing.account:password"))
t = f:field(TextValue, "conf")
t.rmempty = true
t.rows = 13
function t.cfgvalue()
return fs.readfile(conffile) or ""
end
function f.handle(self, state, data)
if state == FORM_VALID then
if data.conf then
fs.writefile(conffile, data.conf:gsub("\r\n", "\n"))
luci.sys.call("/etc/init.d/ipsec reload")
luci.sys.call("/etc/init.d/ipsec restart")
end
end
return true
end
return f