1
0
Fork 0
mirror of https://github.com/Ysurac/openmptcprouter-feeds.git synced 2025-02-12 10:31:51 +00:00

New interface for mlvpn VPN

This commit is contained in:
Ycarus (Yannick Chabanois) 2020-12-03 11:22:39 +01:00
parent 2df8bdf052
commit 4a825c5650
11 changed files with 88 additions and 388 deletions

View file

@ -1,12 +1,12 @@
#
# Copyright (C) 2018-2019 Ycarus (Yannick Chabanois) <ycarus@zugaina.org>
# Copyright (C) 2018-2020 Ycarus (Yannick Chabanois) <ycarus@zugaina.org>
#
#
include $(TOPDIR)/rules.mk
LUCI_TITLE:=LuCI Support for MLVPN
LUCI_DEPENDS:=+mlvpn
LUCI_TITLE:=LuCI Interface to Glorytun TCP
LUCI_DEPENDS:=+glorytun
PKG_LICENSE:=GPLv3

View file

@ -0,0 +1,83 @@
'use strict';
'require rpc';
'require form';
'require fs';
'require uci';
'require tools.widgets as widgets';
var callHostHints;
return L.view.extend({
callHostHints: rpc.declare({
object: 'luci-rpc',
method: 'getHostHints',
expect: { '': {} }
}),
load: function() {
return this.callHostHints();
},
render: function(hosts) {
var m, s, o;
m = new form.Map('mlvpn', _('MLVPN'));
s = m.section(form.GridSection, 'mlvpn', _('Instances'));
s.addremove = true;
s.anonymous = true;
s.nodescriptions = true;
s.tab('general', _('General Settings'));
s.tab('advanced', _('Advanced Settings'));
o = s.taboption('general', form.Flag, 'enable', _('Enabled'));
o.default = o.enabled;
o = s.taboption('general', form.ListValue, 'mode', _('Mode'));
o.value('client',_('Client'));
o.value('server',_('Server'));
o.modalonly = true;
o = s.taboption('general', form.Value, 'host', _('Host'));
o.rmempty = false;
o = s.taboption('general', form.Value, 'firstport', _('First Port'));
o.default = "65201"
o.datatype = "port"
o.rmempty = false;
o = s.taboption('general', form.Value, 'password', _('Password'));
o.rmempty = false;
o.modalonly = true;
o = s.taboption('general', form.Value, 'interface_name', _('Interface name'));
o.default = "mlvpn0"
o.placeholder = "mlvpn0"
o.rmempty = false;
o.modalonly = true;
o = s.taboption('advanced', form.Value, 'timeout', _('Timeout (s)'));
o.default = '30';
o.datatype = "uinteger"
o.rmempty = false;
o.modalonly = true;
o = s.taboption('advanced', form.Value, 'reorder_buffer_size', _('Reorder buffer size'));
o.default = '128';
o.datatype = "uinteger"
o.rmempty = false;
o.modalonly = true;
o = s.taboption('advanced', form.Value, 'loss_tolerance', _('Loss tolerance'));
o.default = '50';
o.datatype = "uinteger"
o.rmempty = false;
o.modalonly = true;
o = s.taboption('general',form.Value, 'label', _('Label'));
o.rmempty = true;
return m.render();
}
});

View file

@ -1,7 +0,0 @@
module("luci.controller.mlvpn", package.seeall)
function index()
--entry({"admin", "openmptcprouter", "mlvpn"}, cbi("mlvpn"), _("MLVPN"))
--entry({"admin", "services", "mlvpn"}, cbi("mlvpn"), _("MLVPN"))
entry({"admin", "vpn", "mlvpn"}, cbi("mlvpn"), _("MLVPN"))
end

View file

@ -1,77 +0,0 @@
local net = require "luci.model.network".init()
local sys = require "luci.sys"
local ifaces = sys.net:devices()
local m, s, o
m = Map("mlvpn", translate("MLVPN"))
s = m:section(TypedSection, "mlvpn", translate("Settings"))
s.anonymous = true
s.addremove = false
o = s:option(Flag, "enable", translate("Enable"))
o.rmempty = false
o = s:option(Value, "timeout", translate("Timeout (s)"))
o.placeholder = "30"
o.default = "30"
o.datatype = "uinteger"
o.rmempty = false
o = s:option(Value, "reorder_buffer_size", translate("Reorder buffer size"))
o.placeholder = "64"
o.default = "64"
o.datatype = "uinteger"
o.rmempty = false
o = s:option(Value, "loss_tolerance", translate("Loss tolerance"))
o.placeholder = "50"
o.default = "50"
o.datatype = "uinteger"
o.rmempty = false
o = s:option(Value, "host", translate("Remote host"))
o.placeholder = "128.128.128.128"
o.default = "128.128.128.128"
o.datatype = "host"
o.rmempty = false
o = s:option(Value, "firstport", translate("First remote port"),translate("Interface will increase port used beginning with this"))
o.default = "65201"
o.datatype = "port"
o.rmempty = false
o = s:option(Value, "password", translate("Password"))
o.password = true
o.rmempty = false
o = s:option(Value, "interface_name", translate("Interface name"))
o.placeholder = "mlvpn0"
o.default = "mlvpn0"
o.rmempty = false
--o = s:option(Value, "mode", translate("Mode"))
--o:value("client")
--o:value("server")
--o.default = "client"
--o.rmempty = false
--s = m:section(TypedSection, "interface", translate("Interfaces"))
--s.template_addremove = "mlvpn/cbi-select-add"
--s.addremove = true
--s.add_select_options = { }
--s.add_select_options[''] = ''
--for _, iface in ipairs(ifaces) do
-- if not (iface == "lo" or iface:match("^ifb.*")) then
-- s.add_select_options[iface] = iface
-- end
--end
--o = s:option(Value, "port", translate("Remote/Bind port"))
--o.placeholder = "65201"
--o.default = "65201"
--o.datatype = "port"
return m

View file

@ -1,10 +0,0 @@
<div class="cbi-section-create">
<% if self.invalid_cts then -%><div class="cbi-section-error"><% end %>
<select class="cbi-section-create-name" name="cbi.cts.<%=self.config%>.<%=self.sectiontype%>.select">
<%- for k, v in luci.util.kspairs(self.add_select_options) do %>
<option value="<%=k%>"><%=luci.xml.pcdata(v)%></option>
<% end -%>
</select>
<input class="cbi-button cbi-button-add" type="submit" value="<%:Add%>" title="<%:Add%>" />
<% if self.invalid_cts then %><br /><%:Invalid%></div><% end %>
</div>

View file

@ -1,59 +0,0 @@
msgid ""
msgstr ""
"PO-Revision-Date: 2020-10-05 12:39+0000\n"
"Last-Translator: Weblate Admin <contact@openmptcprouter.com>\n"
"Language-Team: German <http://weblate.openmptcprouter.com/projects/omr/"
"luciapplicationsmlvpn/de/>\n"
"Language: de\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
"X-Generator: Weblate 4.0.4\n"
msgid "Add"
msgstr "Hinzufügen"
msgid "Enable"
msgstr "Aktivieren"
msgid "First remote port"
msgstr "Erster Gegenstellen-Port"
msgid "Interface name"
msgstr "Name der Verbindung"
msgid "Interface will increase port used beginning with this"
msgstr "Der Anschluss wird die Pornummern nutzen beginnend mit diesem Wert"
msgid "Interfaces"
msgstr "Anschlüsse"
msgid "Invalid"
msgstr "Ungültig"
msgid "Loss tolerance"
msgstr "Verlust-Toleranz"
msgid "MLVPN"
msgstr "MLVPN"
msgid "Mode"
msgstr "Betriebsmodus"
msgid "Password"
msgstr "Schlüssel"
msgid "Remote host"
msgstr "Gegenstelle (FQDN oder IP-Adresse)"
msgid "Remote/Bind port"
msgstr "Portnummer der Gegenstelle"
msgid "Reorder buffer size"
msgstr "Größe des Sortierpuffers"
msgid "Settings"
msgstr "Einstellungen"
msgid "Timeout (s)"
msgstr "Wartezeit (in Sekunden)"

View file

@ -1,62 +0,0 @@
msgid ""
msgstr ""
"Project-Id-Version: \n"
"POT-Creation-Date: \n"
"PO-Revision-Date: 2020-10-07 10:57+0000\n"
"Last-Translator: Weblate Admin <contact@openmptcprouter.com>\n"
"Language-Team: French <http://weblate.openmptcprouter.com/projects/omr/"
"luciapplicationsmlvpn/fr/>\n"
"Language: fr\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=n > 1;\n"
"X-Generator: Weblate 4.0.4\n"
msgid "Add"
msgstr "Ajouter"
msgid "Enable"
msgstr "Activer"
msgid "First remote port"
msgstr "Premier port distant"
msgid "Interface name"
msgstr "Nom de l'interface"
msgid "Interface will increase port used beginning with this"
msgstr "L'interface augmentera le port utilisé à partir de celui ci"
msgid "Interfaces"
msgstr "Interfaces"
msgid "Invalid"
msgstr "Invalide"
msgid "Loss tolerance"
msgstr "Tolérance aux pertes"
msgid "MLVPN"
msgstr "MLVPN"
msgid "Mode"
msgstr "Mode"
msgid "Password"
msgstr "Mot de passe"
msgid "Remote host"
msgstr "Nom de l'hôte distant ou adresse IP"
msgid "Remote/Bind port"
msgstr "Port de connexion distant"
msgid "Reorder buffer size"
msgstr "Taille du tampon de réordonnancement"
msgid "Settings"
msgstr "Paramètres"
msgid "Timeout (s)"
msgstr "Délais d'attente (s)"

View file

@ -1,59 +0,0 @@
msgid ""
msgstr ""
"PO-Revision-Date: 2020-09-21 12:51+0000\n"
"Last-Translator: Weblate Admin <contact@openmptcprouter.com>\n"
"Language-Team: Italian <http://weblate.openmptcprouter.com/projects/omr/"
"luciapplicationsmlvpn/it/>\n"
"Language: it\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
"X-Generator: Weblate 4.0.4\n"
msgid "Add"
msgstr "Aggiungi"
msgid "Enable"
msgstr "Attivare"
msgid "First remote port"
msgstr "Prima porta remota"
msgid "Interface name"
msgstr "Nome interfaccia"
msgid "Interface will increase port used beginning with this"
msgstr "L&#39;interfaccia aumenterà la porta utilizzata a partire da questa"
msgid "Interfaces"
msgstr "Interfaccia"
msgid "Invalid"
msgstr "Non valido"
msgid "Loss tolerance"
msgstr "Tolleranza alla perdita"
msgid "MLVPN"
msgstr "MLVPN"
msgid "Mode"
msgstr "Modo"
msgid "Password"
msgstr "Password"
msgid "Remote host"
msgstr "Rimuovi server"
msgid "Remote/Bind port"
msgstr "Porta remota / Bind"
msgid "Reorder buffer size"
msgstr ""
msgid "Settings"
msgstr "Impostazioni"
msgid "Timeout (s)"
msgstr ""

View file

@ -1,50 +0,0 @@
msgid ""
msgstr "Content-Type: text/plain; charset=UTF-8"
msgid "Add"
msgstr ""
msgid "Enable"
msgstr ""
msgid "First remote port"
msgstr ""
msgid "Interface name"
msgstr ""
msgid "Interface will increase port used beginning with this"
msgstr ""
msgid "Interfaces"
msgstr ""
msgid "Invalid"
msgstr ""
msgid "Loss tolerance"
msgstr ""
msgid "MLVPN"
msgstr ""
msgid "Mode"
msgstr ""
msgid "Password"
msgstr ""
msgid "Remote host"
msgstr ""
msgid "Remote/Bind port"
msgstr ""
msgid "Reorder buffer size"
msgstr ""
msgid "Settings"
msgstr ""
msgid "Timeout (s)"
msgstr ""

View file

@ -1,59 +0,0 @@
msgid ""
msgstr ""
"PO-Revision-Date: 2020-06-11 16:36+0000\n"
"Last-Translator: antrouter <xinyangla@188.com>\n"
"Language-Team: Chinese (Simplified) <http://weblate.openmptcprouter.com/"
"projects/omr/luciapplicationsmlvpn/zh_Hans/>\n"
"Language: zh_Hans\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=1; plural=0;\n"
"X-Generator: Weblate 4.0.4\n"
msgid "Add"
msgstr "添加"
msgid "Enable"
msgstr "开启"
msgid "First remote port"
msgstr "第一个远程端口"
msgid "Interface name"
msgstr "网卡名称"
msgid "Interface will increase port used beginning with this"
msgstr "接口将从此开始增加使用的端口"
msgid "Interfaces"
msgstr "网卡"
msgid "Invalid"
msgstr "无效"
msgid "Loss tolerance"
msgstr "损失容忍"
msgid "MLVPN"
msgstr "MLVPN设置"
msgid "Mode"
msgstr "模式"
msgid "Password"
msgstr "密码"
msgid "Remote host"
msgstr "远程主机"
msgid "Remote/Bind port"
msgstr "远程/绑定端口"
msgid "Reorder buffer size"
msgstr "重新排序缓冲区大小"
msgid "Settings"
msgstr "设置"
msgid "Timeout (s)"
msgstr "超时 (秒)"

View file

@ -3,8 +3,8 @@
"title": "MLVPN",
"order": 30,
"action": {
"type": "cbi",
"path": "mlvpn"
"type": "view",
"path": "services/mlvpn"
},
"depends": {
"acl": [ "luci-app-mlvpn" ]