luci-app-eoip: Add LuCI for EoIP
authorBogdan Shatik <bogdikxxx@mail.ru>
Tue, 26 Jan 2021 13:12:14 +0000 (16:12 +0300)
committerHannu Nyman <hannu.nyman@iki.fi>
Mon, 1 Feb 2021 16:01:59 +0000 (18:01 +0200)
LuCI Support for EoIP tunnel

Signed-off-by: Bogdan Shatik <bogdikxxx@mail.ru>
applications/luci-app-eoip/Makefile [new file with mode: 0644]
applications/luci-app-eoip/htdocs/luci-static/resources/view/eoip/eoip.js [new file with mode: 0644]
applications/luci-app-eoip/po/en/eoip.po [new file with mode: 0644]
applications/luci-app-eoip/po/ru/eoip.po [new file with mode: 0644]
applications/luci-app-eoip/po/templates/eoip.pot [new file with mode: 0644]
applications/luci-app-eoip/root/usr/share/luci/menu.d/luci-app-eoip.json [new file with mode: 0644]
applications/luci-app-eoip/root/usr/share/rpcd/acl.d/luci-app-eoip.json [new file with mode: 0644]

diff --git a/applications/luci-app-eoip/Makefile b/applications/luci-app-eoip/Makefile
new file mode 100644 (file)
index 0000000..f28b00e
--- /dev/null
@@ -0,0 +1,16 @@
+# Copyright 2020 Bogdan Shatik (bogdikxxx@mail.ru)
+# This is free software, licensed under the Apache License, Version 2.0
+
+include $(TOPDIR)/rules.mk
+
+PKG_MAINTAINER:=Bogdan Shatik <bogdikxxx@mail.ru>
+PKG_NAME:=luci-app-eoip
+PKG_LICENSE:=Apache-2.0
+
+LUCI_TITLE:=LuCI Support for EoIP
+LUCI_DEPENDS:=+eoip +luci-base
+LUCI_PKGARCH:=all
+
+include ../../luci.mk
+
+# call BuildPackage - OpenWrt buildroot signature
diff --git a/applications/luci-app-eoip/htdocs/luci-static/resources/view/eoip/eoip.js b/applications/luci-app-eoip/htdocs/luci-static/resources/view/eoip/eoip.js
new file mode 100644 (file)
index 0000000..9419d61
--- /dev/null
@@ -0,0 +1,50 @@
+'use strict';
+'require form';
+'require view';
+'require uci';
+
+return view.extend({
+       render: function() {
+               var m, s, n, id, d, o, v;
+               
+               m = new form.Map("eoip", _("EoIP - Tunneling"), _("Here you can configure EoIP tunnel. At current moment it is easiest way to create stateless tunnel with Mikrotik."));
+
+               s = m.section(form.TypedSection, "eoip", _("Settings"));
+               s.addremove = true;
+               s.anonymous = true;
+               
+               o = s.option(form.Flag, "enabled", _("Enable tunnel"));
+
+               n = s.option(form.Value, "name", _("Name interface [zeoip"), _("If you input 0 interface name zeoip0"));
+               n.rmempty = false;
+               n.datatype = "uinteger";
+               n.default = 0;
+               n.validate = function(section_id, value) {
+                        var sections = uci.sections('eoip');
+                        for (var i = 0; i < sections.length; i++) {
+                                if (uci.get('eoip', sections[i]['.name'], 'name') == value && section_id != sections[i]['.name'])
+                                {return _('Name interface already in used');}
+
+                        }
+                return true;
+                };
+
+               
+               id = s.option(form.Value, "idtun", _("ID tunnel"), _("Indeficator id tunnel"));
+               id.rmempty = false;
+               id.datatype = "and(min(1), integer)";
+               id.default = 1;
+               
+               d = s.option(form.Value, "dst", _("Destination"), _("Destination IP address for connection EoIP."));
+               d.rmempty = false;
+               d.datatype = "ipaddr";
+               d.placeholder = "0.0.0.0";
+               
+               o = s.option(form.Flag, "dynamic", _("Dynamic"), _("If you use dynamic option, take attention that there is no authorization, and it is not secure. It is not good idea to use this feature with public ip or insecure(not completely under your control, each host) network."));
+               
+               v = s.option(form.DynamicList,"vlan", _("VLAN"), _("VLAN TAG on this interface"));
+               v.datatype = "range(1,4094)";
+
+               return m.render();
+       }
+});
diff --git a/applications/luci-app-eoip/po/en/eoip.po b/applications/luci-app-eoip/po/en/eoip.po
new file mode 100644 (file)
index 0000000..e745b40
--- /dev/null
@@ -0,0 +1,60 @@
+msgid ""
+msgstr ""
+"Content-Type: text/plain; charset=UTF-8\n"
+"Project-Id-Version: LuCI: eoip\n"
+"MIME-Version: 1.0\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Last-Translator: Bogdan Shatik <bogdikxxx@mail.ru>\n"
+"Language: en\n"
+
+msgid ""
+msgstr "Content-Type: text/plain; charset=UTF-8"
+
+#: applications/luci-app-eoip/htdocs/luci-static/resources/view/eoip/eoip.js:17
+msgid "Name interface [zeoip"
+msgstr ""
+
+#: applications/luci-app-eoip/htdocs/luci-static/resources/view/eoip/eoip.js:32
+msgid "ID tunnel"
+msgstr ""
+
+#: applications/luci-app-eoip/htdocs/luci-static/resources/view/eoip/eoip.js:32
+msgid "Indeficator id tunnel"
+msgstr ""
+
+#: applications/luci-app-eoip/htdocs/luci-static/resources/view/eoip/eoip.js:9
+msgid "Here you can configure EoIP tunnel. At current moment it is easiest way to create stateless tunnel with Mikrotik."
+msgstr ""
+
+#: applications/luci-app-eoip/htdocs/luci-static/resources/view/eoip/eoip.js:17
+msgid "If you input 0 interface name zeoip0"
+msgstr ""
+
+#: applications/luci-app-eoip/htdocs/luci-static/resources/view/eoip/eoip.js:15
+msgid "Enable tunnel"
+msgstr ""
+
+#: applications/luci-app-eoip/htdocs/luci-static/resources/view/eoip/eoip.js:9
+msgid "EoIP - Tunneling"
+msgstr ""
+
+#: applications/luci-app-eoip/htdocs/luci-static/resources/view/eoip/eoip.js:25
+msgid "Name interface already in used"
+msgstr ""
+
+#: applications/luci-app-eoip/htdocs/luci-static/resources/view/eoip/eoip.js:37
+msgid "Destination IP address for connection EoIP."
+msgstr ""
+
+#: applications/luci-app-eoip/htdocs/luci-static/resources/view/eoip/eoip.js:42
+msgid "Dynamic"
+msgstr ""
+
+#: applications/luci-app-eoip/htdocs/luci-static/resources/view/eoip/eoip.js:42
+msgid "If you use dynamic option, take attention that there is no authorization, and it is not secure. It is not good idea to use this feature with public ip or insecure(not completely under your control, each host) network."
+msgstr ""
+
+#: applications/luci-app-eoip/htdocs/luci-static/resources/view/eoip/eoip.js:44
+msgid "VLAN TAG on this interface"
+msgstr ""
+
diff --git a/applications/luci-app-eoip/po/ru/eoip.po b/applications/luci-app-eoip/po/ru/eoip.po
new file mode 100644 (file)
index 0000000..8a84075
--- /dev/null
@@ -0,0 +1,56 @@
+msgid ""
+msgstr ""
+"Content-Type: text/plain; charset=UTF-8\n"
+"Project-Id-Version: LuCI: eoip\n"
+"MIME-Version: 1.0\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Last-Translator: Bogdan Shatik <bogdikxxx@mail.ru>\n"
+"Language: ru\n"
+
+#: applications/luci-app-eoip/htdocs/luci-static/resources/view/eoip/eoip.js:17
+msgid "Name interface [zeoip"
+msgstr "Имя интерфейса [zeoip"
+
+#: applications/luci-app-eoip/htdocs/luci-static/resources/view/eoip/eoip.js:32
+msgid "ID tunnel"
+msgstr "ID туннеля"
+
+#: applications/luci-app-eoip/htdocs/luci-static/resources/view/eoip/eoip.js:32
+msgid "Indeficator id tunnel"
+msgstr "Индефикатор id тунеля"
+
+#: applications/luci-app-eoip/htdocs/luci-static/resources/view/eoip/eoip.js:9
+msgid "Here you can configure EoIP tunnel. At current moment it is easiest way to create stateless tunnel with Mikrotik."
+msgstr "Здесь вы можете создавать туннели Ethernet, совместимые с туннеленгом Mikrotik EoIP. В настоящий момент это самый простой способ создать туннель на базе протокола от Mikrotik."
+
+#: applications/luci-app-eoip/htdocs/luci-static/resources/view/eoip/eoip.js:17
+msgid "If you input 0 interface name zeoip0"
+msgstr "Если вы введёте 0 то имя интерфейса будет zeoip0"
+
+#: applications/luci-app-eoip/htdocs/luci-static/resources/view/eoip/eoip.js:15
+msgid "Enable tunnel"
+msgstr "Разрешить тунель"
+
+#: applications/luci-app-eoip/htdocs/luci-static/resources/view/eoip/eoip.js:9
+msgid "EoIP - Tunneling"
+msgstr "EoIP - Туннелинг"
+
+#: applications/luci-app-eoip/htdocs/luci-static/resources/view/eoip/eoip.js:25
+msgid "Name interface already in used"
+msgstr "Имя интерфейса уже используется"
+
+#: applications/luci-app-eoip/htdocs/luci-static/resources/view/eoip/eoip.js:37
+msgid "Destination IP address for connection EoIP."
+msgstr "IP адрес удалённого хоста для соединения с EoIP"
+
+#: applications/luci-app-eoip/htdocs/luci-static/resources/view/eoip/eoip.js:42
+msgid "Dynamic"
+msgstr "Динамический"
+
+#: applications/luci-app-eoip/htdocs/luci-static/resources/view/eoip/eoip.js:42
+msgid "If you use dynamic option, take attention that there is no authorization, and it is not secure. It is not good idea to use this feature with public ip or insecure(not completely under your control, each host) network."
+msgstr "Если вы используете динамический вариант, обратите внимание, что авторизации нет, и это небезопасно. Не рекомендуется использовать эту функцию с общедоступным IP или небезопасной (не полностью контролируемой вами, каждым хостом) сетью."
+
+#: applications/luci-app-eoip/htdocs/luci-static/resources/view/eoip/eoip.js:44
+msgid "VLAN TAG on this interface"
+msgstr "VLAN TAG на этом интерфейсе"
diff --git a/applications/luci-app-eoip/po/templates/eoip.pot b/applications/luci-app-eoip/po/templates/eoip.pot
new file mode 100644 (file)
index 0000000..fa6a686
--- /dev/null
@@ -0,0 +1,51 @@
+msgid ""
+msgstr "Content-Type: text/plain; charset=UTF-8"
+
+#: applications/luci-app-eoip/htdocs/luci-static/resources/view/eoip/eoip.js:17
+msgid "Name interface [zeoip"
+msgstr ""
+
+#: applications/luci-app-eoip/htdocs/luci-static/resources/view/eoip/eoip.js:32
+msgid "ID tunnel"
+msgstr ""
+
+#: applications/luci-app-eoip/htdocs/luci-static/resources/view/eoip/eoip.js:32
+msgid "Indeficator id tunnel"
+msgstr ""
+
+#: applications/luci-app-eoip/htdocs/luci-static/resources/view/eoip/eoip.js:9
+msgid "Here you can configure EoIP tunnel. At current moment it is easiest way to create stateless tunnel with Mikrotik."
+msgstr ""
+
+#: applications/luci-app-eoip/htdocs/luci-static/resources/view/eoip/eoip.js:17
+msgid "If you input 0 interface name zeoip0"
+msgstr ""
+
+#: applications/luci-app-eoip/htdocs/luci-static/resources/view/eoip/eoip.js:15
+msgid "Enable tunnel"
+msgstr ""
+
+#: applications/luci-app-eoip/htdocs/luci-static/resources/view/eoip/eoip.js:9
+msgid "EoIP - Tunneling"
+msgstr ""
+
+#: applications/luci-app-eoip/htdocs/luci-static/resources/view/eoip/eoip.js:25
+msgid "Name interface already in used"
+msgstr ""
+
+#: applications/luci-app-eoip/htdocs/luci-static/resources/view/eoip/eoip.js:37
+msgid "Destination IP address for connection EoIP."
+msgstr ""
+
+#: applications/luci-app-eoip/htdocs/luci-static/resources/view/eoip/eoip.js:42
+msgid "Dynamic"
+msgstr ""
+
+#: applications/luci-app-eoip/htdocs/luci-static/resources/view/eoip/eoip.js:42
+msgid "If you use dynamic option, take attention that there is no authorization, and it is not secure. It is not good idea to use this feature with public ip or insecure(not completely under your control, each host) network."
+msgstr ""
+
+#: applications/luci-app-eoip/htdocs/luci-static/resources/view/eoip/eoip.js:44
+msgid "VLAN TAG on this interface"
+msgstr ""
+
diff --git a/applications/luci-app-eoip/root/usr/share/luci/menu.d/luci-app-eoip.json b/applications/luci-app-eoip/root/usr/share/luci/menu.d/luci-app-eoip.json
new file mode 100644 (file)
index 0000000..be121c5
--- /dev/null
@@ -0,0 +1,13 @@
+{
+        "admin/network/eoip": {
+                "title": "EoIP tunnel",
+                "action": {
+                        "type": "view",
+                        "path": "eoip/eoip"
+                },
+                "depends": {
+                        "acl": [ "luci-app-eoip" ],
+                        "uci": { "eoip": true }
+                }
+        }
+}
diff --git a/applications/luci-app-eoip/root/usr/share/rpcd/acl.d/luci-app-eoip.json b/applications/luci-app-eoip/root/usr/share/rpcd/acl.d/luci-app-eoip.json
new file mode 100644 (file)
index 0000000..e8ddb55
--- /dev/null
@@ -0,0 +1,11 @@
+{
+       "luci-app-eoip": {
+               "description": "Grant UCI access for luci-app-eoip",
+               "read": {
+                       "uci": [ "eoip" ]
+               },
+               "write": {
+                       "uci": [ "eoip" ]
+               }
+       }
+}