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,20 +0,0 @@
module("luci.controller.ipsec-server", package.seeall)
function index()
if not nixio.fs.access("/etc/config/ipsec") then
return
end
entry({"admin", "vpn", "ipsec-server"},alias("admin", "vpn", "ipsec-server", "basic"),_("IPSec VPN Server"), 10).dependent = false
entry({"admin", "vpn", "ipsec-server", "basic"},cbi("ipsec-server/ipsec-server"),_("Basic"), 10).leaf = true
entry({"admin", "vpn", "ipsec-server", "user"},form("ipsec-server/userlist"),_("User"), 20).leaf = true
entry({"admin", "vpn", "ipsec-server","status"},call("act_status")).leaf=true
end
function act_status()
local e={}
e.running=luci.sys.call("pgrep ipsec >/dev/null")==0
luci.http.prepare_content("application/json")
luci.http.write_json(e)
end

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

View file

@ -1,22 +0,0 @@
<script type="text/javascript">//<![CDATA[
XHR.poll(3, '<%=url([[admin]], [[vpn]], [[ipsec-server]], [[status]])%>', null,
function(x, data) {
var tb = document.getElementById('ipsec_status');
if (data && tb) {
if (data.running) {
var links = '<em><b><font color=green>IPSec VPN <%:RUNNING%></font></b></em>';
tb.innerHTML = links;
} else {
tb.innerHTML = '<em><b><font color=red>IPSec VPN <%:NOT RUNNING%></font></b></em>';
}
}
}
);
//]]>
</script>
<style>.mar-10 {margin-left: 50px; margin-right: 10px;}</style>
<fieldset class="cbi-section">
<p id="ipsec_status">
<em><%:Collecting data...%></em>
</p>
</fieldset>