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

Merge branch 'develop' into master

This commit is contained in:
Ycarus (Yannick Chabanois) 2020-12-17 09:37:18 +01:00
commit bc703d9f2f
133 changed files with 2598 additions and 2014 deletions

9
contributors/cr3ative.md Normal file
View file

@ -0,0 +1,9 @@
2020-11-10
I hereby agree to the terms of the "OpenMPTCProuter Individual Contributor License Agreement", with MD5 checksum bc827a07eb93611d793ddb7c75083c00.
I furthermore declare that I am authorized and able to make this agreement and sign this declaration.
Signed,
Paul Curry https://github.com/cr3ative

View file

@ -24,7 +24,9 @@ validate_section() {
'port:port' \
'dev:string' \
'localip:host' \
'remoteip:host'
'remoteip:host' \
'mode:string:client' \
'externalip:string:auto'
}
start_instance() {
@ -39,7 +41,8 @@ start_instance() {
[ -n "${key}" ] || return 1
[ "${key}" != "secretkey" ] || return 1
[ -n "${port}" ] || return 1
[ -z "${host}" ] && host="auto"
[ -z "${port}" ] && port="auto"
[ -n "${dev}" ] || return 1
echo "${key}" > /tmp/${PROG_NAME}-${1}.key
@ -57,14 +60,15 @@ start_instance() {
procd_open_instance
procd_set_param command ${PROG} client \
procd_set_param command ${PROG} ${mode} \
/tmp/${PROG_NAME}-${1}.key \
$host \
$port \
$dev \
${localip:+$localip} \
${remoteip:+$remoteip} \
$(ip r get $host | awk '{print $3}' | tr -d "\n")
${remoteip:+$remoteip}
[ "$mode" = "client" ] && procd_append_param command $(ip r get $host | awk '{print $3}' | tr -d "\n")
[ "$mode" = "server" ] && procd_append_param command externalip
procd_set_param respawn 0 30 5

View file

@ -10,7 +10,7 @@ include $(TOPDIR)/rules.mk
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://github.com/angt/glorytun.git
PKG_SOURCE_VERSION:=97607fdf5c6c33df512ed85190a1fd93b5f45e77
PKG_SOURCE_VERSION:=32267e86a6da05b285bb3bf2b136c105dc0af4bb
PKG_NAME:=glorytun-udp
PKG_VERSION:=0.3.4-$(PKG_SOURCE_VERSION)
PKG_RELEASE:=23

View file

@ -1,7 +1,7 @@
#!/bin/sh /etc/rc.common
# vim: set noexpandtab tabstop=4 shiftwidth=4 softtabstop=4 :
# Copyright (C) 2015 ovh.com
# Copyright (C) 2017 Ycarus (Yannick Chabanois) <ycarus@zugaina.org>
# Copyright (C) 2017-2020 Ycarus (Yannick Chabanois) <ycarus@zugaina.org>
START=90
STOP=10
@ -19,22 +19,19 @@ _err() {
}
validate_section() {
uci_validate_section glorytun glorytun "${1}" \
'enable:bool:0' \
'key:string' \
'host:host' \
'port:port' \
'proto:string' \
'bind:string:0.0.0.0' \
'bindport:port' \
'mtu:uinteger:1450' \
'mtuauto:bool:0' \
'chacha20:bool:0' \
uci_validate_section glorytun-udp glorytun-udp "${1}" \
'enable:bool:0' \
'mode:string' \
'key:string' \
'host:host' \
'port:port' \
'mtuauto:bool:0' \
'chacha:bool:0' \
'dev:string'
}
start_instance() {
local enable key host port listener proto bind bindport mtu mtuauto chacha20 dev
local enable key host port listener proto mtuauto chacha dev mode
validate_section "${1}" || {
_err "validation failed"
@ -42,12 +39,12 @@ start_instance() {
}
[ "${enable}" = "1" ] || return 1
[ "${proto}" = "udp" ] || return 1
[ -n "${key}" ] || return 1
[ "${key}" != "secretkey" ] || return 1
[ -n "${port}" ] || return 1
[ -n "${dev}" ] || return 1
[ -n "${mode}" ] || return 1
echo "${key}" > /tmp/${PROG_NAME}-${1}.key
key=""
@ -62,15 +59,13 @@ start_instance() {
procd_open_instance
procd_set_param command ${PROG} \
${bind:+bind "$bind"} \
${bindport:+ "$bindport"} \
${host:+to "$host"} \
${port:+ "$port"} \
${host:+bind ${mode} addr "$host"} \
${port:+port "$port"} \
${dev:+dev "$dev"} \
keyfile /tmp/${PROG_NAME}-${1}.key \
persist
[ "${chacha20}" = "1" ] && procd_append_param command chacha
[ "${chacha}" = "1" ] && procd_append_param command chacha
procd_set_param respawn 0 30 0
procd_set_param file /tmp/${PROG_NAME}-${1}.key
@ -104,8 +99,8 @@ add_glorytun_path() {
start_service() {
local dev
config_load glorytun
config_foreach start_instance glorytun
config_load glorytun-udp
config_foreach start_instance glorytun-udp
}
reload_service() {

View file

@ -10,4 +10,5 @@ config glorytun 'vpn'
option mtuauto '1'
option localip '10.255.255.2'
option remoteip '10.255.255.1'
option multiqueue '1'
option multiqueue '1'
option label 'Default VPN'

View file

@ -22,17 +22,18 @@ validate_section() {
uci_validate_section glorytun glorytun "${1}" \
'enable:bool:0' \
'mptcp:bool:0' \
'listener:bool:0' \
'mode:string' \
'key:string' \
'host:host' \
'port:port' \
'dev:string' \
'timeout:uinteger:10000' \
'chacha20:bool:0' \
'proto:string'
}
start_instance() {
local enable key host port dev listener mptcp proto chacha20
local enable key host port dev mptcp proto chacha20 mode multiqueue timeout
validate_section "${1}" || {
_err "validation failed"
@ -71,14 +72,14 @@ start_instance() {
${host:+host "$host"} \
${dev:+dev "$dev"}
[ "${listener}" = "1" ] && procd_append_param command listener
[ "${mode}" = "listener" ] && procd_append_param command listener
[ "${mptcp}" = "1" ] && procd_append_param command mptcp
[ "${chacha20}" = "1" ] && procd_append_param command chacha20
[ "${multiqueue}" = "1" ] && procd_append_param command multiqueue
procd_append_param command \
retry count -1 const 500000 \
timeout 10000 \
timeout ${timeout} \
keepalive count 5 idle 20 interval 2 \
buffer-size 32768

View file

@ -1,11 +1,11 @@
#
# Copyright (C) 2018-2019 Ycarus (Yannick Chabanois) <ycarus@zugaina.org> for OpenMPTCProuter
# Copyright (C) 2018-2020 Ycarus (Yannick Chabanois) <ycarus@zugaina.org>
#
#
include $(TOPDIR)/rules.mk
LUCI_TITLE:=LuCI Support for DSVPN
LUCI_TITLE:=LuCI Interface to DSVPN
LUCI_DEPENDS:=+dsvpn
PKG_LICENSE:=GPLv3

View file

@ -0,0 +1,66 @@
'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('dsvpn', _('DSVPN'));
s = m.section(form.GridSection, 'dsvpn', _('Instances'));
s.addremove = true;
s.anonymous = true;
s.nodescriptions = true;
o = s.option(form.Flag, 'enable', _('Enabled'));
o.default = o.enabled;
o = s.option(form.Value, 'label', _('Label'));
o.rmempty = true;
o = s.option(form.ListValue, 'mode', _('Mode'));
o.value('client',_('Client'));
o.value('server',_('Server'));
o.modalonly = true;
o = s.option(form.Value, 'host', _('Host'));
o.rmempty = false;
o = s.option(form.Value, 'port', _('Port'));
o.rmempty = false;
o = s.option(form.Value, 'key', _('Key'));
o.rmempty = false;
o.modalonly = true;
o = s.option(form.Value, 'dev', _('Interface name'));
o.rmempty = false;
o.modalonly = true;
o = s.option(form.Value, 'localip', _('Local IP'));
o.datatype = 'or(ip4addr,ip6addr)';
o.rmempty = false;
o = s.option(form.Value, 'remoteip', _('Remote IP'));
o.datatype = 'or(ip4addr,ip6addr)';
o.rmempty = false;
return m.render();
}
});

View file

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

View file

@ -1,44 +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("dsvpn", translate("DSVPN"))
s = m:section(TypedSection, "dsvpn", translate("Settings"))
s.anonymous = true
s.addremove = false
o = s:option(Flag, "enable", translate("Enable"))
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, "port", translate("Remote port"))
o.placeholder = "65011"
o.default = "65011"
o.datatype = "port"
o = s:option(Value, "key", translate("Key"))
o.password = true
o.rmempty = false
o = s:option(Value, "localip", translate("Tunnel local IP"))
o.default = "10.255.251.2"
o.datatype = "host"
o = s:option(Value, "remoteip", translate("Tunnel remote IP"))
o.default = "10.255.251.1"
o.datatype = "host"
o = s:option(Value, "dev", translate("Interface name"))
o.placeholder = "tun0"
o.default = "tun0"
o.rmempty = false
return m

View file

@ -1,50 +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/"
"luciapplicationsdsvpn/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"
#: luci-app-dsvpn/luasrc/controller/dsvpn.lua:4
#: luci-app-dsvpn/luasrc/controller/dsvpn.lua:5
#: luci-app-dsvpn/luasrc/controller/dsvpn.lua:6
#: luci-app-dsvpn/luasrc/model/cbi/dsvpn.lua:6
msgid "DSVPN"
msgstr "DSVPN"
#: luci-app-dsvpn/luasrc/model/cbi/dsvpn.lua:12
msgid "Enable"
msgstr "Aktivieren"
#: luci-app-dsvpn/luasrc/model/cbi/dsvpn.lua:39
msgid "Interface name"
msgstr "Name der Verbindung"
#: luci-app-dsvpn/luasrc/model/cbi/dsvpn.lua:26
msgid "Key"
msgstr "Schlüssel"
#: luci-app-dsvpn/luasrc/model/cbi/dsvpn.lua:15
msgid "Remote host"
msgstr "Gegenstelle (FQDN oder IP-Adresse)"
#: luci-app-dsvpn/luasrc/model/cbi/dsvpn.lua:21
msgid "Remote port"
msgstr "Port der Gegenstelle"
#: luci-app-dsvpn/luasrc/model/cbi/dsvpn.lua:8
msgid "Settings"
msgstr "Einstellungen"
#: luci-app-dsvpn/luasrc/model/cbi/dsvpn.lua:31
msgid "Tunnel local IP"
msgstr "Lokale Tunnel-IP"
#: luci-app-dsvpn/luasrc/model/cbi/dsvpn.lua:35
msgid "Tunnel remote IP"
msgstr "Gegenstellen-Tunnel-IP"

View file

@ -1,53 +1,68 @@
msgid ""
msgstr ""
"Project-Id-Version: \n"
"POT-Creation-Date: \n"
"PO-Revision-Date: 2020-09-30 08:50+0000\n"
"Last-Translator: Anonymous <noreply@weblate.org>\n"
"PO-Revision-Date: 2020-12-15 14:46+0000\n"
"Last-Translator: Weblate Admin <contact@openmptcprouter.com>\n"
"Language-Team: French <http://weblate.openmptcprouter.com/projects/omr/"
"luciapplicationsdsvpn/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"
#: luci-app-dsvpn/luasrc/controller/dsvpn.lua:4
#: luci-app-dsvpn/luasrc/controller/dsvpn.lua:5
#: luci-app-dsvpn/luasrc/controller/dsvpn.lua:6
#: luci-app-dsvpn/luasrc/model/cbi/dsvpn.lua:6
#: luci-app-dsvpn/htdocs/luci-static/resources/view/services/dsvpn.js:35
msgid "Client"
msgstr "Client"
#: luci-app-dsvpn/htdocs/luci-static/resources/view/services/dsvpn.js:24
#: luci-app-dsvpn/root/usr/share/luci/menu.d/luci-app-dsvpn.json:3
msgid "DSVPN"
msgstr "DSVPN"
#: luci-app-dsvpn/luasrc/model/cbi/dsvpn.lua:12
msgid "Enable"
#: luci-app-dsvpn/htdocs/luci-static/resources/view/services/dsvpn.js:31
msgid "Enabled"
msgstr "Activer"
#: luci-app-dsvpn/luasrc/model/cbi/dsvpn.lua:39
#: luci-app-dsvpn/root/usr/share/rpcd/acl.d/luci-app-dsvpn.json:3
msgid "Grant access to DSVPN"
msgstr "Accorder l'accès à DSVPN"
#: luci-app-dsvpn/htdocs/luci-static/resources/view/services/dsvpn.js:39
msgid "Host"
msgstr "Hôte"
#: luci-app-dsvpn/htdocs/luci-static/resources/view/services/dsvpn.js:26
msgid "Instances"
msgstr "Instances"
#: luci-app-dsvpn/htdocs/luci-static/resources/view/services/dsvpn.js:49
msgid "Interface name"
msgstr "Nom de l'interface"
#: luci-app-dsvpn/luasrc/model/cbi/dsvpn.lua:26
#: luci-app-dsvpn/htdocs/luci-static/resources/view/services/dsvpn.js:45
msgid "Key"
msgstr "Clé"
msgstr "Clef"
#: luci-app-dsvpn/luasrc/model/cbi/dsvpn.lua:15
msgid "Remote host"
msgstr "Nom de l'hôte distant ou adresse IP"
#: luci-app-dsvpn/htdocs/luci-static/resources/view/services/dsvpn.js:61
msgid "Label"
msgstr "Étiquette"
#: luci-app-dsvpn/luasrc/model/cbi/dsvpn.lua:21
msgid "Remote port"
msgstr "Port distant"
#: luci-app-dsvpn/htdocs/luci-static/resources/view/services/dsvpn.js:53
msgid "Local IP"
msgstr "Adresse IP locale"
#: luci-app-dsvpn/luasrc/model/cbi/dsvpn.lua:8
msgid "Settings"
msgstr "Paramètres"
#: luci-app-dsvpn/htdocs/luci-static/resources/view/services/dsvpn.js:34
msgid "Mode"
msgstr "Mode"
#: luci-app-dsvpn/luasrc/model/cbi/dsvpn.lua:31
msgid "Tunnel local IP"
msgstr "Adresse IP locale du tunnel"
#: luci-app-dsvpn/htdocs/luci-static/resources/view/services/dsvpn.js:42
msgid "Port"
msgstr "Port"
#: luci-app-dsvpn/luasrc/model/cbi/dsvpn.lua:35
msgid "Tunnel remote IP"
msgstr "Adresse IP distance du tunnel"
#: luci-app-dsvpn/htdocs/luci-static/resources/view/services/dsvpn.js:57
msgid "Remote IP"
msgstr "IP Distante"
#: luci-app-dsvpn/htdocs/luci-static/resources/view/services/dsvpn.js:36
msgid "Server"
msgstr "Serveur"

View file

@ -1,50 +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/"
"luciapplicationsdsvpn/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"
#: luci-app-dsvpn/luasrc/controller/dsvpn.lua:4
#: luci-app-dsvpn/luasrc/controller/dsvpn.lua:5
#: luci-app-dsvpn/luasrc/controller/dsvpn.lua:6
#: luci-app-dsvpn/luasrc/model/cbi/dsvpn.lua:6
msgid "DSVPN"
msgstr "DSVPN"
#: luci-app-dsvpn/luasrc/model/cbi/dsvpn.lua:12
msgid "Enable"
msgstr "Attivare"
#: luci-app-dsvpn/luasrc/model/cbi/dsvpn.lua:39
msgid "Interface name"
msgstr "Nome interfaccia"
#: luci-app-dsvpn/luasrc/model/cbi/dsvpn.lua:26
msgid "Key"
msgstr "Key"
#: luci-app-dsvpn/luasrc/model/cbi/dsvpn.lua:15
msgid "Remote host"
msgstr "Rimuovi server"
#: luci-app-dsvpn/luasrc/model/cbi/dsvpn.lua:21
msgid "Remote port"
msgstr "Porta remota"
#: luci-app-dsvpn/luasrc/model/cbi/dsvpn.lua:8
msgid "Settings"
msgstr "Impostazioni"
#: luci-app-dsvpn/luasrc/model/cbi/dsvpn.lua:31
msgid "Tunnel local IP"
msgstr "IP locale del tunnel"
#: luci-app-dsvpn/luasrc/model/cbi/dsvpn.lua:35
msgid "Tunnel remote IP"
msgstr "IP remoto del tunnel"

View file

@ -1,50 +0,0 @@
msgid ""
msgstr ""
"PO-Revision-Date: 2020-08-18 17:37+0000\n"
"Last-Translator: Quentin PAGÈS <githubou@quentino.fr>\n"
"Language-Team: Occitan <http://weblate.openmptcprouter.com/projects/omr/"
"luciapplicationsdsvpn/oc/>\n"
"Language: oc\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"
#: luci-app-dsvpn/luasrc/controller/dsvpn.lua:4
#: luci-app-dsvpn/luasrc/controller/dsvpn.lua:5
#: luci-app-dsvpn/luasrc/controller/dsvpn.lua:6
#: luci-app-dsvpn/luasrc/model/cbi/dsvpn.lua:6
msgid "DSVPN"
msgstr "DSVPN"
#: luci-app-dsvpn/luasrc/model/cbi/dsvpn.lua:12
msgid "Enable"
msgstr "Activat"
#: luci-app-dsvpn/luasrc/model/cbi/dsvpn.lua:39
msgid "Interface name"
msgstr "Nom de linterfàcia"
#: luci-app-dsvpn/luasrc/model/cbi/dsvpn.lua:26
msgid "Key"
msgstr "Clau"
#: luci-app-dsvpn/luasrc/model/cbi/dsvpn.lua:15
msgid "Remote host"
msgstr "Nom de lòste distant o adreça IP"
#: luci-app-dsvpn/luasrc/model/cbi/dsvpn.lua:21
msgid "Remote port"
msgstr "Pòrt distant"
#: luci-app-dsvpn/luasrc/model/cbi/dsvpn.lua:8
msgid "Settings"
msgstr "Paramètres"
#: luci-app-dsvpn/luasrc/model/cbi/dsvpn.lua:31
msgid "Tunnel local IP"
msgstr "Adreça IP locala del tunèl"
#: luci-app-dsvpn/luasrc/model/cbi/dsvpn.lua:35
msgid "Tunnel remote IP"
msgstr "Adreça IP distanta del tunèl"

View file

@ -1,41 +1,59 @@
msgid ""
msgstr "Content-Type: text/plain; charset=UTF-8"
#: luci-app-dsvpn/luasrc/controller/dsvpn.lua:4
#: luci-app-dsvpn/luasrc/controller/dsvpn.lua:5
#: luci-app-dsvpn/luasrc/controller/dsvpn.lua:6
#: luci-app-dsvpn/luasrc/model/cbi/dsvpn.lua:6
#: luci-app-dsvpn/htdocs/luci-static/resources/view/services/dsvpn.js:35
msgid "Client"
msgstr ""
#: luci-app-dsvpn/htdocs/luci-static/resources/view/services/dsvpn.js:24
#: luci-app-dsvpn/root/usr/share/luci/menu.d/luci-app-dsvpn.json:3
msgid "DSVPN"
msgstr ""
#: luci-app-dsvpn/luasrc/model/cbi/dsvpn.lua:12
msgid "Enable"
#: luci-app-dsvpn/htdocs/luci-static/resources/view/services/dsvpn.js:31
msgid "Enabled"
msgstr ""
#: luci-app-dsvpn/luasrc/model/cbi/dsvpn.lua:39
#: luci-app-dsvpn/root/usr/share/rpcd/acl.d/luci-app-dsvpn.json:3
msgid "Grant access to DSVPN"
msgstr ""
#: luci-app-dsvpn/htdocs/luci-static/resources/view/services/dsvpn.js:39
msgid "Host"
msgstr ""
#: luci-app-dsvpn/htdocs/luci-static/resources/view/services/dsvpn.js:26
msgid "Instances"
msgstr ""
#: luci-app-dsvpn/htdocs/luci-static/resources/view/services/dsvpn.js:49
msgid "Interface name"
msgstr ""
#: luci-app-dsvpn/luasrc/model/cbi/dsvpn.lua:26
#: luci-app-dsvpn/htdocs/luci-static/resources/view/services/dsvpn.js:45
msgid "Key"
msgstr ""
#: luci-app-dsvpn/luasrc/model/cbi/dsvpn.lua:15
msgid "Remote host"
#: luci-app-dsvpn/htdocs/luci-static/resources/view/services/dsvpn.js:61
msgid "Label"
msgstr ""
#: luci-app-dsvpn/luasrc/model/cbi/dsvpn.lua:21
msgid "Remote port"
#: luci-app-dsvpn/htdocs/luci-static/resources/view/services/dsvpn.js:53
msgid "Local IP"
msgstr ""
#: luci-app-dsvpn/luasrc/model/cbi/dsvpn.lua:8
msgid "Settings"
#: luci-app-dsvpn/htdocs/luci-static/resources/view/services/dsvpn.js:34
msgid "Mode"
msgstr ""
#: luci-app-dsvpn/luasrc/model/cbi/dsvpn.lua:31
msgid "Tunnel local IP"
#: luci-app-dsvpn/htdocs/luci-static/resources/view/services/dsvpn.js:42
msgid "Port"
msgstr ""
#: luci-app-dsvpn/luasrc/model/cbi/dsvpn.lua:35
msgid "Tunnel remote IP"
#: luci-app-dsvpn/htdocs/luci-static/resources/view/services/dsvpn.js:57
msgid "Remote IP"
msgstr ""
#: luci-app-dsvpn/htdocs/luci-static/resources/view/services/dsvpn.js:36
msgid "Server"
msgstr ""

View file

@ -1,6 +1,6 @@
msgid ""
msgstr ""
"PO-Revision-Date: 2020-06-11 16:36+0000\n"
"PO-Revision-Date: 2020-12-04 16:03+0000\n"
"Last-Translator: antrouter <xinyangla@188.com>\n"
"Language-Team: Chinese (Simplified) <http://weblate.openmptcprouter.com/"
"projects/omr/luciapplicationsdsvpn/zh_Hans/>\n"
@ -10,41 +10,59 @@ msgstr ""
"Plural-Forms: nplurals=1; plural=0;\n"
"X-Generator: Weblate 4.0.4\n"
#: luci-app-dsvpn/luasrc/controller/dsvpn.lua:4
#: luci-app-dsvpn/luasrc/controller/dsvpn.lua:5
#: luci-app-dsvpn/luasrc/controller/dsvpn.lua:6
#: luci-app-dsvpn/luasrc/model/cbi/dsvpn.lua:6
msgid "DSVPN"
msgstr "DS虚拟专网"
#: luci-app-dsvpn/htdocs/luci-static/resources/view/services/dsvpn.js:35
msgid "Client"
msgstr "客户端"
#: luci-app-dsvpn/luasrc/model/cbi/dsvpn.lua:12
msgid "Enable"
#: luci-app-dsvpn/htdocs/luci-static/resources/view/services/dsvpn.js:24
#: luci-app-dsvpn/root/usr/share/luci/menu.d/luci-app-dsvpn.json:3
msgid "DSVPN"
msgstr "DSVPN"
#: luci-app-dsvpn/htdocs/luci-static/resources/view/services/dsvpn.js:31
msgid "Enabled"
msgstr "开启"
#: luci-app-dsvpn/luasrc/model/cbi/dsvpn.lua:39
msgid "Interface name"
msgstr "网卡名称"
#: luci-app-dsvpn/root/usr/share/rpcd/acl.d/luci-app-dsvpn.json:3
msgid "Grant access to DSVPN"
msgstr "授予对DSVPN的访问权限"
#: luci-app-dsvpn/luasrc/model/cbi/dsvpn.lua:26
#: luci-app-dsvpn/htdocs/luci-static/resources/view/services/dsvpn.js:39
msgid "Host"
msgstr "主机"
#: luci-app-dsvpn/htdocs/luci-static/resources/view/services/dsvpn.js:26
msgid "Instances"
msgstr "实例"
#: luci-app-dsvpn/htdocs/luci-static/resources/view/services/dsvpn.js:49
msgid "Interface name"
msgstr "接口名称"
#: luci-app-dsvpn/htdocs/luci-static/resources/view/services/dsvpn.js:45
msgid "Key"
msgstr "秘钥"
#: luci-app-dsvpn/luasrc/model/cbi/dsvpn.lua:15
msgid "Remote host"
msgstr "远程主机"
#: luci-app-dsvpn/htdocs/luci-static/resources/view/services/dsvpn.js:61
msgid "Label"
msgstr "标签"
#: luci-app-dsvpn/luasrc/model/cbi/dsvpn.lua:21
msgid "Remote port"
msgstr "远程端口"
#: luci-app-dsvpn/htdocs/luci-static/resources/view/services/dsvpn.js:53
msgid "Local IP"
msgstr "本地IP"
#: luci-app-dsvpn/luasrc/model/cbi/dsvpn.lua:8
msgid "Settings"
msgstr "设置"
#: luci-app-dsvpn/htdocs/luci-static/resources/view/services/dsvpn.js:34
msgid "Mode"
msgstr "模式"
#: luci-app-dsvpn/luasrc/model/cbi/dsvpn.lua:31
msgid "Tunnel local IP"
msgstr "隧道本地IP"
#: luci-app-dsvpn/htdocs/luci-static/resources/view/services/dsvpn.js:42
msgid "Port"
msgstr "端口"
#: luci-app-dsvpn/luasrc/model/cbi/dsvpn.lua:35
msgid "Tunnel remote IP"
msgstr "隧道远程IP"
#: luci-app-dsvpn/htdocs/luci-static/resources/view/services/dsvpn.js:57
msgid "Remote IP"
msgstr "远程IP"
#: luci-app-dsvpn/htdocs/luci-static/resources/view/services/dsvpn.js:36
msgid "Server"
msgstr "服务器"

View file

@ -1,50 +0,0 @@
msgid ""
msgstr ""
"PO-Revision-Date: 2020-07-09 07:31+0000\n"
"Last-Translator: antrouter <xinyangla@188.com>\n"
"Language-Team: Chinese (Traditional) <http://weblate.openmptcprouter.com/"
"projects/omr/luciapplicationsdsvpn/zh_Hant/>\n"
"Language: zh_Hant\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"
#: luci-app-dsvpn/luasrc/controller/dsvpn.lua:4
#: luci-app-dsvpn/luasrc/controller/dsvpn.lua:5
#: luci-app-dsvpn/luasrc/controller/dsvpn.lua:6
#: luci-app-dsvpn/luasrc/model/cbi/dsvpn.lua:6
msgid "DSVPN"
msgstr "DS虛擬專用網"
#: luci-app-dsvpn/luasrc/model/cbi/dsvpn.lua:12
msgid "Enable"
msgstr "啟用"
#: luci-app-dsvpn/luasrc/model/cbi/dsvpn.lua:39
msgid "Interface name"
msgstr "接口名稱"
#: luci-app-dsvpn/luasrc/model/cbi/dsvpn.lua:26
msgid "Key"
msgstr "秘鑰"
#: luci-app-dsvpn/luasrc/model/cbi/dsvpn.lua:15
msgid "Remote host"
msgstr "遠程主機"
#: luci-app-dsvpn/luasrc/model/cbi/dsvpn.lua:21
msgid "Remote port"
msgstr "遠端埠"
#: luci-app-dsvpn/luasrc/model/cbi/dsvpn.lua:8
msgid "Settings"
msgstr "設定"
#: luci-app-dsvpn/luasrc/model/cbi/dsvpn.lua:31
msgid "Tunnel local IP"
msgstr "隧道本地IP"
#: luci-app-dsvpn/luasrc/model/cbi/dsvpn.lua:35
msgid "Tunnel remote IP"
msgstr "隧道遠程IP"

View file

@ -1,10 +1,10 @@
{
"admin/vpn/dsvpn": {
"title": "DSVPN",
"order": 10,
"order": 60,
"action": {
"type": "cbi",
"path": "dsvpn"
"type": "view",
"path": "services/dsvpn"
},
"depends": {
"acl": [ "luci-app-dsvpn" ]

View file

@ -1,6 +1,6 @@
{
"luci-app-dsvpn": {
"description": "Grant UCI access for luci-app-dsvpn",
"description": "Grant access to DSVPN",
"read": {
"uci": [ "dsvpn" ]
},

View file

@ -308,6 +308,7 @@ return view.extend({
o.value('network-redirect');
o.value('network-unknown');
o.value('network-unreachable');
o.value('packet-too-big');
o.value('parameter-problem');
o.value('port-unreachable');
o.value('precedence-cutoff');

View file

@ -177,9 +177,11 @@ return view.extend({
}
return Promise.all(tasks).then(function(zone_networks) {
if (zone_networks[0])
if (zone_networks[0]) {
zone_networks[0].clearNetworks();
for (var i = 1; i < zone_networks.length; i++)
zone_networks[0].addNetwork(zone_networks[i].getName());
}
});
};

View file

@ -0,0 +1,16 @@
#
# Copyright (C) 2018-2020 Ycarus (Yannick Chabanois) <ycarus@zugaina.org>
#
#
include $(TOPDIR)/rules.mk
LUCI_TITLE:=LuCI Interface to Glorytun TCP
LUCI_DEPENDS:=+glorytun
PKG_LICENSE:=GPLv3
#include ../luci/luci.mk
include $(TOPDIR)/feeds/luci/luci.mk
# call BuildPackage - OpenWrt buildroot signature

View file

@ -0,0 +1,87 @@
'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('glorytun', _('Glorytun TCP'));
s = m.section(form.GridSection, 'glorytun', _('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.Value, 'label', _('Label'));
o.rmempty = true;
o = s.taboption('general', form.ListValue, 'mode', _('Mode'));
o.value('',_('Client'));
o.value('listener',_('Server'));
o.modalonly = true;
o = s.taboption('general', form.Value, 'host', _('Host'));
o.rmempty = false;
o = s.taboption('general', form.Value, 'port', _('Port'));
o.rmempty = false;
o = s.taboption('general', form.Value, 'key', _('Key'));
o.rmempty = false;
o.modalonly = true;
o = s.taboption('general', form.Value, 'dev', _('Interface name'));
o.rmempty = false;
o.modalonly = true;
o = s.taboption('general', form.Value, 'localip', _('Local IP'));
o.datatype = 'or(ip4addr,ip6addr)';
o.rmempty = false;
o = s.taboption('general', form.Value, 'remoteip', _('Remote IP'));
o.datatype = 'or(ip4addr,ip6addr)';
o.rmempty = false;
o = s.taboption('advanced', form.Flag, 'mptcp', _('MPTCP'));
o.default = o.enabled;
o.modalonly = true;
o = s.taboption('advanced', form.Flag, 'chacha20', _('chacha'), _('Force fallback cipher'));
o.default = o.enabled;
o.modalonly = true;
o = s.taboption('advanced', form.Value, 'timeout', _('Timeout'));
o.default = '10000';
o.rmempty = false;
o.modalonly = true;
o = s.taboption('advanced', form.Flag, 'multiqueue', _('Multiqueue'));
o.default = o.enabled;
o.rmempty = false;
o.modalonly = true;
return m.render();
}
});

View file

@ -0,0 +1,96 @@
msgid ""
msgstr ""
"PO-Revision-Date: 2020-12-15 14:46+0000\n"
"Last-Translator: Weblate Admin <contact@openmptcprouter.com>\n"
"Language-Team: French <http://weblate.openmptcprouter.com/projects/omr/"
"glorytun-tcp/fr/>\n"
"Language: fr\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"
#: luci-app-glorytun-tcp/htdocs/luci-static/resources/view/services/glorytun-tcp.js:32
msgid "Advanced Settings"
msgstr "Configuration avancée"
#: luci-app-glorytun-tcp/htdocs/luci-static/resources/view/services/glorytun-tcp.js:38
msgid "Client"
msgstr "Client"
#: luci-app-glorytun-tcp/htdocs/luci-static/resources/view/services/glorytun-tcp.js:34
msgid "Enabled"
msgstr "Activer"
#: luci-app-glorytun-tcp/htdocs/luci-static/resources/view/services/glorytun-tcp.js:68
msgid "Force fallback cipher"
msgstr "Forcer le chiffrement de secours"
#: luci-app-glorytun-tcp/htdocs/luci-static/resources/view/services/glorytun-tcp.js:31
msgid "General Settings"
msgstr "Paramètres généraux"
#: luci-app-glorytun-tcp/htdocs/luci-static/resources/view/services/glorytun-tcp.js:24
#: luci-app-glorytun-tcp/root/usr/share/luci/menu.d/luci-app-glorytun-tcp.json:3
msgid "Glorytun TCP"
msgstr "Glorytun TCP"
#: luci-app-glorytun-tcp/root/usr/share/rpcd/acl.d/luci-app-glorytun-tcp.json:3
msgid "Grant access to glorytun TCP"
msgstr "Accorder l'accès à Glorytun TCP"
#: luci-app-glorytun-tcp/htdocs/luci-static/resources/view/services/glorytun-tcp.js:42
msgid "Host"
msgstr "Hôte"
#: luci-app-glorytun-tcp/htdocs/luci-static/resources/view/services/glorytun-tcp.js:26
msgid "Instances"
msgstr "Instances"
#: luci-app-glorytun-tcp/htdocs/luci-static/resources/view/services/glorytun-tcp.js:52
msgid "Interface name"
msgstr "Nom de l'interface"
#: luci-app-glorytun-tcp/htdocs/luci-static/resources/view/services/glorytun-tcp.js:48
msgid "Key"
msgstr "Clef"
#: luci-app-glorytun-tcp/htdocs/luci-static/resources/view/services/glorytun-tcp.js:82
msgid "Label"
msgstr "Étiquette"
#: luci-app-glorytun-tcp/htdocs/luci-static/resources/view/services/glorytun-tcp.js:56
msgid "Local IP"
msgstr "Adresse IP locale"
#: luci-app-glorytun-tcp/htdocs/luci-static/resources/view/services/glorytun-tcp.js:64
msgid "MPTCP"
msgstr "MPTCP"
#: luci-app-glorytun-tcp/htdocs/luci-static/resources/view/services/glorytun-tcp.js:37
msgid "Mode"
msgstr "Mode"
#: luci-app-glorytun-tcp/htdocs/luci-static/resources/view/services/glorytun-tcp.js:77
msgid "Multiqueue"
msgstr "Multiqueue"
#: luci-app-glorytun-tcp/htdocs/luci-static/resources/view/services/glorytun-tcp.js:45
msgid "Port"
msgstr "Port"
#: luci-app-glorytun-tcp/htdocs/luci-static/resources/view/services/glorytun-tcp.js:60
msgid "Remote IP"
msgstr "IP Distante"
#: luci-app-glorytun-tcp/htdocs/luci-static/resources/view/services/glorytun-tcp.js:39
msgid "Server"
msgstr "Serveur"
#: luci-app-glorytun-tcp/htdocs/luci-static/resources/view/services/glorytun-tcp.js:72
msgid "Timeout"
msgstr ""
#: luci-app-glorytun-tcp/htdocs/luci-static/resources/view/services/glorytun-tcp.js:68
msgid "chacha"
msgstr "Chacha"

View file

@ -0,0 +1,87 @@
msgid ""
msgstr "Content-Type: text/plain; charset=UTF-8"
#: luci-app-glorytun-tcp/htdocs/luci-static/resources/view/services/glorytun-tcp.js:32
msgid "Advanced Settings"
msgstr ""
#: luci-app-glorytun-tcp/htdocs/luci-static/resources/view/services/glorytun-tcp.js:38
msgid "Client"
msgstr ""
#: luci-app-glorytun-tcp/htdocs/luci-static/resources/view/services/glorytun-tcp.js:34
msgid "Enabled"
msgstr ""
#: luci-app-glorytun-tcp/htdocs/luci-static/resources/view/services/glorytun-tcp.js:68
msgid "Force fallback cipher"
msgstr ""
#: luci-app-glorytun-tcp/htdocs/luci-static/resources/view/services/glorytun-tcp.js:31
msgid "General Settings"
msgstr ""
#: luci-app-glorytun-tcp/htdocs/luci-static/resources/view/services/glorytun-tcp.js:24
#: luci-app-glorytun-tcp/root/usr/share/luci/menu.d/luci-app-glorytun-tcp.json:3
msgid "Glorytun TCP"
msgstr ""
#: luci-app-glorytun-tcp/root/usr/share/rpcd/acl.d/luci-app-glorytun-tcp.json:3
msgid "Grant access to glorytun TCP"
msgstr ""
#: luci-app-glorytun-tcp/htdocs/luci-static/resources/view/services/glorytun-tcp.js:42
msgid "Host"
msgstr ""
#: luci-app-glorytun-tcp/htdocs/luci-static/resources/view/services/glorytun-tcp.js:26
msgid "Instances"
msgstr ""
#: luci-app-glorytun-tcp/htdocs/luci-static/resources/view/services/glorytun-tcp.js:52
msgid "Interface name"
msgstr ""
#: luci-app-glorytun-tcp/htdocs/luci-static/resources/view/services/glorytun-tcp.js:48
msgid "Key"
msgstr ""
#: luci-app-glorytun-tcp/htdocs/luci-static/resources/view/services/glorytun-tcp.js:82
msgid "Label"
msgstr ""
#: luci-app-glorytun-tcp/htdocs/luci-static/resources/view/services/glorytun-tcp.js:56
msgid "Local IP"
msgstr ""
#: luci-app-glorytun-tcp/htdocs/luci-static/resources/view/services/glorytun-tcp.js:64
msgid "MPTCP"
msgstr ""
#: luci-app-glorytun-tcp/htdocs/luci-static/resources/view/services/glorytun-tcp.js:37
msgid "Mode"
msgstr ""
#: luci-app-glorytun-tcp/htdocs/luci-static/resources/view/services/glorytun-tcp.js:77
msgid "Multiqueue"
msgstr ""
#: luci-app-glorytun-tcp/htdocs/luci-static/resources/view/services/glorytun-tcp.js:45
msgid "Port"
msgstr ""
#: luci-app-glorytun-tcp/htdocs/luci-static/resources/view/services/glorytun-tcp.js:60
msgid "Remote IP"
msgstr ""
#: luci-app-glorytun-tcp/htdocs/luci-static/resources/view/services/glorytun-tcp.js:39
msgid "Server"
msgstr ""
#: luci-app-glorytun-tcp/htdocs/luci-static/resources/view/services/glorytun-tcp.js:72
msgid "Timeout"
msgstr ""
#: luci-app-glorytun-tcp/htdocs/luci-static/resources/view/services/glorytun-tcp.js:68
msgid "chacha"
msgstr ""

View file

@ -0,0 +1,96 @@
msgid ""
msgstr ""
"PO-Revision-Date: 2020-12-04 16:03+0000\n"
"Last-Translator: antrouter <xinyangla@188.com>\n"
"Language-Team: Chinese (Simplified) <http://weblate.openmptcprouter.com/"
"projects/omr/glorytun-tcp/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"
#: luci-app-glorytun-tcp/htdocs/luci-static/resources/view/services/glorytun-tcp.js:32
msgid "Advanced Settings"
msgstr "高级设置"
#: luci-app-glorytun-tcp/htdocs/luci-static/resources/view/services/glorytun-tcp.js:38
msgid "Client"
msgstr "客户端"
#: luci-app-glorytun-tcp/htdocs/luci-static/resources/view/services/glorytun-tcp.js:34
msgid "Enabled"
msgstr "开启"
#: luci-app-glorytun-tcp/htdocs/luci-static/resources/view/services/glorytun-tcp.js:68
msgid "Force fallback cipher"
msgstr "强制回退密码"
#: luci-app-glorytun-tcp/htdocs/luci-static/resources/view/services/glorytun-tcp.js:31
msgid "General Settings"
msgstr "通用设置"
#: luci-app-glorytun-tcp/htdocs/luci-static/resources/view/services/glorytun-tcp.js:24
#: luci-app-glorytun-tcp/root/usr/share/luci/menu.d/luci-app-glorytun-tcp.json:3
msgid "Glorytun TCP"
msgstr "glorytun TCP"
#: luci-app-glorytun-tcp/root/usr/share/rpcd/acl.d/luci-app-glorytun-tcp.json:3
msgid "Grant access to glorytun TCP"
msgstr "授予访问glorytun TCP的权限"
#: luci-app-glorytun-tcp/htdocs/luci-static/resources/view/services/glorytun-tcp.js:42
msgid "Host"
msgstr "主机"
#: luci-app-glorytun-tcp/htdocs/luci-static/resources/view/services/glorytun-tcp.js:26
msgid "Instances"
msgstr "实例"
#: luci-app-glorytun-tcp/htdocs/luci-static/resources/view/services/glorytun-tcp.js:52
msgid "Interface name"
msgstr "接口名称"
#: luci-app-glorytun-tcp/htdocs/luci-static/resources/view/services/glorytun-tcp.js:48
msgid "Key"
msgstr "秘钥"
#: luci-app-glorytun-tcp/htdocs/luci-static/resources/view/services/glorytun-tcp.js:82
msgid "Label"
msgstr "标签"
#: luci-app-glorytun-tcp/htdocs/luci-static/resources/view/services/glorytun-tcp.js:56
msgid "Local IP"
msgstr "本地IP"
#: luci-app-glorytun-tcp/htdocs/luci-static/resources/view/services/glorytun-tcp.js:64
msgid "MPTCP"
msgstr "聚合"
#: luci-app-glorytun-tcp/htdocs/luci-static/resources/view/services/glorytun-tcp.js:37
msgid "Mode"
msgstr "模式"
#: luci-app-glorytun-tcp/htdocs/luci-static/resources/view/services/glorytun-tcp.js:77
msgid "Multiqueue"
msgstr "多队列"
#: luci-app-glorytun-tcp/htdocs/luci-static/resources/view/services/glorytun-tcp.js:45
msgid "Port"
msgstr "端口"
#: luci-app-glorytun-tcp/htdocs/luci-static/resources/view/services/glorytun-tcp.js:60
msgid "Remote IP"
msgstr "远程IP"
#: luci-app-glorytun-tcp/htdocs/luci-static/resources/view/services/glorytun-tcp.js:39
msgid "Server"
msgstr "服务器"
#: luci-app-glorytun-tcp/htdocs/luci-static/resources/view/services/glorytun-tcp.js:72
msgid "Timeout"
msgstr "超时"
#: luci-app-glorytun-tcp/htdocs/luci-static/resources/view/services/glorytun-tcp.js:68
msgid "chacha"
msgstr "chacha密码"

View file

@ -0,0 +1,13 @@
{
"admin/vpn/glorytun-tcp": {
"title": "Glorytun TCP",
"order": 60,
"action": {
"type": "view",
"path": "services/glorytun-tcp"
},
"depends": {
"acl": [ "luci-app-glorytun-tcp" ]
}
}
}

View file

@ -1,6 +1,6 @@
{
"luci-app-glorytun": {
"description": "Grant UCI access for luci-app-glorytun",
"luci-app-glorytun-tcp": {
"description": "Grant access to glorytun TCP",
"read": {
"uci": [ "glorytun" ]
},

View file

@ -0,0 +1,16 @@
#
# Copyright (C) 2018-2020 Ycarus (Yannick Chabanois) <ycarus@zugaina.org>
#
#
include $(TOPDIR)/rules.mk
LUCI_TITLE:=LuCI Interface to Glorytun UDP
LUCI_DEPENDS:=+glorytun-udp
PKG_LICENSE:=GPLv3
#include ../luci/luci.mk
include $(TOPDIR)/feeds/luci/luci.mk
# call BuildPackage - OpenWrt buildroot signature

View file

@ -0,0 +1,105 @@
'use strict';
'require rpc';
'require poll';
'require form';
'require fs';
'require uci';
'require tools.widgets as widgets';
var callHostHints;
var callServiceList = rpc.declare({
object: 'service',
method: 'list',
params: [ 'name' ],
expect: { '': {} }
});
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('glorytun-udp', _('Glorytun UDP'));
s = m.section(form.GridSection, 'glorytun-udp', _('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.Value, 'label', _('Label'));
o.rmempty = true;
o = s.taboption('general', form.ListValue, 'mode', _('Mode'));
o.value('to',_('Client'));
o.value('from',_('Server'));
o.modalonly = true;
o = s.taboption('general', form.Value, 'host', _('Host'));
o.rmempty = false;
o = s.taboption('general', form.Value, 'port', _('Port'));
o.rmempty = false;
o = s.taboption('general', form.Value, 'key', _('Key'));
o.rmempty = false;
o.modalonly = true;
o = s.taboption('general', form.Value, 'dev', _('Interface name'));
o.rmempty = false;
o.modalonly = true;
o = s.taboption('general', form.Value, 'localip', _('Local IP'));
o.datatype = 'or(ip4addr,ip6addr)';
o.rmempty = false;
o = s.taboption('general', form.Value, 'remoteip', _('Remote IP'));
o.datatype = 'or(ip4addr,ip6addr)';
o.rmempty = false;
o = s.taboption('advanced', form.Flag, 'persist', _('Persist'), _('Keep the tunnel device after exiting'));
o.default = o.enabled;
o.modalonly = true;
o = s.taboption('advanced', form.Flag, 'chacha', _('chacha'), _('Force fallback cipher'));
o.default = o.enabled;
o.modalonly = true;
o = s.taboption('advanced', form.Value, 'kxtimeout', _('Key rotation timeout'));
o.default = '7d';
o.rmempty = false;
o.modalonly = true;
o = s.taboption('advanced', form.Value, 'timetolerance', _('Clock sync tolerance'));
o.default = '10m';
o.rmempty = false;
o.modalonly = true;
o = s.taboption('advanced', form.Value, 'keepalive', _('Keep alive timeout'));
o.default = '25s';
o.rmempty = false;
o.modalonly = true;
o = s.taboption('advanced', form.Flag, 'auto', _('Dynamic rate detection'));
o.rmempty = false;
o.modalonly = true;
return m.render();
}
});

View file

@ -0,0 +1,108 @@
msgid ""
msgstr ""
"PO-Revision-Date: 2020-12-15 14:46+0000\n"
"Last-Translator: Weblate Admin <contact@openmptcprouter.com>\n"
"Language-Team: French <http://weblate.openmptcprouter.com/projects/omr/"
"luciapplicationsglorytun-udp/fr/>\n"
"Language: fr\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"
#: luci-app-glorytun-udp/htdocs/luci-static/resources/view/services/glorytun-udp.js:40
msgid "Advanced Settings"
msgstr "Configuration avancée"
#: luci-app-glorytun-udp/htdocs/luci-static/resources/view/services/glorytun-udp.js:46
msgid "Client"
msgstr "Client"
#: luci-app-glorytun-udp/htdocs/luci-static/resources/view/services/glorytun-udp.js:85
msgid "Clock sync tolerance"
msgstr "Tolérance de synchronisation d'horloge"
#: luci-app-glorytun-udp/htdocs/luci-static/resources/view/services/glorytun-udp.js:95
msgid "Dynamic rate detection"
msgstr "Détection dynamique de la vitesse"
#: luci-app-glorytun-udp/htdocs/luci-static/resources/view/services/glorytun-udp.js:42
msgid "Enabled"
msgstr "Activer"
#: luci-app-glorytun-udp/htdocs/luci-static/resources/view/services/glorytun-udp.js:76
msgid "Force fallback cipher"
msgstr "Forcer le chiffrement de secours"
#: luci-app-glorytun-udp/htdocs/luci-static/resources/view/services/glorytun-udp.js:39
msgid "General Settings"
msgstr "Paramètres généraux"
#: luci-app-glorytun-udp/htdocs/luci-static/resources/view/services/glorytun-udp.js:32
#: luci-app-glorytun-udp/root/usr/share/luci/menu.d/luci-app-glorytun-udp.json:3
msgid "Glorytun UDP"
msgstr "Glorytun UDP"
#: luci-app-glorytun-udp/root/usr/share/rpcd/acl.d/luci-app-glorytun-udp.json:3
msgid "Grant access to glorytun UDP"
msgstr "Accorder l'accès à Glorytun UDP"
#: luci-app-glorytun-udp/htdocs/luci-static/resources/view/services/glorytun-udp.js:50
msgid "Host"
msgstr "Hôte"
#: luci-app-glorytun-udp/htdocs/luci-static/resources/view/services/glorytun-udp.js:34
msgid "Instances"
msgstr "Instances"
#: luci-app-glorytun-udp/htdocs/luci-static/resources/view/services/glorytun-udp.js:60
msgid "Interface name"
msgstr "Nom de l'interface"
#: luci-app-glorytun-udp/htdocs/luci-static/resources/view/services/glorytun-udp.js:90
msgid "Keep alive timeout"
msgstr "Délai de maintien de la connexion (Keep Alive)"
#: luci-app-glorytun-udp/htdocs/luci-static/resources/view/services/glorytun-udp.js:72
msgid "Keep the tunnel device after exiting"
msgstr "Gardez le périphérique tunnel après avoir quitté"
#: luci-app-glorytun-udp/htdocs/luci-static/resources/view/services/glorytun-udp.js:56
msgid "Key"
msgstr "Clef"
#: luci-app-glorytun-udp/htdocs/luci-static/resources/view/services/glorytun-udp.js:80
msgid "Key rotation timeout"
msgstr "Délai de rotation des clés"
#: luci-app-glorytun-udp/htdocs/luci-static/resources/view/services/glorytun-udp.js:99
msgid "Label"
msgstr "Étiquette"
#: luci-app-glorytun-udp/htdocs/luci-static/resources/view/services/glorytun-udp.js:64
msgid "Local IP"
msgstr "Adresse IP locale"
#: luci-app-glorytun-udp/htdocs/luci-static/resources/view/services/glorytun-udp.js:45
msgid "Mode"
msgstr "Mode"
#: luci-app-glorytun-udp/htdocs/luci-static/resources/view/services/glorytun-udp.js:72
msgid "Persist"
msgstr "Persister"
#: luci-app-glorytun-udp/htdocs/luci-static/resources/view/services/glorytun-udp.js:53
msgid "Port"
msgstr "Port"
#: luci-app-glorytun-udp/htdocs/luci-static/resources/view/services/glorytun-udp.js:68
msgid "Remote IP"
msgstr "IP Distante"
#: luci-app-glorytun-udp/htdocs/luci-static/resources/view/services/glorytun-udp.js:47
msgid "Server"
msgstr "Serveur"
#: luci-app-glorytun-udp/htdocs/luci-static/resources/view/services/glorytun-udp.js:76
msgid "chacha"
msgstr "Chacha"

View file

@ -0,0 +1,99 @@
msgid ""
msgstr "Content-Type: text/plain; charset=UTF-8"
#: luci-app-glorytun-udp/htdocs/luci-static/resources/view/services/glorytun-udp.js:40
msgid "Advanced Settings"
msgstr ""
#: luci-app-glorytun-udp/htdocs/luci-static/resources/view/services/glorytun-udp.js:46
msgid "Client"
msgstr ""
#: luci-app-glorytun-udp/htdocs/luci-static/resources/view/services/glorytun-udp.js:85
msgid "Clock sync tolerance"
msgstr ""
#: luci-app-glorytun-udp/htdocs/luci-static/resources/view/services/glorytun-udp.js:95
msgid "Dynamic rate detection"
msgstr ""
#: luci-app-glorytun-udp/htdocs/luci-static/resources/view/services/glorytun-udp.js:42
msgid "Enabled"
msgstr ""
#: luci-app-glorytun-udp/htdocs/luci-static/resources/view/services/glorytun-udp.js:76
msgid "Force fallback cipher"
msgstr ""
#: luci-app-glorytun-udp/htdocs/luci-static/resources/view/services/glorytun-udp.js:39
msgid "General Settings"
msgstr ""
#: luci-app-glorytun-udp/htdocs/luci-static/resources/view/services/glorytun-udp.js:32
#: luci-app-glorytun-udp/root/usr/share/luci/menu.d/luci-app-glorytun-udp.json:3
msgid "Glorytun UDP"
msgstr ""
#: luci-app-glorytun-udp/root/usr/share/rpcd/acl.d/luci-app-glorytun-udp.json:3
msgid "Grant access to glorytun UDP"
msgstr ""
#: luci-app-glorytun-udp/htdocs/luci-static/resources/view/services/glorytun-udp.js:50
msgid "Host"
msgstr ""
#: luci-app-glorytun-udp/htdocs/luci-static/resources/view/services/glorytun-udp.js:34
msgid "Instances"
msgstr ""
#: luci-app-glorytun-udp/htdocs/luci-static/resources/view/services/glorytun-udp.js:60
msgid "Interface name"
msgstr ""
#: luci-app-glorytun-udp/htdocs/luci-static/resources/view/services/glorytun-udp.js:90
msgid "Keep alive timeout"
msgstr ""
#: luci-app-glorytun-udp/htdocs/luci-static/resources/view/services/glorytun-udp.js:72
msgid "Keep the tunnel device after exiting"
msgstr ""
#: luci-app-glorytun-udp/htdocs/luci-static/resources/view/services/glorytun-udp.js:56
msgid "Key"
msgstr ""
#: luci-app-glorytun-udp/htdocs/luci-static/resources/view/services/glorytun-udp.js:80
msgid "Key rotation timeout"
msgstr ""
#: luci-app-glorytun-udp/htdocs/luci-static/resources/view/services/glorytun-udp.js:99
msgid "Label"
msgstr ""
#: luci-app-glorytun-udp/htdocs/luci-static/resources/view/services/glorytun-udp.js:64
msgid "Local IP"
msgstr ""
#: luci-app-glorytun-udp/htdocs/luci-static/resources/view/services/glorytun-udp.js:45
msgid "Mode"
msgstr ""
#: luci-app-glorytun-udp/htdocs/luci-static/resources/view/services/glorytun-udp.js:72
msgid "Persist"
msgstr ""
#: luci-app-glorytun-udp/htdocs/luci-static/resources/view/services/glorytun-udp.js:53
msgid "Port"
msgstr ""
#: luci-app-glorytun-udp/htdocs/luci-static/resources/view/services/glorytun-udp.js:68
msgid "Remote IP"
msgstr ""
#: luci-app-glorytun-udp/htdocs/luci-static/resources/view/services/glorytun-udp.js:47
msgid "Server"
msgstr ""
#: luci-app-glorytun-udp/htdocs/luci-static/resources/view/services/glorytun-udp.js:76
msgid "chacha"
msgstr ""

View file

@ -0,0 +1,108 @@
msgid ""
msgstr ""
"PO-Revision-Date: 2020-12-04 16:03+0000\n"
"Last-Translator: antrouter <xinyangla@188.com>\n"
"Language-Team: Chinese (Simplified) <http://weblate.openmptcprouter.com/"
"projects/omr/luciapplicationsglorytun-udp/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"
#: luci-app-glorytun-udp/htdocs/luci-static/resources/view/services/glorytun-udp.js:40
msgid "Advanced Settings"
msgstr "高级设置"
#: luci-app-glorytun-udp/htdocs/luci-static/resources/view/services/glorytun-udp.js:46
msgid "Client"
msgstr "客户端"
#: luci-app-glorytun-udp/htdocs/luci-static/resources/view/services/glorytun-udp.js:85
msgid "Clock sync tolerance"
msgstr "时钟同步容限"
#: luci-app-glorytun-udp/htdocs/luci-static/resources/view/services/glorytun-udp.js:95
msgid "Dynamic rate detection"
msgstr "动态速率检测"
#: luci-app-glorytun-udp/htdocs/luci-static/resources/view/services/glorytun-udp.js:42
msgid "Enabled"
msgstr "开启"
#: luci-app-glorytun-udp/htdocs/luci-static/resources/view/services/glorytun-udp.js:76
msgid "Force fallback cipher"
msgstr "强制回退密码"
#: luci-app-glorytun-udp/htdocs/luci-static/resources/view/services/glorytun-udp.js:39
msgid "General Settings"
msgstr "通用设置"
#: luci-app-glorytun-udp/htdocs/luci-static/resources/view/services/glorytun-udp.js:32
#: luci-app-glorytun-udp/root/usr/share/luci/menu.d/luci-app-glorytun-udp.json:3
msgid "Glorytun UDP"
msgstr "glorytun UDP"
#: luci-app-glorytun-udp/root/usr/share/rpcd/acl.d/luci-app-glorytun-udp.json:3
msgid "Grant access to glorytun UDP"
msgstr "授予访问glorytun UDP的权限"
#: luci-app-glorytun-udp/htdocs/luci-static/resources/view/services/glorytun-udp.js:50
msgid "Host"
msgstr "主机"
#: luci-app-glorytun-udp/htdocs/luci-static/resources/view/services/glorytun-udp.js:34
msgid "Instances"
msgstr "实例"
#: luci-app-glorytun-udp/htdocs/luci-static/resources/view/services/glorytun-udp.js:60
msgid "Interface name"
msgstr "接口名称"
#: luci-app-glorytun-udp/htdocs/luci-static/resources/view/services/glorytun-udp.js:90
msgid "Keep alive timeout"
msgstr "保持超时"
#: luci-app-glorytun-udp/htdocs/luci-static/resources/view/services/glorytun-udp.js:72
msgid "Keep the tunnel device after exiting"
msgstr "退出后保留隧道设备"
#: luci-app-glorytun-udp/htdocs/luci-static/resources/view/services/glorytun-udp.js:56
msgid "Key"
msgstr "秘钥"
#: luci-app-glorytun-udp/htdocs/luci-static/resources/view/services/glorytun-udp.js:80
msgid "Key rotation timeout"
msgstr "秘钥轮换超时"
#: luci-app-glorytun-udp/htdocs/luci-static/resources/view/services/glorytun-udp.js:99
msgid "Label"
msgstr "标签"
#: luci-app-glorytun-udp/htdocs/luci-static/resources/view/services/glorytun-udp.js:64
msgid "Local IP"
msgstr "本地IP"
#: luci-app-glorytun-udp/htdocs/luci-static/resources/view/services/glorytun-udp.js:45
msgid "Mode"
msgstr "模式"
#: luci-app-glorytun-udp/htdocs/luci-static/resources/view/services/glorytun-udp.js:72
msgid "Persist"
msgstr "保持"
#: luci-app-glorytun-udp/htdocs/luci-static/resources/view/services/glorytun-udp.js:53
msgid "Port"
msgstr "端口"
#: luci-app-glorytun-udp/htdocs/luci-static/resources/view/services/glorytun-udp.js:68
msgid "Remote IP"
msgstr "远程IP"
#: luci-app-glorytun-udp/htdocs/luci-static/resources/view/services/glorytun-udp.js:47
msgid "Server"
msgstr "服务器"
#: luci-app-glorytun-udp/htdocs/luci-static/resources/view/services/glorytun-udp.js:76
msgid "chacha"
msgstr "chacha密码"

View file

@ -0,0 +1,10 @@
config glorytun-udp 'vpn'
option enable '0'
option host '127.0.0.1'
option port '65001'
option dev 'tun0'
option key ''
option chacha '1'
option localip '10.255.254.2'
option remoteip '10.255.254.1'
option mode 'to'

View file

@ -0,0 +1,35 @@
#!/bin/sh
#
# Load the glorytun config
#
# Author: Ycarus (Yannick Chabanois) <ycarus@zugaina.org>
# Released under GPL 3 or later
[ "$ACTION" = ifup -o "$ACTION" = ifupdate ] || exit 0
. /lib/functions.sh
. /lib/functions/network.sh
set_default() {
local localip
local remoteip
local config="$1"
local iface
config_get enable "$config" enable
config_get iface "$config" dev
[ "$iface" = "$DEVICE" ] && [ "$enable" = "1" ] && {
config_get localip "$config" localip
config_get remoteip "$config" remoteip
config_get kxtimeout "$config" kxtimeout "7d"
config_get timetolerance "$config" timetolerance "10m"
config_get keepalive "$config" keepalive "25s"
[ "$remoteip" != "" ] && [ "$localip" != "" ] && ifconfig $DEVICE $localip pointopoint $remoteip up
while [ -z "$(glorytun-udp list | grep $iface)" ]; do
sleep 1
done
glorytun-udp set dev $iface kxtimeout $kxtimeout timetolerance $timetolerance keepalive $keepalive
}
}
config_load glorytun-udp
config_foreach set_default glorytun-udp

View file

@ -0,0 +1,47 @@
#!/bin/sh
uci -q batch <<-EOF >/dev/null
delete glorytun-udp[-1]
add ucitrack glorytun-udp
set ucitrack.@glorytun-udp[-1].init=glorytun-udp
commit ucitrack
EOF
if [ "$(uci -q get network.glorytun-udp)" = "" ] && [ "$(uci -q get network.omrvpn)" = "" ]; then
uci -q batch <<-EOF >/dev/null
delete network.glorytun-udp
set network.glorytun-udp=interface
set network.glorytun-udp.ifname=tun0
set network.glorytun-udp.proto=dhcp
set network.glorytun-udp.ip4table=vpn
set network.glorytun-udp.multipath=off
set network.glorytun-udp.leasetime=12h
commit network
EOF
fi
if [ "$(uci -q show firewall | grep glorytun-udp)" = "" ] && [ "$(uci -q get network.omrvpn)" = "" ]; then
uci -q batch <<-EOF >/dev/null
set firewall.zone_vpn=zone
set firewall.zone_vpn.name=vpn
set firewall.zone_vpn.network=glorytun-udp
set firewall.zone_vpn.masq=1
set firewall.zone_vpn.input=REJECT
set firewall.zone_vpn.forward=ACCEPT
set firewall.zone_vpn.output=ACCEPT
commit firewall
EOF
fi
if [ "$(uci -q show firewall | grep Allow-All-LAN-to-VPN)" = "" ]; then
uci -q batch <<-EOF >/dev/null
add firewall rule
set firewall.@rule[-1].enabled='1'
set firewall.@rule[-1].target='ACCEPT'
set firewall.@rule[-1].name='Allow-All-LAN-to-VPN'
set firewall.@rule[-1].dest='vpn'
set firewall.@rule[-1].src='lan'
commit firewall
EOF
fi
rm -f /tmp/luci-indexcache
exit 0

View file

@ -0,0 +1,13 @@
{
"admin/vpn/glorytun-udp": {
"title": "Glorytun UDP",
"order": 60,
"action": {
"type": "view",
"path": "services/glorytun-udp"
},
"depends": {
"acl": [ "luci-app-glorytun-udp" ]
}
}
}

View file

@ -0,0 +1,11 @@
{
"luci-app-glorytun-udp": {
"description": "Grant access to glorytun UDP",
"read": {
"uci": [ "glorytun-udp" ]
},
"write": {
"uci": [ "glorytun-udp" ]
}
}
}

View file

@ -1,21 +0,0 @@
#
# Copyright (C) 2008-2014 The LuCI Team <luci@lists.subsignal.org>
# Copyright (C) 2017-2019 Ycarus (Yannick Chabanois) <ycarus@zugaina.org>
#
# This is based on OpenVPN LuCI Support.
# This is free software, licensed under the Apache License, Version 2.0 .
#
include $(TOPDIR)/rules.mk
LUCI_TITLE:=LuCI Support for Glorytun
LUCI_DEPENDS:=+glorytun +glorytun-udp
LUCI_PKGARCH:=all
PKG_LICENSE:=GPLv2
PKG_MAINTAINER:=Ycarus (Yannick Chabanois) <ycarus@zugaina.org>
#include ../luci/luci.mk
include $(TOPDIR)/feeds/luci/luci.mk
# call BuildPackage - OpenWrt buildroot signature

View file

@ -1,14 +0,0 @@
-- Copyright 2018 - 2019 Ycarus (Yannick Chabanois) <ycarus@zugaina.org>
-- Licensed to the public under the Apache License 2.0.
module("luci.controller.glorytun", package.seeall)
function index()
if not nixio.fs.access("/etc/config/glorytun") then
return
end
--entry({"admin", "services", "glorytun"}, cbi("glorytun"), _("Glorytun") )
--entry({"admin", "services", "glorytun", "settings"}, cbi("glorytun-settings"), nil ).leaf = true
entry({"admin", "vpn", "glorytun"}, cbi("glorytun"), _("Glorytun") )
entry({"admin", "vpn", "glorytun", "settings"}, cbi("glorytun-settings"), nil ).leaf = true
end

View file

@ -1,83 +0,0 @@
-- Copyright 2018 Ycarus (Yannick Chabanois) <ycarus@zugaina.org>
-- Copyright 2008 Steven Barth <steven@midlink.org>
-- Licensed to the public under the Apache License 2.0.
require("luci.ip")
require("luci.model.uci")
local basicParams = {
--
-- Widget, Name, Default(s), Description
--
{ Flag,"enable",0, translate("Enable") },
{ Value,"port",65001, translate("TCP port # for both local and remote") },
{ Value,"dev","tun0", translate("Interface name") },
{ Value,"host","vpnserver.example.org", translate("Remote host name or ip address") },
{ Value,"localip","192.168.99.2", translate("Local tunnel ip address") },
{ Value,"remoteip","192.168.99.1", translate("Remote tunnel ip address") },
{ Value,"key","secretkey", translate("The secret key") },
{ ListValue,"proto",{ "tcp", "udp" }, translate("Protocol") },
{ Flag,"listener",0, translate("Server mode") },
{ Value,"bind","", translate("Bind address") },
--{ Value,"bind-backup","", translate("Bind backup") },
{ Value,"bindport",65002, translate("Bind port") },
{ Value,"mtu",1500, translate("MTU") },
{ Flag,"mtuauto",0, translate("MTU auto") },
{ Flag,"mptcp",0, translate("MPTCP") },
{ Flag,"chacha20",0, translate("Use ChaCha20 stream cipher") }
}
local m = Map("glorytun")
local p = m:section( SimpleSection )
p.template = "glorytun/pageswitch"
p.mode = "settings"
p.instance = arg[1]
local s = m:section( NamedSection, arg[1], "glorytun" )
for _, option in ipairs(basicParams) do
local o = s:option(
option[1], option[2],
option[2], option[4]
)
o.optional = true
if option[1] == DummyValue then
o.value = option[3]
else
if option[1] == DynamicList then
function o.cfgvalue(...)
local val = AbstractValue.cfgvalue(...)
return ( val and type(val) ~= "table" ) and { val } or val
end
end
if type(option[3]) == "table" then
if o.optional then o:value("", "-- remove --") end
for _, v in ipairs(option[3]) do
v = tostring(v)
o:value(v)
end
o.default = tostring(option[3][1])
else
o.default = tostring(option[3])
end
end
for i=5,#option do
if type(option[i]) == "table" then
o:depends(option[i])
end
end
end
return m

View file

@ -1,147 +0,0 @@
-- Copyright 2018 Ycarus (Yannick Chabanois) <ycarus@zugaina.org>
-- Copyright 2008 Steven Barth <steven@midlink.org>
-- Licensed to the public under the Apache License 2.0.
local fs = require "nixio.fs"
local sys = require "luci.sys"
local uci = require "luci.model.uci".cursor()
local testfullps = luci.sys.exec("ps --help 2>&1 | grep BusyBox") --check which ps do we have
local psstring = (string.len(testfullps)>0) and "ps w" or "ps axfw" --set command we use to get pid
local m = Map("glorytun", translate("Glorytun"))
local s = m:section( TypedSection, "glorytun", translate("Glorytun instances"), translate("Below is a list of configured Glorytun instances and their current state") )
s.template = "cbi/tblsection"
s.template_addremove = "glorytun/cbi-select-input-add"
s.addremove = true
s.add_select_options = { }
s.add_select_options[''] = ''
s.extedit = luci.dispatcher.build_url(
"admin", "vpn", "glorytun", "settings", "%s"
)
uci:load("glorytun_recipes")
uci:foreach( "glorytun_recipes", "glorytun_recipe",
function(section)
s.add_select_options[section['.name']] =
section['_description'] or section['.name']
end
)
function s.getPID(section) -- Universal function which returns valid pid # or nil
local pid = sys.exec("%s | grep -w %s | grep glorytun | grep -v grep | awk '{print $1}'" % { psstring,section} )
if pid and #pid > 0 and tonumber(pid) ~= nil then
return tonumber(pid)
else
return nil
end
end
function s.parse(self, section)
local recipe = luci.http.formvalue(
luci.cbi.CREATE_PREFIX .. self.config .. "." ..
self.sectiontype .. ".select"
)
if recipe and not s.add_select_options[recipe] then
self.invalid_cts = true
else
TypedSection.parse( self, section )
end
end
function s.create(self, name)
local recipe = luci.http.formvalue(
luci.cbi.CREATE_PREFIX .. self.config .. "." ..
self.sectiontype .. ".select"
)
name = luci.http.formvalue(
luci.cbi.CREATE_PREFIX .. self.config .. "." ..
self.sectiontype .. ".text"
)
if #name > 3 and not name:match("[^a-zA-Z0-9_]") then
--uci:section(
-- "glorytun", "glorytun", name,
-- uci:get_all( "glorytun_recipes", recipe )
--)
local recipe_data = uci:get_all( "glorytun_recipes", recipe )
uci:set("glorytun", name,"glorytun")
local k, v
for k, v in pairs(recipe_data) do
uci:set("glorytun", name, k,v)
end
uci:delete("glorytun", name, "_role")
uci:delete("glorytun", name, "_description")
uci:commit("glorytun")
uci:save("glorytun")
luci.http.redirect( self.extedit:format(name) )
elseif #name > 0 then
self.invalid_cts = true
end
return 0
end
s:option( Flag, "enable", translate("Enabled") )
local active = s:option( DummyValue, "_active", translate("Started") )
function active.cfgvalue(self, section)
local pid = s.getPID(section)
if pid ~= nil then
return (sys.process.signal(pid, 0))
and translatef("yes (%i)", pid)
or translate("no")
end
return translate("no")
end
local updown = s:option( Button, "_updown", translate("Start/Stop") )
updown._state = false
updown.redirect = luci.dispatcher.build_url(
"admin", "vpn", "glorytun"
)
function updown.cbid(self, section)
local pid = s.getPID(section)
self._state = pid ~= nil and sys.process.signal(pid, 0)
self.option = self._state and "stop" or "start"
return AbstractValue.cbid(self, section)
end
function updown.cfgvalue(self, section)
self.title = self._state and "stop" or "start"
self.inputstyle = self._state and "reset" or "reload"
end
local port = s:option( DummyValue, "port", translate("Port") )
function port.cfgvalue(self, section)
local val = AbstractValue.cfgvalue(self, section)
return val or "65001"
end
local dev = s:option( DummyValue, "dev", translate("Interface") )
function dev.cfgvalue(self, section)
local val = AbstractValue.cfgvalue(self, section)
return val or "tun"
end
local proto = s:option( DummyValue, "proto", translate("Protocol") )
function proto.cfgvalue(self, section)
local val = AbstractValue.cfgvalue(self, section)
return val or "tcp"
end
function updown.write(self, section, value)
if self.option == "stop" then
local pid = s.getPID(section)
if pid ~= nil then
sys.process.signal(pid,15)
end
else
local type = proto.cfgvalue(self,section)
luci.sys.call("/etc/init.d/glorytun-udp start %s" % section)
luci.sys.call("/etc/init.d/glorytun start %s" % section)
end
luci.http.redirect( self.redirect )
end
return m

View file

@ -1,11 +0,0 @@
<div class="cbi-section-create">
<% if self.invalid_cts then -%><div class="cbi-section-error"><% end %>
<input type="text" class="cbi-section-create-name" name="cbi.cts.<%=self.config%>.<%=self.sectiontype%>.text" />
<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,13 +0,0 @@
<%#
Copyright 2018 Ycarus (Yannick Chabanois) <ycarus@zugaina.org>
Copyright 2008 Steven Barth <steven@midlink.org>
Copyright 2008 Jo-Philipp Wich <jow@openwrt.org>
Licensed to the public under the Apache License 2.0.
-%>
<fieldset class="cbi-section">
<legend>
<a href="<%=url('admin/vpn/glorytun')%>"><%:Overview%></a> &raquo;
<%=luci.i18n.translatef("Instance \"%s\"", self.instance)%>
</legend>
</fieldset>

View file

@ -1,104 +0,0 @@
msgid ""
msgstr ""
"PO-Revision-Date: 2020-10-05 12:39+0000\n"
"Last-Translator: Anonymous <noreply@weblate.org>\n"
"Language-Team: German <http://weblate.openmptcprouter.com/projects/omr/"
"luciapplicationsglorytun/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 ""
"Below is a list of configured Glorytun instances and their current state"
msgstr ""
"Nachfolgend eine Liste der konfigurierten Glorytun-Instanzen und ihre "
"aktuelle Status."
msgid "Bind address"
msgstr "Bindungsadresse"
msgid "Bind backup"
msgstr "Alternative Bindungsadresse"
msgid "Bind port"
msgstr "Verbindungs-Port"
msgid "Enable"
msgstr "Aktivieren"
msgid "Enabled"
msgstr "Aktiv"
msgid "Glorytun"
msgstr "Glorytun"
msgid "Glorytun instances"
msgstr "Glorytun-Instanzen"
msgid "Instance \"%s\""
msgstr "Instanz '%s'"
msgid "Interface"
msgstr "Schnittstelle"
msgid "Interface name"
msgstr "Name der Verbindung"
msgid "Invalid"
msgstr "Ungültig"
msgid "Local tunnel ip address"
msgstr "IP-Adresse des lokalen Tunnels"
msgid "MPTCP"
msgstr "MPTCP"
msgid "MTU"
msgstr "MTU"
msgid "MTU auto"
msgstr "automatische MTU"
msgid "Overview"
msgstr "Übersicht"
msgid "Port"
msgstr "Port"
msgid "Protocol"
msgstr "Protokoll"
msgid "Remote host name or ip address"
msgstr "FQDN oder IP-Adresse der Gegenstelle"
msgid "Remote tunnel ip address"
msgstr "Tunnel-IP-Adresse der Gegenstelle"
msgid "Server mode"
msgstr "Server-Modus"
msgid "Start/Stop"
msgstr "Start/Stop"
msgid "Started"
msgstr "gestartet"
msgid "TCP port # for both local and remote"
msgstr "TCP-Port Nummer lokal und gegenüber"
msgid "The secret key"
msgstr "geheimer Schlüssel"
msgid "Use ChaCha20 stream cipher"
msgstr "Stromverschlüsselung 'ChaCha20' nutzen"
msgid "no"
msgstr "nein"
msgid "yes (%i)"
msgstr "ja (%i)"

View file

@ -1,104 +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/"
"luciapplicationsglorytun/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 "Below is a list of configured Glorytun instances and their current state"
msgstr "Ci-dessous une liste des instances Glorytun configurées et leur état actuel"
msgid "Bind address"
msgstr "Adresse mappée"
msgid "Bind backup"
msgstr "Lier la sauvegarde"
msgid "Bind port"
msgstr "Port de connexion"
msgid "Enable"
msgstr "Activer"
msgid "Enabled"
msgstr "Activer"
msgid "Glorytun"
msgstr "Glorytun"
msgid "Glorytun instances"
msgstr "Instances de Glorytun"
msgid "Instance \"%s\""
msgstr "Instance \"%s\""
msgid "Interface"
msgstr "Interface"
msgid "Interface name"
msgstr "Nom de l'interface"
msgid "Invalid"
msgstr "Invalide"
msgid "Local tunnel ip address"
msgstr "Adresse IP locale du tunnel"
msgid "MPTCP"
msgstr "MPTCP"
msgid "MTU"
msgstr "MTU"
msgid "MTU auto"
msgstr "MTU auto"
msgid "Overview"
msgstr "Aperçu"
msgid "Port"
msgstr "Port"
msgid "Protocol"
msgstr "Protocole"
msgid "Remote host name or ip address"
msgstr "Nom de l'hôte distant ou adresse IP"
msgid "Remote tunnel ip address"
msgstr "Adresse IP distance du tunnel"
msgid "Server mode"
msgstr "Mode serveur"
msgid "Start/Stop"
msgstr "Marche/Arrêt"
msgid "Started"
msgstr "Démarré"
msgid "TCP port # for both local and remote"
msgstr "Port TCP local et distant"
msgid "The secret key"
msgstr "La clef secréte"
msgid "Use ChaCha20 stream cipher"
msgstr "Utiliser le chiffrement ChaCha20"
msgid "no"
msgstr "non"
msgid "yes (%i)"
msgstr "oui (%i)"

View file

@ -1,104 +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/"
"luciapplicationsglorytun/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 ""
"Below is a list of configured Glorytun instances and their current state"
msgstr ""
"Di seguito è riportato un elenco di istanze Glorytun configurate e il loro "
"stato corrente"
msgid "Bind address"
msgstr "Associa indirizzo"
msgid "Bind backup"
msgstr "Bind backup"
msgid "Bind port"
msgstr "Bind port"
msgid "Enable"
msgstr "Attivare"
msgid "Enabled"
msgstr "Abilitato"
msgid "Glorytun"
msgstr "Glorytun"
msgid "Glorytun instances"
msgstr "Istanze di Glorytun"
msgid "Instance \"%s\""
msgstr "Istanza \"%s\""
msgid "Interface"
msgstr "Interfaccia"
msgid "Interface name"
msgstr "Nome interfaccia"
msgid "Invalid"
msgstr "Non valido"
msgid "Local tunnel ip address"
msgstr "Indirizzo IP del tunnel locale"
msgid "MPTCP"
msgstr "MPTCP"
msgid "MTU"
msgstr "MTU"
msgid "MTU auto"
msgstr "MTU auto"
msgid "Overview"
msgstr "Panoramica"
msgid "Port"
msgstr "Porta"
msgid "Protocol"
msgstr "Protocollo"
msgid "Remote host name or ip address"
msgstr "Nome host remoto o indirizzo IP"
msgid "Remote tunnel ip address"
msgstr "Indirizzo IP del tunnel remoto"
msgid "Server mode"
msgstr "Modalità server"
msgid "Start/Stop"
msgstr "Marcia/arresto"
msgid "Started"
msgstr "Iniziato"
msgid "TCP port # for both local and remote"
msgstr "Porta TCP # sia per locale che per remoto"
msgid "The secret key"
msgstr "Chiave segreta"
msgid "Use ChaCha20 stream cipher"
msgstr "Usa il cifrario a flusso ChaCha20"
msgid "no"
msgstr "no"
msgid "yes (%i)"
msgstr "Sì (%i)"

View file

@ -1,103 +0,0 @@
msgid ""
msgstr ""
"PO-Revision-Date: 2020-10-13 07:30+0000\n"
"Last-Translator: Quentin PAGÈS <githubou@quentino.fr>\n"
"Language-Team: Occitan <http://weblate.openmptcprouter.com/projects/omr/"
"luciapplicationsglorytun/oc/>\n"
"Language: oc\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 "Ajustar"
msgid ""
"Below is a list of configured Glorytun instances and their current state"
msgstr ""
"Çai-jos una lista de las instàncias Glorytun configuradas e lor estat actual"
msgid "Bind address"
msgstr "Adreça mapada"
msgid "Bind backup"
msgstr "Associar la salvagarda"
msgid "Bind port"
msgstr "Pòrt de connexion"
msgid "Enable"
msgstr "Activat"
msgid "Enabled"
msgstr "Activat"
msgid "Glorytun"
msgstr "Glorytun"
msgid "Glorytun instances"
msgstr "Instàncias Glorytun"
msgid "Instance \"%s\""
msgstr "Instància « %s»"
msgid "Interface"
msgstr "Interfàcia"
msgid "Interface name"
msgstr "Nom de linterfàcia"
msgid "Invalid"
msgstr "Invalid"
msgid "Local tunnel ip address"
msgstr "Adreça IP locala del tunèl"
msgid "MPTCP"
msgstr "MPTCP"
msgid "MTU"
msgstr "MTU"
msgid "MTU auto"
msgstr "MTU auto"
msgid "Overview"
msgstr "Apercebut"
msgid "Port"
msgstr "Pòrt"
msgid "Protocol"
msgstr "Protocòl"
msgid "Remote host name or ip address"
msgstr "Nom de lòste alonhat o adreça IP"
msgid "Remote tunnel ip address"
msgstr "Adreça IP alonhada del tunèl"
msgid "Server mode"
msgstr "Mòde servidor"
msgid "Start/Stop"
msgstr "Aviar/Arrestar"
msgid "Started"
msgstr "Aviat"
msgid "TCP port # for both local and remote"
msgstr "Pòrt TCP local e alonhat"
msgid "The secret key"
msgstr "La clau secrèta"
msgid "Use ChaCha20 stream cipher"
msgstr "Utilizar lo chiframent ChaCha20"
msgid "no"
msgstr "non"
msgid "yes (%i)"
msgstr "òc (%i)"

View file

@ -1,93 +0,0 @@
msgid ""
msgstr "Content-Type: text/plain; charset=UTF-8"
msgid "Add"
msgstr ""
msgid ""
"Below is a list of configured Glorytun instances and their current state"
msgstr ""
msgid "Bind address"
msgstr ""
msgid "Bind backup"
msgstr ""
msgid "Bind port"
msgstr ""
msgid "Enable"
msgstr ""
msgid "Enabled"
msgstr ""
msgid "Glorytun"
msgstr ""
msgid "Glorytun instances"
msgstr ""
msgid "Instance \"%s\""
msgstr ""
msgid "Interface"
msgstr ""
msgid "Interface name"
msgstr ""
msgid "Invalid"
msgstr ""
msgid "Local tunnel ip address"
msgstr ""
msgid "MPTCP"
msgstr ""
msgid "MTU"
msgstr ""
msgid "MTU auto"
msgstr ""
msgid "Overview"
msgstr ""
msgid "Port"
msgstr ""
msgid "Protocol"
msgstr ""
msgid "Remote host name or ip address"
msgstr ""
msgid "Remote tunnel ip address"
msgstr ""
msgid "Server mode"
msgstr ""
msgid "Start/Stop"
msgstr ""
msgid "Started"
msgstr ""
msgid "TCP port # for both local and remote"
msgstr ""
msgid "The secret key"
msgstr ""
msgid "Use ChaCha20 stream cipher"
msgstr ""
msgid "no"
msgstr ""
msgid "yes (%i)"
msgstr ""

View file

@ -1,102 +0,0 @@
msgid ""
msgstr ""
"PO-Revision-Date: 2020-06-27 17:26+0000\n"
"Last-Translator: antrouter <xinyangla@188.com>\n"
"Language-Team: Chinese (Simplified) <http://weblate.openmptcprouter.com/"
"projects/omr/luciapplicationsglorytun/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 ""
"Below is a list of configured Glorytun instances and their current state"
msgstr "以下是已配置的Glorytun实例及其当前状态的列表"
msgid "Bind address"
msgstr "绑定地址"
msgid "Bind backup"
msgstr "绑定备份"
msgid "Bind port"
msgstr "绑定端口"
msgid "Enable"
msgstr "开启"
msgid "Enabled"
msgstr "开启"
msgid "Glorytun"
msgstr "Glorytun(隧道)"
msgid "Glorytun instances"
msgstr "Glorytun实例"
msgid "Instance \"%s\""
msgstr "实例\"%s\""
msgid "Interface"
msgstr "接口"
msgid "Interface name"
msgstr "网卡名称"
msgid "Invalid"
msgstr "无效"
msgid "Local tunnel ip address"
msgstr "本地隧道IP地址"
msgid "MPTCP"
msgstr "MPTCP"
msgid "MTU"
msgstr "MTU"
msgid "MTU auto"
msgstr "自动MTU"
msgid "Overview"
msgstr "概况"
msgid "Port"
msgstr "端口"
msgid "Protocol"
msgstr "协议"
msgid "Remote host name or ip address"
msgstr "远程主机名或IP地址"
msgid "Remote tunnel ip address"
msgstr "远程隧道IP地址"
msgid "Server mode"
msgstr "服务器模式"
msgid "Start/Stop"
msgstr "开始/停止"
msgid "Started"
msgstr "开始了"
msgid "TCP port # for both local and remote"
msgstr "本地和远程的TCP端口号"
msgid "The secret key"
msgstr "秘钥"
msgid "Use ChaCha20 stream cipher"
msgstr "使用ChaCha20流密码"
msgid "no"
msgstr "不"
msgid "yes (%i)"
msgstr "是(%i)"

View file

@ -1,102 +0,0 @@
msgid ""
msgstr ""
"PO-Revision-Date: 2020-07-09 07:31+0000\n"
"Last-Translator: antrouter <xinyangla@188.com>\n"
"Language-Team: Chinese (Traditional) <http://weblate.openmptcprouter.com/"
"projects/omr/luciapplicationsglorytun/zh_Hant/>\n"
"Language: zh_Hant\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 ""
"Below is a list of configured Glorytun instances and their current state"
msgstr "以下是已配置的Glorytun實例及其當前狀態的列表"
msgid "Bind address"
msgstr "綁定地址"
msgid "Bind backup"
msgstr "綁定地址"
msgid "Bind port"
msgstr "綁定端口"
msgid "Enable"
msgstr "啟用"
msgid "Enabled"
msgstr "啟用"
msgid "Glorytun"
msgstr "Glorytun隧道"
msgid "Glorytun instances"
msgstr "Glorytun實例"
msgid "Instance \"%s\""
msgstr "實例\"%s\""
msgid "Interface"
msgstr "接口"
msgid "Interface name"
msgstr "接口名稱"
msgid "Invalid"
msgstr "無效"
msgid "Local tunnel ip address"
msgstr "本地隧道IP地址"
msgid "MPTCP"
msgstr "MPTCP協議"
msgid "MTU"
msgstr "MTU"
msgid "MTU auto"
msgstr "自動MTU"
msgid "Overview"
msgstr "總覽"
msgid "Port"
msgstr "端口"
msgid "Protocol"
msgstr "協議"
msgid "Remote host name or ip address"
msgstr "遠程主機名或IP地址"
msgid "Remote tunnel ip address"
msgstr "遠程隧道IP地址"
msgid "Server mode"
msgstr "服務器模式"
msgid "Start/Stop"
msgstr "開始/停止"
msgid "Started"
msgstr "已開始"
msgid "TCP port # for both local and remote"
msgstr "本地和遠程的TCP端口號"
msgid "The secret key"
msgstr "秘鑰"
msgid "Use ChaCha20 stream cipher"
msgstr "使用ChaCha20流密碼"
msgid "no"
msgstr "沒有"
msgid "yes (%i)"
msgstr "是(%i)"

View file

@ -1,50 +0,0 @@
config glorytun_recipe servertcp
option _description "Simple TCP server configuration"
option _role "server"
option port "65001"
option dev "tun0"
option key "secretkey"
option listener "1"
option localip "192.168.99.1"
option remoteip "192.168.99.2"
option proto "tcp"
option enable "0"
config glorytun_recipe clienttcp
option _description "Simple TCP client configuration"
option _role "client"
option port "65001"
option dev "tun0"
option host "vpnserver.example.org"
option key "secretkey"
option localip "192.168.99.2"
option remoteip "192.168.99.1"
option proto "tcp"
option enable "0"
config glorytun_recipe serverudp
option _description "Simple UDP server configuration"
option _role "server"
option dev "tun0"
option bindport "65003"
option bind "192.168.99.1"
option key "secretkey"
option localip "192.168.99.1"
option remoteip "192.168.99.2"
option proto "udp"
option mtuauto "1"
option enable "0"
config glorytun_recipe clientudp
option _description "Simple UDP client configuration"
option _role "client"
option port "65003"
option dev "tun0"
option host "vpnserver.example.org"
option key "secretkey"
option localip "192.168.99.2"
option remoteip "192.168.99.1"
option proto "udp"
option mtuauto "1"
option enable "0"

View file

@ -1,13 +0,0 @@
{
"admin/vpn/glorytun": {
"title": "Glorytun",
"order": 20,
"action": {
"type": "cbi",
"path": "glorytun"
},
"depends": {
"acl": [ "luci-app-glorytun" ]
}
}
}

View file

@ -1,6 +1,6 @@
msgid ""
msgstr ""
"PO-Revision-Date: 2020-06-27 17:26+0000\n"
"PO-Revision-Date: 2020-12-04 16:02+0000\n"
"Last-Translator: antrouter <xinyangla@188.com>\n"
"Language-Team: Chinese (Simplified) <http://weblate.openmptcprouter.com/"
"projects/omr/luciapplicationsiperf/zh_Hans/>\n"
@ -49,7 +49,7 @@ msgstr "忽略前n秒"
#: luci-app-iperf/luasrc/view/iperf/test.htm:151
msgid "Server"
msgstr "服务"
msgstr "服务"
#: luci-app-iperf/luasrc/view/iperf/test.htm:102
msgid "Settings"

View file

@ -1,7 +1,7 @@
msgid ""
msgstr ""
"PO-Revision-Date: 2020-09-21 12:51+0000\n"
"Last-Translator: Weblate Admin <contact@openmptcprouter.com>\n"
"PO-Revision-Date: 2020-12-01 10:49+0000\n"
"Last-Translator: Giuseppe Dipierro <giuseppe.dipierro@uania.com>\n"
"Language-Team: Italian <http://weblate.openmptcprouter.com/projects/omr/"
"luciapplicationsmail/it/>\n"
"Language: it\n"
@ -14,7 +14,7 @@ msgid "From"
msgstr "Da"
msgid "Mail settings"
msgstr "Impostazioni mail"
msgstr "Configurazione mail"
msgid "Password"
msgstr "Password"
@ -32,9 +32,7 @@ msgid "Server"
msgstr "Server"
msgid "Set mail settings for services that need to send mails."
msgstr ""
"Configurare le impostazioni di posta per i servizi che devono inviare "
"messaggi di posta elettronica."
msgstr "Configurazione del server mail da utilizzare per inviare alert."
msgid "TLS"
msgstr "TLS"

View file

@ -1,6 +1,6 @@
msgid ""
msgstr ""
"PO-Revision-Date: 2020-06-27 17:26+0000\n"
"PO-Revision-Date: 2020-12-04 16:02+0000\n"
"Last-Translator: antrouter <xinyangla@188.com>\n"
"Language-Team: Chinese (Simplified) <http://weblate.openmptcprouter.com/"
"projects/omr/luciapplicationsmail/zh_Hans/>\n"
@ -29,7 +29,7 @@ msgid "STARTTLS"
msgstr "STARTTLS设置"
msgid "Server"
msgstr "服务"
msgstr "服务"
msgid "Set mail settings for services that need to send mails."
msgstr "为需要发送邮件的服务设置邮件设置."

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.Value, 'label', _('Label'));
o.rmempty = true;
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;
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 +1,80 @@
msgid ""
msgstr ""
"Project-Id-Version: \n"
"POT-Creation-Date: \n"
"PO-Revision-Date: 2020-10-07 10:57+0000\n"
"PO-Revision-Date: 2020-12-15 14:46+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"
#: luci-app-mlvpn/htdocs/luci-static/resources/view/services/mlvpn.js:32
msgid "Advanced Settings"
msgstr "Configuration avancée"
msgid "Enable"
#: luci-app-mlvpn/htdocs/luci-static/resources/view/services/mlvpn.js:38
msgid "Client"
msgstr "Client"
#: luci-app-mlvpn/htdocs/luci-static/resources/view/services/mlvpn.js:34
msgid "Enabled"
msgstr "Activer"
msgid "First remote port"
msgstr "Premier port distant"
#: luci-app-mlvpn/htdocs/luci-static/resources/view/services/mlvpn.js:45
msgid "First Port"
msgstr "Premier port"
#: luci-app-mlvpn/htdocs/luci-static/resources/view/services/mlvpn.js:31
msgid "General Settings"
msgstr "Paramètres généraux"
#: luci-app-mlvpn/root/usr/share/rpcd/acl.d/luci-app-mlvpn.json:3
msgid "Grant UCI access for luci-app-mlvpn"
msgstr "Accorder l'accès UCI pour luci-app-mlvpn"
#: luci-app-mlvpn/htdocs/luci-static/resources/view/services/mlvpn.js:42
msgid "Host"
msgstr "Hôte"
#: luci-app-mlvpn/htdocs/luci-static/resources/view/services/mlvpn.js:26
msgid "Instances"
msgstr "Instances"
#: luci-app-mlvpn/htdocs/luci-static/resources/view/services/mlvpn.js:54
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"
#: luci-app-mlvpn/htdocs/luci-static/resources/view/services/mlvpn.js:78
msgid "Label"
msgstr "Étiquette"
#: luci-app-mlvpn/htdocs/luci-static/resources/view/services/mlvpn.js:72
msgid "Loss tolerance"
msgstr "Tolérance aux pertes"
#: luci-app-mlvpn/htdocs/luci-static/resources/view/services/mlvpn.js:24
#: luci-app-mlvpn/root/usr/share/luci/menu.d/luci-app-mlvpn.json:3
msgid "MLVPN"
msgstr "MLVPN"
#: luci-app-mlvpn/htdocs/luci-static/resources/view/services/mlvpn.js:37
msgid "Mode"
msgstr "Mode"
#: luci-app-mlvpn/htdocs/luci-static/resources/view/services/mlvpn.js:50
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"
#: luci-app-mlvpn/htdocs/luci-static/resources/view/services/mlvpn.js:66
msgid "Reorder buffer size"
msgstr "Taille du tampon de réordonnancement"
msgid "Settings"
msgstr "Paramètres"
#: luci-app-mlvpn/htdocs/luci-static/resources/view/services/mlvpn.js:39
msgid "Server"
msgstr "Serveur"
#: luci-app-mlvpn/htdocs/luci-static/resources/view/services/mlvpn.js:60
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 +1,71 @@
msgid ""
msgstr "Content-Type: text/plain; charset=UTF-8"
msgid "Add"
#: luci-app-mlvpn/htdocs/luci-static/resources/view/services/mlvpn.js:32
msgid "Advanced Settings"
msgstr ""
msgid "Enable"
#: luci-app-mlvpn/htdocs/luci-static/resources/view/services/mlvpn.js:38
msgid "Client"
msgstr ""
msgid "First remote port"
#: luci-app-mlvpn/htdocs/luci-static/resources/view/services/mlvpn.js:34
msgid "Enabled"
msgstr ""
#: luci-app-mlvpn/htdocs/luci-static/resources/view/services/mlvpn.js:45
msgid "First Port"
msgstr ""
#: luci-app-mlvpn/htdocs/luci-static/resources/view/services/mlvpn.js:31
msgid "General Settings"
msgstr ""
#: luci-app-mlvpn/root/usr/share/rpcd/acl.d/luci-app-mlvpn.json:3
msgid "Grant UCI access for luci-app-mlvpn"
msgstr ""
#: luci-app-mlvpn/htdocs/luci-static/resources/view/services/mlvpn.js:42
msgid "Host"
msgstr ""
#: luci-app-mlvpn/htdocs/luci-static/resources/view/services/mlvpn.js:26
msgid "Instances"
msgstr ""
#: luci-app-mlvpn/htdocs/luci-static/resources/view/services/mlvpn.js:54
msgid "Interface name"
msgstr ""
msgid "Interface will increase port used beginning with this"
msgstr ""
msgid "Interfaces"
msgstr ""
msgid "Invalid"
#: luci-app-mlvpn/htdocs/luci-static/resources/view/services/mlvpn.js:78
msgid "Label"
msgstr ""
#: luci-app-mlvpn/htdocs/luci-static/resources/view/services/mlvpn.js:72
msgid "Loss tolerance"
msgstr ""
#: luci-app-mlvpn/htdocs/luci-static/resources/view/services/mlvpn.js:24
#: luci-app-mlvpn/root/usr/share/luci/menu.d/luci-app-mlvpn.json:3
msgid "MLVPN"
msgstr ""
#: luci-app-mlvpn/htdocs/luci-static/resources/view/services/mlvpn.js:37
msgid "Mode"
msgstr ""
#: luci-app-mlvpn/htdocs/luci-static/resources/view/services/mlvpn.js:50
msgid "Password"
msgstr ""
msgid "Remote host"
msgstr ""
msgid "Remote/Bind port"
msgstr ""
#: luci-app-mlvpn/htdocs/luci-static/resources/view/services/mlvpn.js:66
msgid "Reorder buffer size"
msgstr ""
msgid "Settings"
#: luci-app-mlvpn/htdocs/luci-static/resources/view/services/mlvpn.js:39
msgid "Server"
msgstr ""
#: luci-app-mlvpn/htdocs/luci-static/resources/view/services/mlvpn.js:60
msgid "Timeout (s)"
msgstr ""

View file

@ -1,6 +1,6 @@
msgid ""
msgstr ""
"PO-Revision-Date: 2020-06-11 16:36+0000\n"
"PO-Revision-Date: 2020-12-04 16:03+0000\n"
"Last-Translator: antrouter <xinyangla@188.com>\n"
"Language-Team: Chinese (Simplified) <http://weblate.openmptcprouter.com/"
"projects/omr/luciapplicationsmlvpn/zh_Hans/>\n"
@ -10,50 +10,71 @@ msgstr ""
"Plural-Forms: nplurals=1; plural=0;\n"
"X-Generator: Weblate 4.0.4\n"
msgid "Add"
msgstr "添加"
#: luci-app-mlvpn/htdocs/luci-static/resources/view/services/mlvpn.js:32
msgid "Advanced Settings"
msgstr "高级设置"
msgid "Enable"
#: luci-app-mlvpn/htdocs/luci-static/resources/view/services/mlvpn.js:38
msgid "Client"
msgstr "客户端"
#: luci-app-mlvpn/htdocs/luci-static/resources/view/services/mlvpn.js:34
msgid "Enabled"
msgstr "开启"
msgid "First remote port"
msgstr "第一个远程端口"
#: luci-app-mlvpn/htdocs/luci-static/resources/view/services/mlvpn.js:45
msgid "First Port"
msgstr "第一端口"
#: luci-app-mlvpn/htdocs/luci-static/resources/view/services/mlvpn.js:31
msgid "General Settings"
msgstr "通用设置"
#: luci-app-mlvpn/root/usr/share/rpcd/acl.d/luci-app-mlvpn.json:3
msgid "Grant UCI access for luci-app-mlvpn"
msgstr "授予UCI访问luci-app-mlvpn的权限"
#: luci-app-mlvpn/htdocs/luci-static/resources/view/services/mlvpn.js:42
msgid "Host"
msgstr "主机"
#: luci-app-mlvpn/htdocs/luci-static/resources/view/services/mlvpn.js:26
msgid "Instances"
msgstr "实例"
#: luci-app-mlvpn/htdocs/luci-static/resources/view/services/mlvpn.js:54
msgid "Interface name"
msgstr "网卡名称"
msgstr "接口名称"
msgid "Interface will increase port used beginning with this"
msgstr "接口将从此开始增加使用的端口"
msgid "Interfaces"
msgstr "网卡"
msgid "Invalid"
msgstr "无效"
#: luci-app-mlvpn/htdocs/luci-static/resources/view/services/mlvpn.js:78
msgid "Label"
msgstr "标签"
#: luci-app-mlvpn/htdocs/luci-static/resources/view/services/mlvpn.js:72
msgid "Loss tolerance"
msgstr "损失容忍"
#: luci-app-mlvpn/htdocs/luci-static/resources/view/services/mlvpn.js:24
#: luci-app-mlvpn/root/usr/share/luci/menu.d/luci-app-mlvpn.json:3
msgid "MLVPN"
msgstr "MLVPN设置"
msgstr "mlvpn"
#: luci-app-mlvpn/htdocs/luci-static/resources/view/services/mlvpn.js:37
msgid "Mode"
msgstr "模式"
#: luci-app-mlvpn/htdocs/luci-static/resources/view/services/mlvpn.js:50
msgid "Password"
msgstr "密码"
msgid "Remote host"
msgstr "远程主机"
msgid "Remote/Bind port"
msgstr "远程/绑定端口"
#: luci-app-mlvpn/htdocs/luci-static/resources/view/services/mlvpn.js:66
msgid "Reorder buffer size"
msgstr "重新排序缓冲区大小"
msgid "Settings"
msgstr "设置"
#: luci-app-mlvpn/htdocs/luci-static/resources/view/services/mlvpn.js:39
msgid "Server"
msgstr "服务器"
#: luci-app-mlvpn/htdocs/luci-static/resources/view/services/mlvpn.js:60
msgid "Timeout (s)"
msgstr "超时 (秒)"
msgstr "超时(s)"

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" ]

View file

@ -906,13 +906,13 @@ window.setTimeout(function()
<% if curifname == "all" then %>
<strong><%:Download:%></strong>
<embed id="dnsvg" style="width:100%; height:300px; border:1px solid #000000; background-color:#FFFFFF" src="<%=resource%>/bandwidth.svg" />
<embed id="dnsvg" style="width:100%; height:300px; border:1px solid #000000; background-color:#FFFFFF" src="<%=resource%>/svg/bandwidth.svg" />
<div style="text-align:right"><small id="dnscale">-</small></div>
<table style="width:100%; table-layout:fixed" cellspacing="5" id="download_stats">
</table>
<strong><%:Upload:%></strong>
<embed id="upsvg" style="width:100%; height:300px; border:1px solid #000000; background-color:#FFFFFF" src="<%=resource%>/bandwidth.svg" />
<embed id="upsvg" style="width:100%; height:300px; border:1px solid #000000; background-color:#FFFFFF" src="<%=resource%>/svg/bandwidth.svg" />
<div style="text-align:right"><small id="upscale">-</small></div>
<table style="width:100%; table-layout:fixed" cellspacing="5" id="upload_stats">
</table>
@ -920,7 +920,7 @@ window.setTimeout(function()
<% else %>
<embed id="bwsvg" style="width:100%; height:300px; border:1px solid #000000; background-color:#FFFFFF" src="<%=resource%>/bandwidth.svg" />
<embed id="bwsvg" style="width:100%; height:300px; border:1px solid #000000; background-color:#FFFFFF" src="<%=resource%>/svg/bandwidth.svg" />
<div style="text-align:right"><small id="scale">-</small></div>
<br />

View file

@ -1,7 +1,7 @@
msgid ""
msgstr ""
"PO-Revision-Date: 2020-10-02 08:44+0000\n"
"Last-Translator: Weblate Admin <contact@openmptcprouter.com>\n"
"PO-Revision-Date: 2020-12-01 10:49+0000\n"
"Last-Translator: Giuseppe Dipierro <giuseppe.dipierro@uania.com>\n"
"Language-Team: Italian <http://weblate.openmptcprouter.com/projects/omr/"
"luciapplicationsmptcp/it/>\n"
"Language: it\n"
@ -164,7 +164,7 @@ msgstr "Un'interfaccia deve essere impostata come master"
#: luci-app-mptcp/luasrc/view/mptcp/multipath.htm:939
msgid "Outbound:"
msgstr "In uscita:"
msgstr "Upload:"
#: luci-app-mptcp/luasrc/view/mptcp/multipath.htm:323
#: luci-app-mptcp/luasrc/view/mptcp/multipath.htm:326
@ -193,7 +193,7 @@ msgstr "Test"
#: luci-app-mptcp/luasrc/view/mptcp/multipath.htm:914
msgid "Upload:"
msgstr "Carica:"
msgstr "Upload:"
#: luci-app-mptcp/luasrc/view/mptcp/mptcp_check.htm:21
#: luci-app-mptcp/luasrc/view/mptcp/mptcp_connections.htm:21

View file

@ -1,7 +1,7 @@
msgid ""
msgstr ""
"PO-Revision-Date: 2020-11-06 06:58+0000\n"
"Last-Translator: 马 <klsn@qq.com>\n"
"PO-Revision-Date: 2020-12-04 16:02+0000\n"
"Last-Translator: antrouter <xinyangla@188.com>\n"
"Language-Team: Chinese (Simplified) <http://weblate.openmptcprouter.com/"
"projects/omr/luciapplicationsmptcp/zh_Hans/>\n"
"Language: zh_Hans\n"
@ -97,7 +97,7 @@ msgstr "MB/s"
#: luci-app-mptcp/luasrc/controller/mptcp.lua:9
#: luci-app-mptcp/luasrc/model/cbi/mptcp.lua:7
msgid "MPTCP"
msgstr "MPTCP"
msgstr "聚合"
#: luci-app-mptcp/luasrc/controller/mptcp.lua:16
msgid "MPTCP Fullmesh"

View file

@ -56,12 +56,12 @@ _bypass_domain() {
domain=$(echo $domain | sed 's:^\.::')
#logger -t "omr-bypass" "Get IPs of $domain..."
if [ -z $RELOAD ]; then
resolve=$(dig a +timeout=1 +tries=1 +nocmd +noall +answer $domain | awk '{print $5}')
resolve=$(dig a +timeout=1 +tries=1 +nocmd +noall +answer $domain | grep -v CNAME | awk '{print $5}')
for ip in $resolve; do
_bypass_ip $ip $intf
done
if [ "$disableipv6" = "0" ]; then
resolve=$(dig aaaa +timeout=1 +tries=1 +nocmd +noall +answer $domain | awk '{print $5}')
resolve=$(dig aaaa +timeout=1 +tries=1 +nocmd +noall +answer $domain | grep AAAA | awk '{print $5}')
for ip in $resolve; do
_bypass_ip $ip $intf
done
@ -331,21 +331,33 @@ _bypass_proto() {
local domains
domains="$(cat /proc/net/xt_ndpi/host_proto | grep -i $proto: | sed -e "s/$proto://i" -e 's/*//' -e 's/,/ /g')"
if [ -n "$domains" ]; then
tlds=`curl --max-time 4 -s -k https://data.iana.org/TLD/tlds-alpha-by-domain.txt`
for domain in $domains; do
if [ -n "$domain" ]; then
domain="$(echo $domain | sed 's/^\.//')"
if [ "$(echo $domain | grep '\.$')" != "" ]; then
tlds=`curl --max-time 4 -s -k https://data.iana.org/TLD/tlds-alpha-by-domain.txt`
if [ -n "tlds" ]; then
i=0
for tld in $tlds; do
i=$((i+1))
tld="$(echo $tld | awk '{print tolower($0)}')"
if [ "$i" -gt "11" ] && [ "$(dig a +timeout=1 +tries=1 +retry=1 +nocmd +noall +answer ${domain}${tld})" != "" ]; then
_bypass_domain ${domain}${tld} $intf
fi
done
fi
domainlist=""
# construct list of domains to query
for tld in $tlds; do
i=$((i+1))
# trim off header
if [ "$i" -lt "12" ] || [ "$i" -gt "50" ]; then
continue
fi
# add to command
domainlist="${domainlist} ${domain}${tld}"
done
domainlist="$(echo $domainlist `# Get the list of valid domains, pass it to awk` \
| awk '{print tolower($0)}' `# awk lowercases the whole string and passes it to ` \
| xargs -n8 -P12 `# xargs sends 8 arguments at a time to` \
dig a +timeout=1 +tries=1 +retry=1 +nocmd +noall +answer `# dig, which passes results (if any) to` \
| awk '{print $1}' `# awk, which outputs queried domain to` \
| sed -e 's/.$//' `# sed, which trims off the trailing dot (google.com. -> google.com)` to \
| grep $domain `# grep, only keep wanted domain` \
| awk '{for (i=1;i<=NF;i++) if (!a[$i]++) printf("%s%s",$i,FS)}{printf("\n")}')" # deduplicate
for validdomain in $domainlist; do
_bypass_domain $validdomain $intf
done
else
_bypass_domain $domain $intf
fi

View file

@ -1,6 +1,6 @@
msgid ""
msgstr ""
"PO-Revision-Date: 2020-06-11 16:36+0000\n"
"PO-Revision-Date: 2020-12-04 16:02+0000\n"
"Last-Translator: antrouter <xinyangla@188.com>\n"
"Language-Team: Chinese (Simplified) <http://weblate.openmptcprouter.com/"
"projects/omr/luciapplicationsomr-tracker/zh_Hans/>\n"
@ -31,7 +31,7 @@ msgid "Retry interval (s)"
msgstr "重试间隔 (秒)"
msgid "Timeout (s)"
msgstr "超时 (秒)"
msgstr "超时(s)"
msgid "Tries"
msgstr "尝试多少次"

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

View file

@ -8,20 +8,19 @@ local ipc = require "luci.ip"
module("luci.controller.openmptcprouter", package.seeall)
function index()
-- entry({"admin", "openmptcprouter"}, firstchild(), _("OpenMPTCProuter"), 19).index = true
-- entry({"admin", "openmptcprouter", "wizard"}, template("openmptcprouter/wizard"), _("Wizard"), 1).leaf = true
-- entry({"admin", "openmptcprouter", "wizard_add"}, post("wizard_add")).leaf = true
entry({"admin", "system", "openmptcprouter"}, alias("admin", "system", "openmptcprouter", "wizard"), _("OpenMPTCProuter"), 1)
entry({"admin", "system", "openmptcprouter", "wizard"}, template("openmptcprouter/wizard"), _("Settings Wizard"), 1)
entry({"admin", "system", "openmptcprouter", "wizard_add"}, post("wizard_add"))
entry({"admin", "system", "openmptcprouter", "status"}, template("openmptcprouter/wanstatus"), _("Status"), 2).leaf = true
entry({"admin", "system", "openmptcprouter", "interfaces_status"}, call("interfaces_status")).leaf = true
entry({"admin", "system", "openmptcprouter", "settings"}, template("openmptcprouter/settings"), _("Advanced Settings"), 3).leaf = true
entry({"admin", "system", "openmptcprouter", "settings_add"}, post("settings_add"))
entry({"admin", "system", "openmptcprouter", "update_vps"}, post("update_vps"))
entry({"admin", "system", "openmptcprouter", "backup"}, template("openmptcprouter/backup"), _("Backup on server"), 3).leaf = true
entry({"admin", "system", "openmptcprouter", "backupgr"}, post("backupgr"))
entry({"admin", "system", "openmptcprouter", "debug"}, template("openmptcprouter/debug"), _("Show all settings"), 5).leaf = true
local ucic = luci.model.uci.cursor()
menuentry = ucic:get("openmptcprouter","settings","menu") or "OpenMPTCProuter"
entry({"admin", "system", menuentry:lower()}, alias("admin", "system", menuentry:lower(), "wizard"), _(menuentry), 1)
entry({"admin", "system", menuentry:lower(), "wizard"}, template("openmptcprouter/wizard"), _("Settings Wizard"), 1)
entry({"admin", "system", menuentry:lower(), "wizard_add"}, post("wizard_add"))
entry({"admin", "system", menuentry:lower(), "status"}, template("openmptcprouter/wanstatus"), _("Status"), 2).leaf = true
entry({"admin", "system", menuentry:lower(), "interfaces_status"}, call("interfaces_status")).leaf = true
entry({"admin", "system", menuentry:lower(), "settings"}, template("openmptcprouter/settings"), _("Advanced Settings"), 3).leaf = true
entry({"admin", "system", menuentry:lower(), "settings_add"}, post("settings_add"))
entry({"admin", "system", menuentry:lower(), "update_vps"}, post("update_vps"))
entry({"admin", "system", menuentry:lower(), "backup"}, template("openmptcprouter/backup"), _("Backup on server"), 3).leaf = true
entry({"admin", "system", menuentry:lower(), "backupgr"}, post("backupgr"))
entry({"admin", "system", menuentry:lower(), "debug"}, template("openmptcprouter/debug"), _("Show all settings"), 5).leaf = true
end
function interface_from_device(dev)
@ -72,6 +71,7 @@ function wizard_add()
if nbserver == 1 and server_ip ~= "" and server_ip ~= nil then
ucic:set("shadowsocks-libev","sss0","server",server_ip)
ucic:set("glorytun","vpn","host",server_ip)
ucic:set("glorytun-udp","vpn","host",server_ip)
ucic:set("dsvpn","vpn","host",server_ip)
ucic:set("mlvpn","general","host",server_ip)
ucic:set("ubond","general","host",server_ip)
@ -448,14 +448,26 @@ function wizard_add()
-- Get Proxy set by default
local default_proxy = luci.http.formvalue("default_proxy") or "shadowsocks"
if default_proxy == "shadowsocks" and serversnb > 0 and serversnb > disablednb then
ucic:set("shadowsocks-libev","sss0","disabled","0")
--ucic:set("shadowsocks-libev","sss0","disabled","0")
ucic:set("v2ray","main","enabled","0")
ucic:foreach("shadowsocks-libev", "server", function(s)
local sectionname = s[".name"]
ucic:set("shadowsocks-libev",sectionname,"disabled","0")
end)
elseif default_proxy == "v2ray" and serversnb > 0 and serversnb > disablednb then
ucic:set("shadowsocks-libev","sss0","disabled","1")
--ucic:set("shadowsocks-libev","sss0","disabled","1")
ucic:set("v2ray","main","enabled","1")
ucic:foreach("shadowsocks-libev", "server", function(s)
local sectionname = s[".name"]
ucic:set("shadowsocks-libev",sectionname,"disabled","1")
end)
else
ucic:set("shadowsocks-libev","sss0","disabled","1")
--ucic:set("shadowsocks-libev","sss0","disabled","1")
ucic:set("v2ray","main","enabled","0")
ucic:foreach("shadowsocks-libev", "server", function(s)
local sectionname = s[".name"]
ucic:set("shadowsocks-libev",sectionname,"disabled","1")
end)
end
ucic:set("openmptcprouter","settings","proxy",default_proxy)
ucic:save("openmptcprouter")
@ -480,6 +492,7 @@ function wizard_add()
ss_ip=server_ip
ucic:set("shadowsocks-libev","sss0","server",server_ip)
ucic:set("glorytun","vpn","host",server_ip)
ucic:set("glorytun-udp","vpn","host",server_ip)
ucic:set("dsvpn","vpn","host",server_ip)
ucic:set("mlvpn","general","host",server_ip)
ucic:set("ubond","general","host",server_ip)
@ -501,6 +514,7 @@ function wizard_add()
ucic:set("nginx-ha","VPN","enable","0")
ucic:set("shadowsocks-libev","sss0","server",server_ip)
ucic:set("glorytun","vpn","host",server_ip)
ucic:set("glorytun-udp","vpn","host",server_ip)
ucic:set("dsvpn","vpn","host",server_ip)
ucic:set("mlvpn","general","host",server_ip)
ucic:set("ubond","general","host",server_ip)
@ -527,6 +541,7 @@ function wizard_add()
ucic:save("dsvpn")
--ucic:commit("dsvpn")
ucic:save("glorytun")
ucic:save("glorytun-udp")
--ucic:commit("glorytun")
ucic:save("shadowsocks-libev")
--ucic:commit("shadowsocks-libev")
@ -541,24 +556,28 @@ function wizard_add()
elseif encryption == "aes-256-gcm" then
ucic:set("shadowsocks-libev","sss0","method","aes-256-gcm")
ucic:set("glorytun","vpn","chacha20","0")
ucic:set("glorytun-udp","vpn","chacha","0")
ucic:set("openvpn","omr","cipher","AES-256-GCM")
ucic:set("v2ray","omrout","s_vmess_user_security","aes-128-gcm")
ucic:set("v2ray","omrout","s_vless_user_security","aes-128-gcm")
elseif encryption == "aes-256-cfb" then
ucic:set("shadowsocks-libev","sss0","method","aes-256-cfb")
ucic:set("glorytun","vpn","chacha20","0")
ucic:set("glorytun-udp","vpn","chacha","0")
ucic:set("openvpn","omr","cipher","AES-256-CFB")
ucic:set("v2ray","omrout","s_vmess_user_security","aes-128-gcm")
ucic:set("v2ray","omrout","s_vless_user_security","aes-128-gcm")
elseif encryption == "chacha20-ietf-poly1305" then
ucic:set("shadowsocks-libev","sss0","method","chacha20-ietf-poly1305")
ucic:set("glorytun","vpn","chacha20","1")
ucic:set("glorytun-udp","vpn","chacha","1")
ucic:set("openvpn","omr","cipher","AES-256-CBC")
ucic:set("v2ray","omrout","s_vmess_user_security","chacha20-poly1305")
ucic:set("v2ray","omrout","s_vless_user_security","chacha20-poly1305")
end
ucic:save("openvpn")
ucic:save("glorytun")
ucic:save("glorytun-udp")
ucic:save("shadowsocks-libev")
ucic:save("v2ray")
@ -595,7 +614,7 @@ function wizard_add()
-- Set Glorytun settings
if default_vpn:match("^glorytun.*") and disablednb ~= serversnb then
if default_vpn:match("glorytun_tcp") and disablednb ~= serversnb then
ucic:set("glorytun","vpn","enable",1)
else
ucic:set("glorytun","vpn","enable",0)
@ -606,20 +625,14 @@ function wizard_add()
ucic:set("glorytun","vpn","port","65001")
ucic:set("glorytun","vpn","key",glorytun_key)
ucic:set("glorytun","vpn","mptcp",1)
if default_vpn == "glorytun_udp" then
ucic:set("glorytun","vpn","proto","udp")
ucic:set("glorytun","vpn","localip","10.255.254.2")
ucic:set("glorytun","vpn","remoteip","10.255.254.1")
ucic:set("network","omr6in4","ipaddr","10.255.254.2")
ucic:set("network","omr6in4","peeraddr","10.255.254.1")
else
if default_vpn == "glorytun_tcp" then
ucic:set("glorytun","vpn","proto","tcp")
ucic:set("glorytun","vpn","localip","10.255.255.2")
ucic:set("glorytun","vpn","remoteip","10.255.255.1")
ucic:set("network","omr6in4","ipaddr","10.255.255.2")
ucic:set("network","omr6in4","peeraddr","10.255.255.1")
ucic:set("network","omrvpn","proto","none")
end
ucic:set("network","omrvpn","proto","none")
else
ucic:set("glorytun","vpn","key","")
--ucic:set("glorytun","vpn","enable",0)
@ -628,6 +641,29 @@ function wizard_add()
ucic:save("glorytun")
ucic:commit("glorytun")
if default_vpn:match("glorytun_udp") and disablednb ~= serversnb then
ucic:set("glorytun-udp","vpn","enable",1)
else
ucic:set("glorytun-udp","vpn","enable",0)
end
local glorytun_key = luci.http.formvalue("glorytun_key")
if glorytun_key ~= "" then
ucic:set("glorytun-udp","vpn","port","65001")
ucic:set("glorytun-udp","vpn","key",glorytun_key)
if default_vpn == "glorytun_udp" then
ucic:set("glorytun-udp","vpn","localip","10.255.254.2")
ucic:set("glorytun-udp","vpn","remoteip","10.255.254.1")
ucic:set("network","omr6in4","ipaddr","10.255.254.2")
ucic:set("network","omr6in4","peeraddr","10.255.254.1")
ucic:set("network","omrvpn","proto","none")
end
else
ucic:set("glorytun-udp","vpn","key","")
end
ucic:save("glorytun-udp")
ucic:commit("glorytun-udp")
-- Set A Dead Simple VPN settings
if default_vpn == "dsvpn" and disablednb ~= serversnb then
ucic:set("dsvpn","vpn","enable",1)
@ -641,9 +677,11 @@ function wizard_add()
ucic:set("dsvpn","vpn","key",dsvpn_key)
ucic:set("dsvpn","vpn","localip","10.255.251.2")
ucic:set("dsvpn","vpn","remoteip","10.255.251.1")
ucic:set("network","omr6in4","ipaddr","10.255.251.2")
ucic:set("network","omr6in4","peeraddr","10.255.251.1")
ucic:set("network","omrvpn","proto","none")
if default_vpn == "dsvpn" then
ucic:set("network","omr6in4","ipaddr","10.255.251.2")
ucic:set("network","omr6in4","peeraddr","10.255.251.1")
ucic:set("network","omrvpn","proto","none")
end
else
ucic:set("dsvpn","vpn","key","")
--ucic:set("dsvpn","vpn","enable",0)
@ -718,7 +756,9 @@ function wizard_add()
ucic:commit("openmptcprouter")
-- Restart all
menuentry = ucic:get("openmptcprouter","settings","menu") or "openmptcprouter"
if gostatus == true then
luci.sys.call("/etc/init.d/macvlan restart >/dev/null 2>/dev/null")
luci.sys.call("(env -i /bin/ubus call network reload) >/dev/null 2>/dev/null")
luci.sys.call("/etc/init.d/omr-tracker stop >/dev/null 2>/dev/null")
luci.sys.call("/etc/init.d/mptcp restart >/dev/null 2>/dev/null")
@ -732,15 +772,16 @@ function wizard_add()
luci.sys.call("/etc/init.d/mlvpn restart >/dev/null 2>/dev/null")
--luci.sys.call("/etc/init.d/ubond restart >/dev/null 2>/dev/null")
luci.sys.call("/etc/init.d/openvpn restart >/dev/null 2>/dev/null")
luci.sys.call("/etc/init.d/openvpnbonding restart >/dev/null 2>/dev/null")
luci.sys.call("/etc/init.d/dsvpn restart >/dev/null 2>/dev/null")
luci.sys.call("/etc/init.d/omr-tracker start >/dev/null 2>/dev/null")
luci.sys.call("/etc/init.d/omr-6in4 restart >/dev/null 2>/dev/null")
luci.sys.call("/etc/init.d/mptcpovervpn restart >/dev/null 2>/dev/null")
luci.sys.call("/etc/init.d/vnstat restart >/dev/null 2>/dev/null")
luci.sys.call("/etc/init.d/v2ray restart >/dev/null 2>/dev/null")
luci.http.redirect(luci.dispatcher.build_url("admin/system/openmptcprouter/status"))
luci.http.redirect(luci.dispatcher.build_url("admin/system/" .. menuentry:lower() .. "/status"))
else
luci.http.redirect(luci.dispatcher.build_url("admin/system/openmptcprouter/wizard"))
luci.http.redirect(luci.dispatcher.build_url("admin/system/" .. menuentry:lower() .. "/wizard"))
end
return
end
@ -800,7 +841,8 @@ function settings_add()
-- Disable IPv6
local disable_ipv6 = luci.http.formvalue("enableipv6") or "1"
local dump = require("luci.util").ubus("openmptcprouter", "disableipv6", { disable_ipv6 = tonumber(disable_ipv6)})
ucic:set("openmptcprouter","settings","disable_ipv6",disable_ipv6)
--local dump = require("luci.util").ubus("openmptcprouter", "disableipv6", { disable_ipv6 = tonumber(disable_ipv6)})
-- Enable/disable external check
local externalcheck = luci.http.formvalue("externalcheck") or "1"
@ -831,6 +873,10 @@ function settings_add()
local disableserverping = luci.http.formvalue("disableserverping") or "0"
ucic:set("openmptcprouter","settings","disableserverping",disableserverping)
-- Enable/disable shadowsocks upd
local shadowsocksudp = luci.http.formvalue("shadowsocksudp") or "0"
ucic:set("openmptcprouter","settings","shadowsocksudp",shadowsocksudp)
-- Enable/disable fast open
local disablefastopen = luci.http.formvalue("disablefastopen") or "0"
if disablefastopen == "0" then
@ -897,9 +943,11 @@ function settings_add()
-- Apply all settings
luci.sys.call("/etc/init.d/openmptcprouter restart >/dev/null 2>/dev/null")
luci.sys.call("/etc/init.d/omr-6in4 restart >/dev/null 2>/dev/null")
-- Done, redirect
luci.http.redirect(luci.dispatcher.build_url("admin/system/openmptcprouter/settings"))
menuentry = ucic:get("openmptcprouter","settings","menu") or "openmptcprouter"
luci.http.redirect(luci.dispatcher.build_url("admin/system/" .. menuentry:lower() .. "/settings"))
return
end
@ -922,7 +970,8 @@ function backupgr()
if send_backup ~= "" then
luci.sys.call("/etc/init.d/openmptcprouter-vps backup_send >/dev/null 2>/dev/null")
end
luci.http.redirect(luci.dispatcher.build_url("admin/system/openmptcprouter/backup"))
menuentry = ucic:get("openmptcprouter","settings","menu") or "openmptcprouter"
luci.http.redirect(luci.dispatcher.build_url("admin/system/" .. menuentry:lower() .. "/backup"))
return
end

View file

@ -1,9 +1,11 @@
<%+header%>
<%
luci.sys.call("/etc/init.d/openmptcprouter-vps backup_list >/dev/null 2>/dev/null")
local ucic = luci.model.uci.cursor()
menuentry = ucic:get("openmptcprouter","settings","menu") or "openmptcprouter"
%>
<% if stderr and #stderr > 0 then %><pre class="error"><%=pcdata(stderr)%></pre><% end %>
<form class="inline" method="post" action="<%=url('admin/system/openmptcprouter/backupgr')%>">
<form class="inline" method="post" action="<%=url('admin/system/' .. menuentry:lower() .. '/backupgr')%>">
<div class="cbi-map">
<h2 name="content"><%:Backup on server%></h2>
<fieldset class="cbi-section" id="networks">

View file

@ -3,6 +3,8 @@
<% if stderr and #stderr > 0 then %><pre class="error"><%=pcdata(stderr)%></pre><% end %>
<%
local latest_omr_version=luci.model.uci.cursor():get("openmptcprouter","latest_versions","vps")
local ucic = luci.model.uci.cursor()
menuentry = ucic:get("openmptcprouter","settings","menu") or "openmptcprouter"
omr_test = false
uci:foreach("openmptcprouter","server", function(s)
servername = s[".name"]
@ -13,7 +15,7 @@
end)
if omr_test == true then
%>
<form class="inline" method="post" action="<%=url('admin/system/openmptcprouter/update_vps')%>">
<form class="inline" method="post" action="<%=url('admin/system/' .. menuentry:lower() .. '/update_vps')%>">
<div class="cbi-map">
<h2 name="content"><%:Update VPS%></h2>
<fieldset class="cbi-section" id="update">
@ -34,7 +36,7 @@
%>
<hr />
<form class="inline" method="post" action="<%=url('admin/system/openmptcprouter/settings_add')%>">
<form class="inline" method="post" action="<%=url('admin/system/' .. menuentry:lower() .. '/settings_add')%>">
<div class="cbi-map">
<h2 name="content"><%:Advanced Settings%></h2>
<fieldset class="cbi-section" id="networks">
@ -242,6 +244,12 @@
</div>
</div>
</div>
<div class="cbi-value">
<label class="cbi-value-title"><%:When proxy shadowsocks is used, use it for UDP if proxy down%></label>
<div class="cbi-value-field">
<input type="checkbox" name="shadowsocksudp" class="cbi-input-checkbox" value="1" <% if luci.model.uci.cursor():get("openmptcprouter","settings","shadowsocksudp") == "1" then %>checked<% end %>>
</div>
</div>
<div class="cbi-value">
<label class="cbi-value-title"><%:Disable default gateway%></label>
<div class="cbi-value-field">

View file

@ -31,6 +31,11 @@
-- * Many tests
-%>
<%+header%>
<%
local ucic = luci.model.uci.cursor()
local menuentry = ucic:get("openmptcprouter","settings","menu") or "openmptcprouter"
local statuslogo = ucic:get("openmptcprouter","settings","statuslogo") or "openmptcprouter.png"
%>
<link rel="stylesheet" type="text/css" href="<%=resource%>/openmptcprouter/css/wanstatus.css?v=git-20"/>
<script type="text/javascript" src="<%=resource%>/seedrandom.js?v=git-20"></script>
<script type="text/javascript" src="<%=resource%>/cbi.js?v=git-20"></script>
@ -48,7 +53,7 @@
}
}
function formatBytes(a,b=2){if(0===a)return"0 Bytes";const c=0>b?0:b,d=Math.floor(Math.log(a)/Math.log(1024));return parseFloat((a/Math.pow(1024,d)).toFixed(c))+" "+["Bytes","KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"][d]}
XHR.poll(20, '<%=build_url("admin/system/openmptcprouter/interfaces_status")%>', null,
XHR.poll(20, '<%=build_url("admin/system/" .. menuentry:lower() .. "/interfaces_status")%>', null,
function(x, mArray)
{
var status = document.getElementById('openmptcprouter_status');
@ -103,7 +108,7 @@
}
}
temp += '<tr><td></td></tr><tr><td><a href="#" id="omr">';
var equipmentIcon = '<img src="<%=resource%>/overthebox.png" style:"top: 0px;" />';
var equipmentIcon = '<img src="<%=resource%>/<%=statuslogo%>" style:"top: 0px;" />';
var title = String.format("%s (%s)", mArray.openmptcprouter.hostname, mArray.openmptcprouter.local_addr);
var statusMessageClass = "";
var statusIcon = "<%=resource%>/openmptcprouter/images/statusOK.png";
@ -218,7 +223,7 @@
temp += '</td></tr>';
temp += '<tr><td><div class="vertdash" ></div></td></tr>';
temp += '<tr><td>';
temp += '<a href="<%=url('admin/system/openmptcprouter/wizard')%>" id="omr-vps">';
temp += '<a href="<%=url('admin/system/' .. menuentry:lower() .. '/wizard')%>" id="omr-vps">';
var statusIcon = "<%=resource%>/openmptcprouter/images/statusOK.png";
var equipmentIcon = '<img src="<%=resource%>/server.png" />';
content = "";
@ -266,6 +271,9 @@
} else if (mArray.openmptcprouter.shadowsocks_enabled == true && mArray.openmptcprouter.ss_addr == "" && mArray.openmptcprouter.external_check == true)
{
statusMessage += '<%:Can\'t get public IP address from ShadowSocks%>' + '<br/>';
} else if (mArray.openmptcprouter.v2ray_enabled == true && mArray.openmptcprouter.ss_addr == "" && mArray.openmptcprouter.external_check == true)
{
statusMessage += '<%:Can\'t get public IP address from V2Ray%>' + '<br/>';
} else if (mArray.openmptcprouter.wan_addr == "" && mArray.openmptcprouter.external_check == true)
{
statusMessage += '<%:No WAN IP address detected in less than 1 second%>' + '<br/>';

View file

@ -7,14 +7,15 @@
local sys = require "luci.sys"
local ut = require "luci.util"
local ifaces = sys.net:devices()
menuentry = uci:get("openmptcprouter","settings","menu") or "openmptcprouter"
function device_notvirtual(dev)
for _, iface in ipairs(net:get_networks()) do
local ifacen = iface:name()
local ifacename = uci:get("network",ifacen,"ifname")
local ifacetype = uci:get("network",ifacen,"type") or ""
local ifaceproto = uci:get("network",ifacen,"proto") or ""
if ifacename == dev and (ifacetype == "macvlan" or ifacetype == "bridge" or ifaceproto == "6in4") then
--if ifacename == dev and (ifacetype == "macvlan" or ifacetype == "bridge" or ifaceproto == "6in4") then
if ifacename == dev and (ifacetype == "macvlan" or ifaceproto == "6in4") then
return false
end
end
@ -34,7 +35,7 @@
}
</script>
<% if stderr and #stderr > 0 then %><pre class="error"><%=pcdata(stderr)%></pre><% end %>
<form class="inline" method="post" action="<%=url('admin/system/openmptcprouter/wizard_add')%>" enctype="multipart/form-data">
<form class="inline" method="post" action="<%=url('admin/system/' .. menuentry:lower() .. '/wizard_add')%>" enctype="multipart/form-data">
<div class="cbi-map">
<h2 name="content"><%:Wizard%></h2>
<fieldset class="cbi-section" id="server">
@ -171,9 +172,9 @@
<label class="cbi-value-title"><%:Default Proxy%></label>
<div class="cbi-value-field">
<select class="cbi-input-select" name="default_proxy" size="1">
<% if nixio.fs.access("/etc/init.d/shadowsocks-libev") then %><option value="shadowsocks" <% if uci:get("shadowsocks-libev","sss0","disabled") == "0" or uci:get("openmptcprouter","settings","proxy") == nil then %>selected="selected"<% end %>>Shadowsocks</option><% end %>
<% if nixio.fs.access("/etc/init.d/v2ray") then %><option value="v2ray" <% if uci:get("v2ray","main","enabled") == "1" then %>selected="selected"<% end %>>V2Ray</option><% end %>
<option value="none" <% if uci:get("shadowsocks-libev","sss0","disabled") ~= "0" and uci:get("v2ray","main","enabled") ~= "1" and uci:get("openmptcprouter","settings","proxy") ~= nil then %>selected="selected"<% end %>>None</option>
<% if nixio.fs.access("/etc/init.d/shadowsocks-libev") then %><option value="shadowsocks" <% if uci:get("openmptcprouter","settings","shadowsocks") == "0" or uci:get("openmptcprouter","settings","proxy") == nil then %>selected="selected"<% end %>>Shadowsocks</option><% end %>
<% if nixio.fs.access("/etc/init.d/v2ray") then %><option value="v2ray" <% if uci:get("openmptcprouter","settings","proxy") == "v2ray" then %>selected="selected"<% end %>>V2Ray</option><% end %>
<option value="none" <% if uci:get("openmptcprouter","settings","proxy") == "none" then %>selected="selected"<% end %>>None</option>
</select>
<br />
<div class="cbi-value-description">
@ -304,7 +305,9 @@
<% elseif vpn == "ubond" then %>
<% if nixio.fs.access("/usr/sbin/ubond") then %><option value="ubond" <% if uci:get("ubond","general","enable") == "1" then %>selected="selected"<% end %>>UBOND</option><% end %>
<% elseif vpn == "openvpn" then %>
<% if nixio.fs.access("/usr/sbin/openvpn") then %><option value="openvpn" <% if uci:get("openvpn","omr","enabled") == "1" then %>selected="selected"<% end %>>OpenVPN TCP</option><% end %>
<% if nixio.fs.access("/etc/init.d/openvpn") then %><option value="openvpn" <% if uci:get("openvpn","omr","enabled") == "1" then %>selected="selected"<% end %>>OpenVPN TCP</option><% end %>
<% elseif vpn == "openvpn_bonding" then %>
<% if nixio.fs.access("/etc/init.d/openvpnbonding") then %><option value="openvpn_bonding" <% if uci:get("openmptcprouter","settings","vpn") == "openvpn_bonding" then %>selected="selected"<% end %>>OpenVPN Bonding</option><% end %>
<%
end
end
@ -318,7 +321,8 @@
<% if nixio.fs.access("/usr/sbin/dsvpn") then %><option value="dsvpn" <% if uci:get("dsvpn","vpn","enable") == "1" then %>selected="selected"<% end %>>A Dead Simple VPN</option><% end %>
<% if nixio.fs.access("/usr/sbin/mlvpn") then %><option value="mlvpn" <% if uci:get("mlvpn","general","enable") == "1" then %>selected="selected"<% end %>>MLVPN</option><% end %>
<% if nixio.fs.access("/usr/sbin/ubond") then %><option value="ubond" <% if uci:get("ubond","general","enable") == "1" then %>selected="selected"<% end %>>UBOND</option><% end %>
<% if nixio.fs.access("/usr/sbin/openvpn") then %><option value="openvpn" <% if uci:get("openvpn","omr","enabled") == "1" then %>selected="selected"<% end %>>OpenVPN</option><% end %>
<% if nixio.fs.access("/etc/init.d/openvpn") then %><option value="openvpn" <% if uci:get("openvpn","omr","enabled") == "1" then %>selected="selected"<% end %>>OpenVPN</option><% end %>
<% if nixio.fs.access("/etc/init.d/openvpnbonding") then %><option value="openvpn_bonding" <% if uci:get("openmptcprouter","settings","vpn") == "openvpn_bonding" then %>selected="selected"<% end %>>OpenVPN Bonding</option><% end %>
<option value="none" <% if uci:get("openmptcprouter","settings","vpn") == "none" then %>selected="selected"<% end %>>None</option>
<%
end
@ -380,7 +384,7 @@
<%
iffind=0
for _, ifacea in ipairs(ifaces) do
if not (ifacea == "lo" or ifacea == "6in4-omr6in4" or ifacea == "mlvpn0" or ifacea:match("^ifb.*") or ifacea:match("^sit.*") or ifacea:match("^gre.*") or ifacea:match("^ip6.*") or ifacea:match("^teql.*") or ifacea:match("^erspan.*") or ifacea:match("^tun.*")) then
if not (ifacea == "lo" or ifacea == "6in4-omr6in4" or ifacea == "mlvpn0" or ifacea:match("^ifb.*") or ifacea:match("^sit.*") or ifacea:match("^gre.*") or ifacea:match("^ip6.*") or ifacea:match("^teql.*") or ifacea:match("^erspan.*") or ifacea:match("^tun.*")) and device_notvirtual(ifacea) then
if uci:get("network",ifname,"proto") ~= "macvlan" then
%>
<option value="<%=ifacea%>"<% if uci:get("network",ifname,"ifname") == ifacea then iffind = 1 %> selected="selected"<% end %>><%=ifacea%></option>
@ -469,7 +473,7 @@
<label class="cbi-value-title"><%:Type%></label>
<div class="cbi-value-field">
<select class="cbi-input-select" data-update="change" id="cbid.network.<%=ifname%>.type" name="cbid.network.<%=ifname%>.type" size="1">
<option id="cbid.network.<%=ifname%>.type-normal" value="normal"><%:Normal%></option>
<option id="cbid.network.<%=ifname%>.type-normal" value="normal"<% if uci:get("network",ifname,"type") ~= "macvlan" and uci:get("network",ifname,"type") ~= "bridge" then %> selected="selected"<% end %>><%:Normal%></option>
<option id="cbid.network.<%=ifname%>.type-macvlan" value="macvlan"<% if uci:get("network",ifname,"type") == "macvlan" then %> selected="selected"<% end %>><%:MacVLAN%></option>
<option id="cbid.network.<%=ifname%>.type-bridge" value="bridge"<% if uci:get("network",ifname,"type") == "bridge" then %> selected="selected"<% end %>><%:Bridge%></option>
</select>
@ -485,7 +489,7 @@
<select class="cbi-input-select" data-update="change" id="cbid.network.<%=ifname%>.masterintf" name="cbid.network.<%=ifname%>.masterintf" size="1">
<%
for _, ifacea in ipairs(ifaces) do
if not (ifacea == "lo" or ifacea == "6in4-omr6in4" or ifacea:match("^ifb.*") or ifacea:match("^sit.*") or ifacea:match("^gre.*") or ifacea:match("^ip6.*") or ifacea:match("^teql.*") or ifacea:match("^erspan.*") or ifacea:match("^tun.*")) then
if not (ifacea == "lo" or ifacea == "6in4-omr6in4" or ifacea:match("^ifb.*") or ifacea:match("^sit.*") or ifacea:match("^gre.*") or ifacea:match("^ip6.*") or ifacea:match("^teql.*") or ifacea:match("^erspan.*") or ifacea:match("^tun.*")) and device_notvirtual(ifacea) then
%>
<option value="<%=ifacea%>"<% if uci:get("network",ifname,"masterintf") == ifacea then %> selected="selected"<% end %>><%=ifacea%></option>
<%
@ -713,6 +717,10 @@
<option value="master"<% if uci:get("network","ovpn" .. ifname,"multipath") == "master" then %> selected="selected"<% end %>><%:Master%></option>
<option value="backup"<% if uci:get("network","ovpn" .. ifname,"multipath") == "backup" then %> selected="selected"<% end %>><%:Backup%></option>
</select>
<br />
<div class="cbi-value-description">
<%:Only one interface must be set as "Master", this should be the most stable interface.%>
</div>
</div>
</div>
<% else %>
@ -736,15 +744,15 @@
local upload = "0"
download = uci:get("network",ifname,"downloadspeed") or "0"
upload = uci:get("network",ifname,"uploadspeed") or "0"
if download == "0" or upload == "0" then
if nixio.fs.access("/etc/init.d/sqm") then
download = uci:get("sqm",ifname,"download")
upload = uci:get("sqm",ifname,"upload")
else
download = uci:get("qos",ifname,"download")
upload = uci:get("qos",ifname,"upload")
end
end
--if download == "0" or upload == "0" then
-- if nixio.fs.access("/etc/init.d/sqm") then
-- download = uci:get("sqm",ifname,"download")
-- upload = uci:get("sqm",ifname,"upload")
-- else
-- download = uci:get("qos",ifname,"download")
-- upload = uci:get("qos",ifname,"upload")
-- end
--end
%>
<div class="cbi-value" data-index="14">
<label class="cbi-value-title"><%:MPTCP over VPN%></label>
@ -808,7 +816,7 @@
<select class="cbi-section-create-name" name="add_interface_ifname">
<%
for _, ifacea in ipairs(ifaces) do
if not (ifacea == "lo" or ifacea == "6in4-omr6in4" or ifacea == "mlvpn0" or ifacea:match("^ifb.*") or ifacea:match("^sit.*") or ifacea:match("^gre.*") or ifacea:match("^ip6.*") or ifacea:match("^teql.*") or ifacea:match("^erspan.*")) then
if not (ifacea == "lo" or ifacea == "6in4-omr6in4" or ifacea == "mlvpn0" or ifacea:match("^ifb.*") or ifacea:match("^sit.*") or ifacea:match("^gre.*") or ifacea:match("^ip6.*") or ifacea:match("^teql.*") or ifacea:match("^erspan.*")) and device_notvirtual(ifacea) then
%>
<option value="<%=ifacea%>"><%=ifacea%></option>
<%

View file

@ -1,7 +1,7 @@
msgid ""
msgstr ""
"PO-Revision-Date: 2020-10-21 12:55+0000\n"
"Last-Translator: Weblate Admin <contact@openmptcprouter.com>\n"
"PO-Revision-Date: 2020-12-01 17:19+0000\n"
"Last-Translator: Giuseppe Dipierro <giuseppe.dipierro@uania.com>\n"
"Language-Team: Italian <http://weblate.openmptcprouter.com/projects/omr/"
"luciapplicationsopenmptcprouter/it/>\n"
"Language: it\n"
@ -981,7 +981,7 @@ msgstr "Traffico VPN:"
#: luci-app-openmptcprouter/luasrc/view/openmptcprouter/wanstatus.htm:198
msgid "VPN tunnel DOWN"
msgstr "Tunnel VPN GIÙ"
msgstr "Tunnel VPN non stabilito"
#: luci-app-openmptcprouter/luasrc/view/openmptcprouter/settings.htm:41
msgid "VPS settings"
@ -1006,7 +1006,7 @@ msgstr ""
#: luci-app-openmptcprouter/luasrc/view/openmptcprouter/wizard.htm:39
msgid "Wizard"
msgstr "Mago"
msgstr "Wizard"
#: luci-app-openmptcprouter/luasrc/view/openmptcprouter/wanstatus.htm:75
#: luci-app-openmptcprouter/luasrc/view/openmptcprouter/wanstatus.htm:80

View file

@ -2,7 +2,7 @@ msgid ""
msgstr ""
"Project-Id-Version: \n"
"POT-Creation-Date: \n"
"PO-Revision-Date: 2020-11-09 14:31+0000\n"
"PO-Revision-Date: 2020-11-16 04:25+0000\n"
"Last-Translator: antrouter <xinyangla@188.com>\n"
"Language-Team: Chinese (Simplified) <http://weblate.openmptcprouter.com/"
"projects/omr/luciapplicationsopenmptcprouter/zh_Hans/>\n"
@ -1042,7 +1042,7 @@ msgstr "mtu :"
#: luci-app-openmptcprouter/luasrc/view/openmptcprouter/wanstatus.htm:543
#: luci-app-openmptcprouter/luasrc/view/openmptcprouter/wanstatus.htm:699
msgid "multipath:"
msgstr "多路"
msgstr "多路聚合"
#: luci-app-openmptcprouter/luasrc/view/openmptcprouter/wanstatus.htm:459
msgid "operator:"
@ -1062,7 +1062,7 @@ msgstr "漫游:"
#: luci-app-openmptcprouter/luasrc/view/openmptcprouter/wanstatus.htm:467
msgid "state:"
msgstr "位置:"
msgstr "状态:"
#: luci-app-openmptcprouter/luasrc/view/openmptcprouter/wanstatus.htm:546
#: luci-app-openmptcprouter/luasrc/view/openmptcprouter/wanstatus.htm:702

View file

@ -14,6 +14,10 @@ _set_intf_name() {
config_get device $intfname device
config_get modalias $intfname modalias
config_get ifname $intfname ifname
config_get type $intfname ifname
if [ "$type" = "tunnel" ] || [ "$type" = "bridge" ]; then
return
fi
[ -n "$modalias" ] && {
if [ -f /sys/class/net/${INTERFACE}/device/uevent ]; then
chk_modalias=$MODALIAS
@ -32,6 +36,7 @@ _set_intf_name() {
ip link set ${ifname} up
[ "$existif" = "1" ] && ip link set ${ifname}tmp ${$INTERFACE}
fi
fi
elif [ -f /dev/${DEVICE_NAME} ] && [ -n "$MODALIAS" ] && [ "$modalias" = "$MODALIAS" ]; then
if [ "$device" != "/dev/${DEVICE_NAME}" ]; then
ln -s /dev/${DEVICE_NAME} /dev/$intfname

View file

@ -45,14 +45,15 @@ omr_intf_set() {
if [ "$type" != "macvlan" ] && [ -n "$ifname" ] && [ -f /sys/class/net/${ifname}/device/uevent ]; then
devicepath=$(readlink -f /sys/class/net/${ifname})
if [ -n "$devicepath" ] && [ "$(echo ${devicepath} | grep virtual)" = "" ]; then
if [ -n "$devicepath" ] && [ "$(echo ${devicepath} | grep virtual)" = "" ] && [ "$(cat /sys/class/net/${ifname}/device/uevent | grep PRODUCT)" != "" ] && [ "$(cat /sys/class/net/${ifname}/device/uevent | grep PCI_SLOT_NAME)" = "" ]; then
uci -q set network.$1.modalias="$(cat /sys/class/net/${ifname}/device/uevent | grep MODALIAS | cut -d '=' -f2 | tr -d '\n')"
uci -q set network.$1.product="$(cat /sys/class/net/${ifname}/device/uevent | grep PRODUCT | cut -d '=' -f2 | tr -d '\n')"
elif [ -n "$devicepath" ] && [ "$(echo ${devicepath} | grep virtual)" != "" ]; then
elif [ -n "$devicepath" ] && ([ "$(echo ${devicepath} | grep virtual)" != "" ] || [ "$(echo ${devicepath} | grep virtual)" = "" ] && [ "$(cat /sys/class/net/${ifname}/device/uevent | grep PRODUCT)" = "" ] || [ "$(cat /sys/class/net/${ifname}/device/uevent | grep PCI_SLOT_NAME)" != "" ] || [ "$(cat /sys/class/net/${ifname}tmp/device/uevent)" != "" ]); then
uci -q delete network.$1.device
uci -q delete network.$1.modalias
uci -q delete network.$1.product
fi
elif [ "$type" != "macvlan" ] && [ -n "$device" ] && [ -f /sys/bus/usb-serial/devices/${devicename}/device/uevent ]; then
elif [ "$type" != "macvlan" ] && [ -n "$device" ] && [ -f /sys/bus/usb-serial/devices/${devicename}/device/uevent ] && [ "$(cat /sys/class/net/${ifname}/device/uevent | grep PRODUCT)" != "" ]; then
uci -q set network.$1.modalias="$(cat /sys/bus/usb-serial/devices/${devicename}/device/uevent | grep MODALIAS | cut -d '=' -f2 | tr -d '\n')"
uci -q set network.$1.product="$(cat /sys/bus/usb-serial/devices/${devicename}/device/uevent | grep PRODUCT | cut -d '=' -f2 | tr -d '\n')"
fi

View file

@ -1,5 +1,4 @@
net.ipv4.tcp_keepalive_time=7200
net.ipv6.conf.all.disable_ipv6=0
net.ipv4.tcp_fin_timeout=60
net.ipv4.tcp_syn_retries=3
net.ipv4.tcp_retries1=3

View file

@ -107,6 +107,12 @@ if [ "$(uci -q get openmptcprouter.settings.scaling_governor)" = "" ]; then
commit openmptcprouter
EOF
fi
if [ "$(uci -q get openmptcprouter.settings.menu)" = "" ]; then
uci -q batch <<-EOF >/dev/null
set openmptcprouter.settings.menu='OpenMPTCProuter'
commit openmptcprouter
EOF
fi
sed -i 's/net.ipv4.tcp_retries2=3$/net.ipv4.tcp_retries2=15/' /etc/sysctl.d/zzz_openmptcprouter.conf

View file

@ -703,6 +703,9 @@ function interfaces_status()
local tracker_port = uci:get("shadowsocks-libev","tracker","local_port")
if mArray.openmptcprouter["external_check"] ~= false then
mArray.openmptcprouter["ss_addr"] = ut.trim(sys.exec("curl -s -4 --socks5 " .. tracker_ip .. ":" .. tracker_port .. " -m " .. timeout .. " " .. check_ipv4_website))
if mArray.openmptcprouter["ss_addr"] == "" then
mArray.openmptcprouter["ss_addr"] = ut.trim(sys.exec("curl -s -4 --socks5 " .. tracker_ip .. ":" .. tracker_port .. " -m " .. timeout .. " ifconfig.co"))
end
--mArray.openmptcprouter["ss_addr6"] = sys.exec("curl -s -6 --socks5 " .. tracker_ip .. ":" .. tracker_port .. " -m 3 http://ipv6.openmptcprouter.com")
end
end

View file

@ -0,0 +1,14 @@
# Copyright 2020 Wojciech Jowsa (wojciech.jowsa@gmail.com)
# This is free software, licensed under the Apache License, Version 2.0
include $(TOPDIR)/rules.mk
LUCI_TITLE:=Packet capture application
LUCI_DEPENDS:=+luci-mod-admin-full +tcpdump +uhttpd-mod-ubus +coreutils +coreutils-timeout
PKG_MAINTAINER:=Wojciech Jowsa <wojciech.jowsa@gmail.com>
PKG_LICENSE:=Apache-2.0
include $(TOPDIR)/feeds/luci/luci.mk
# call BuildPackage - OpenWrt buildroot signatureet

View file

@ -0,0 +1,287 @@
'use strict';
'require rpc';
'require uci';
'require ui';
'require fs';
'require form';
'require network';
'require tools.widgets as widgets';
var eventSource,
captureFilePoll,
hostName;
function stopTcpdump() {
fs.exec("/usr/libexec/packet_capture_stop").then(function(replay) {
if (eventSource)
eventSource.close();
}.bind(this)).catch(function(error) {
console.log(error);
});
}
window.addEventListener('beforeunload', stopTcpdump);
var callLuciProcessList = rpc.declare({
object: 'luci',
method: 'getProcessList',
expect: { result: [] }
});
var callInitAction = rpc.declare({
object: 'luci',
method: 'setInitAction',
params: [ 'name', 'action' ],
expect: { result: false }
});
function addOutput() {
var tcpdumpOut = document.querySelectorAll('[id$="tcpdump_out"]')[0];
if (tcpdumpOut)
return;
var frameEl = E('div', {'class': 'cbi-value'});
frameEl.appendChild(E('textarea', {
'id': 'tcpdump_out',
'class': 'cbi-input-textarea',
'readonly': '',
'style': 'width:100%',
'rows': 30,
}));
frameEl.firstElementChild.style.fontFamily = 'monospace';
var downloadBtn = document.querySelectorAll('[id$="download_file"]')[0];
if (downloadBtn)
downloadBtn.parentNode.insertBefore(frameEl, downloadBtn.nextSibling);
}
var downloadCaptureFile = function(ev) {
var form = E('form', {
method: 'post',
action: '/cgi-bin/cgi-download',
enctype: 'application/x-www-form-urlencoded'
}, E('input', { type: 'hidden', name: 'sessionid', value: rpc.getSessionID()},
E('input', { type: 'hidden', name: 'path', value: "/tmp/capture.pcap"},
E('input', { type: 'hidden', name: 'filename', value: hostName + "-" + Date.now() + ".pcap"},
E('input', { type: 'hidden', name: 'mimetype', value: 'application/vnd.tcpdump.pcap'}
)))));
ev.currentTarget.parentNode.appendChild(form);
form.submit();
form.parentNode.removeChild(form);
}
function subscribeTcpdump() {
if (eventSource)
eventSource.close();
eventSource = new EventSource('/ubus/subscribe/tcpdump' + '?' + rpc.getSessionID());
eventSource.onerror = function(event) {
eventSource.close();
console.log(event);
};
addOutput();
var textOut = document.querySelectorAll('[id$="tcpdump_out"]')[0];
textOut.value = "";
eventSource.addEventListener("tcpdump.data", function(event) {
textOut.value = textOut.value + "\n" + JSON.parse(event.data).data;
});
}
function updateButtons() {
var tasks = [];
tasks.push(fs.stat("/var/run/packet_capture.pid").then(L.bind(function(res) {
var downloadBtn = document.querySelectorAll('[id$="download_file"]')[0];
if (!downloadBtn)
return;
if (!eventSource || eventSource.readyState == 2)
subscribeTcpdump();
var textOut = document.querySelectorAll('[id$="tcpdump_out"]')[0];
if (textOut)
textOut.style.borderColor = "green";
var startBtn = document.querySelectorAll('[id$="start_tcpdump"]')[0];
if (startBtn)
startBtn.hidden = true;
var stopBtn = document.querySelectorAll('[id$="stop_tcpdump"]')[0];
if (stopBtn)
stopBtn.hidden = false;
return;
})).catch(function(error) {
var textOut = document.querySelectorAll('[id$="tcpdump_out"]')[0];
if (textOut)
textOut.style.borderColor = "red";
var startBtn = document.querySelectorAll('[id$="start_tcpdump"]')[0];
if (startBtn)
startBtn.hidden = false;
var stopBtn = document.querySelectorAll('[id$="stop_tcpdump"]')[0];
if (stopBtn)
stopBtn.hidden = true;
if (eventSource)
eventSource.close();
}));
return Promise.all(tasks);
}
function updatePollCheckCaptureFileExists() {
checkCaptureFileExists();
L.Poll.remove(captureFilePoll);
L.Poll.add(L.bind(checkCaptureFileExists, m),5);
}
function checkCaptureFileExists() {
var tasks = [];
tasks.push(fs.stat("/tmp/capture.pcap").then(L.bind(function(res) {
var downloadBtn = document.querySelector('[data-action="download"]');
if (!downloadBtn)
return;
var downloadCheckBox = document.querySelectorAll('[data-widget-id$="file"]')[0].checked;
if (!downloadCheckBox) {
fs.remove("/tmp/capture.pcap").then(function(replay) {
downloadBtn.disabled = true;;
}.bind(this)).catch(function(error) {
console.log(error);
});
} else {
downloadBtn.disabled = false;
}
})).catch(function(error) {
var downloadBtn = document.querySelector('[data-action="download"]');
if (downloadBtn)
downloadBtn.disabled = true;
}));
return Promise.all(tasks);
}
return L.view.extend({
load: function() {
return Promise.all([
uci.load('system')
]);
},
handleDownload: function(ev) {
downloadCaptureFile(ev);
},
render: function(processes) {
var m, s, o;
hostName = uci.get('system', '@system[0]', 'hostname');
m = new form.Map('packet_capture', _('Packet Capture - Tcpdump'), _('Capture packets with tcpdump.'));
s = m.section(form.TypedSection, 'tcpdump');
s.anonymous = 1;
o = s.option(widgets.DeviceSelect, 'interface', _('Interface'), _(''));
o.noaliases = true;
o.modalonly = true;
o.rmempty = false;
o.filter = function(section_id, value) {
return true;
}
o = s.option(form.Value, 'filter', _('Filter'), _('Tcpdump filter like protocol, port etc.'));
o.modalonly = false;
o.datatype = 'and(minlength(1),maxlength(1024))';
o = s.option(form.Value, 'duration', _('Duration'), _('Duration of packet capturing in seconds.'));
o.modalonly = false;
o.datatype = 'range(1,4294967296)';
o = s.option(form.Value, 'packets', _('Packets'), _('Number of packets to be captured.'));
o.modalonly = false;
o.datatype = 'range(1,4294967296)';
o = s.option(form.Flag, 'domains', _('Resolve domains'), _("Convert host addresses to names."));
o = s.option(form.Flag, 'verbose', _('Verbose output'), _("Print the link-level header on each dump line."));
o = s.option(form.Flag, 'file', _('Save to file'), _("Save capture to pcap file."));
o = s.option(form.Button, 'start_tcpdump', _('Start tcpdump'), _(''));
o.inputstyle = 'apply';
o.onclick = ui.createHandlerFn(this, function(section_id, ev) {
var downloadBtn = document.querySelector('[data-action="download"]');
if (!downloadBtn)
return;
fs.remove("/tmp/capture.pcap").then(function(replay) {
downloadBtn.disabled = true;;
}.bind(this)).catch(function(error) {
console.log(error);
});
var iface = document.querySelectorAll('[id$="interface"]')[1].value,
filter = document.querySelectorAll('[id$="filter"]')[2].value,
packets = document.querySelectorAll('[id$="packets"]')[2].value,
duration = document.querySelectorAll('[id$="duration"]')[2].value,
verbose = document.querySelectorAll('[data-widget-id$="verbose"]')[0].checked,
domains = document.querySelectorAll('[data-widget-id$="domains"]')[0].checked,
file = document.querySelectorAll('[data-widget-id$="file"]')[0].checked
var args = {
"interface": iface,
"filter": filter,
"packets": packets,
"duration": duration,
"verbose": verbose,
"domains": domains,
"file": file
}
return fs.exec_direct('/usr/libexec/packet_capture_start', [JSON.stringify(args)]).then(function(replay) {
var error_position = replay.search("error:");
if (error_position != -1){
ui.showModal(_(replay.substring(error_position + 6, replay.length)), [
E('div', { 'class': 'right' }, [
E('button', {
'class': 'cbi-button cbi-button-negative important',
'click': function(ev) {
ui.hideModal();
}
}, _('Close')),
])
]);
return;
}
rpc.list.apply(rpc).then(function(res) {
for (var k in res) {
if (res[k] == "tcpdump" )
subscribeTcpdump()
}
}.bind(this));
}.bind(this)).catch(function(error) {
console.log(error);
});
});
o = s.option(form.Button, 'stop_tcpdump', _('Stop tcpdump'), _(''));
o.inputstyle = 'apply';
o.onclick = ui.createHandlerFn(this, function(section_id, ev) {
if (!eventSource)
return;
return fs.exec("/usr/libexec/packet_capture_stop").then(function(replay) {
eventSource.close();
}.bind(this)).catch(function(error) {
console.log(error);
});
});
o = s.option(form.Button, 'download_file', _('Download capture file'));
o.inputstyle = 'action important';
o.inputtitle = _('Download');
o.data_action = 'download'
o.onclick = this.handleDownload;
L.Poll.add(L.bind(updateButtons, m),1);
captureFilePoll = L.bind(updatePollCheckCaptureFileExists, m);
L.Poll.add(captureFilePoll,1);
return m.render();
},
});

View file

@ -0,0 +1 @@
config tcpdump

View file

@ -0,0 +1,64 @@
#!/usr/bin/env lua
local ubus = require "ubus"
local fs = require "nixio.fs"
local conn = ubus.connect()
if not conn then
error("Failed to connect to ubus")
return
end
local args = "-n"
local duration = ""
if arg[1] ~= nil then
args = arg[1]
if arg[2] ~= "" then
duration = arg[2]
end
end
local filter = fs.stat("/tmp/tcpdump_filter")
if filter then
args = args .. " -F /tmp/tcpdump_filter"
end
local ubus_objects = {
tcpdump = {
}
}
conn:add( ubus_objects )
os.execute("sleep 1")
local command = "tcpdump -l " .. args .. " 2>&1"
if duration ~= "" then
command = "timeout " .. duration .. " " .. command
end
local pipe = io.popen(command)
for line in pipe:lines() do
local params = {
data = line
}
conn:notify(ubus_objects.tcpdump.__ubusobj, "tcpdump.data", params)
end
local pcap = fs.stat("/tmp/capture.pcap0")
if pcap then
fs.move("/tmp/capture.pcap0","/tmp/capture.pcap")
fs.remove("/tmp/capture.pcap1")
end
if filter then
fs.remove("/tmp/tcpdump_filter")
end
conn:close()
pipe:close()
fs.remove("/var/run/packet_capture.pid")

View file

@ -0,0 +1,69 @@
#!/bin/sh
. /usr/share/libubox/jshn.sh
PIDFILE="/var/run/packet_capture.pid"
if [ -f "$PIDFILE"];then
echo "error: Packet capture is running"
exit 1
fi
json_load "$1"
json_get_var interface interface
json_get_var filter filter
json_get_var duration duration
json_get_var packets packets
json_get_var verbose verbose
json_get_var domains domains
json_get_var file file
args="-n"
if [ "$domains" == "1" ];then
args=""
fi
if [ -n "$interface" ];then
ip a show "$interface" > /dev/null 2>&1
if [ "$?" == "1" ]; then
echo "error: Incorrect format of an interface"
exit 1
fi
args="$args -i $interface"
fi
if [ -n "$packets" ];then
echo "$packets" | egrep '^[0-9]*$'
if [ "$?" -eq 0 ];then
args="$args -c $packets"
else
echo "error: Incorrect packets argument"
exit 1
fi
fi
if [ "$verbose" == "1" ];then
args="$args -e"
fi
if [ "$file" == "1" ];then
mem=$(awk '/MemTotal/ {print $2}' /proc/meminfo)
args="$args -W 2 -C $((mem/(1024 * 10))) -w /tmp/capture.pcap -z /usr/libexec/packet_capture_stop"
fi
if [ -n "$filter" ];then
tcpdump -i lo -d "$filter" >/dev/null 2>/dev/null
if [ $? -eq 1 ];then
echo "error: Incorrect filter argument"
exit 1
fi
echo "$filter" > /tmp/tcpdump_filter
fi
(/usr/libexec/packet_capture "$args" "$duration")&
echo $! > /var/run/packet_capture.pid
exit 0

View file

@ -0,0 +1,9 @@
#!/bin/sh
pid=$(cat /var/run/packet_capture.pid)
if [ -n "$pid" ] && grep -sq packet_capture "/proc/$pid/cmdline"; then
ppid=$(pgrep -P $pid)
kill -TERM $ppid
fi
exit 0

View file

@ -0,0 +1,18 @@
{
"admin/services/packet_capture": {
"title": "Packet Capture",
"order": 90,
"action": {
"type": "view",
"path": "packet_capture/tcpdump"
},
"depends" : {
"acl": [ "luci-app-packet-capture" ],
"uci": { "packet_capture": true },
"fs": { "/usr/libexec/packet_capture": "executable",
"/usr/libexec/packet_capture_start": "executable",
"/usr/libexec/packet_capture_stop": "executable"
}
}
}
}

View file

@ -0,0 +1,25 @@
{
"luci-app-packet-capture": {
"description": "Grant access to tcpdump ubus object",
"read": {
"cgi-io": [ "download", "exec" ],
"ubus": {
"tcpdump": [ "*" ],
"luci": [ "getProcessList" ]
},
"uci": [ "packet_capture", "system" ],
"file": {
"/tmp/capture.pcap": [ "read" ]
}
},
"write": {
"uci": [ "packet_capture" ],
"file": {
"/usr/libexec/packet_capture_start": [ "exec" ],
"/usr/libexec/packet_capture_stop": [ "exec" ],
"/usr/libexec/packet_capture": [ "exec" ],
"/tmp/capture.pcap": [ "write" ]
}
}
}
}

View file

@ -1,7 +1,7 @@
msgid ""
msgstr ""
"PO-Revision-Date: 2020-09-15 11:36+0000\n"
"Last-Translator: Weblate Admin <contact@openmptcprouter.com>\n"
"PO-Revision-Date: 2020-12-01 10:49+0000\n"
"Last-Translator: Giuseppe Dipierro <giuseppe.dipierro@uania.com>\n"
"Language-Team: Italian <http://weblate.openmptcprouter.com/projects/omr/"
"luciapplicationsshutdown/it/>\n"
"Language: it\n"
@ -21,11 +21,11 @@ msgstr "Eseguire l&#39;arresto"
#: luci-app-shutdown/htdocs/luci-static/resources/view/system/shutdown.js:9
#: luci-app-shutdown/root/usr/share/luci/menu.d/luci-app-shutdown.json:3
msgid "Shutdown"
msgstr "Spegnimento"
msgstr "Spegni"
#: luci-app-shutdown/htdocs/luci-static/resources/view/system/shutdown.js:10
msgid "Shutdown the operating system of your device"
msgstr "Arresta il sistema operativo del tuo dispositivo"
msgstr "Arresta il dispositivo"
#: luci-app-shutdown/htdocs/luci-static/resources/view/system/shutdown.js:31
msgid "The poweroff command failed with code %d"

View file

@ -1,6 +1,6 @@
msgid ""
msgstr ""
"PO-Revision-Date: 2020-06-28 08:34+0000\n"
"PO-Revision-Date: 2020-12-04 16:03+0000\n"
"Last-Translator: antrouter <xinyangla@188.com>\n"
"Language-Team: Chinese (Simplified) <http://weblate.openmptcprouter.com/"
"projects/omr/luciapplicationssnmpd/zh_Hans/>\n"
@ -144,7 +144,7 @@ msgstr "SNMPd设置界面蚂蚁测试版"
#: luci-app-snmpd/luasrc/model/cbi/snmpd.lua:32
msgid "Server"
msgstr "服务"
msgstr "服务"
#: luci-app-snmpd/luasrc/model/cbi/snmpd.lua:37
msgid "Source"

View file

@ -1,8 +1,11 @@
#
# Copyright 2019-2020 ZHANG Zhao <Zhao.Zhang2@etu.univ-grenoble-alpes.fr>
# Copyright 2020 Ycarus (Yannick Chabanois) <ycarus@zugaina.org> for OpenMPTCProuter
#
# This is free software, licensed under the Apache License, Version 2.0 .
#
# Based on openwrt luci commit 03c77dafe3cfb922b995adfe9c0f8a75c98a18af
#
include $(TOPDIR)/rules.mk

View file

@ -25,15 +25,15 @@ return baseclass.extend({
var container_wapper = E('div', { 'class': 'router-status-lan dashboard-bg box-s1' });
var container_box = E('div', { 'class': 'lan-info devices-list' });
var container_devices = E('div', { 'class': 'table assoclist devices-info' }, [
E('div', { 'class': 'tr table-titles dashboard-bg' }, [
E('div', { 'class': 'th nowrap' }, _('Hostname')),
E('div', { 'class': 'th' }, _('IP Address')),
E('div', { 'class': 'th' }, _('MAC')),
var container_devices = E('table', { 'class': 'table assoclist devices-info' }, [
E('tr', { 'class': 'tr table-titles dashboard-bg' }, [
E('th', { 'class': 'th nowrap' }, _('Hostname')),
E('th', { 'class': 'th' }, _('IP Address')),
E('th', { 'class': 'th' }, _('MAC')),
])
]);
var container_deviceslist = E('div', { 'class': 'table assoclist devices-info' });
var container_deviceslist = E('table', { 'class': 'table assoclist devices-info' });
container_box.appendChild(E('div', { 'class': 'title'}, [
E('img', {
@ -48,21 +48,21 @@ return baseclass.extend({
for(var idx in this.params.lan.devices) {
var deivce = this.params.lan.devices[idx];
container_deviceslist.appendChild(E('div', { 'class': 'tr cbi-rowstyle-1'}, [
container_deviceslist.appendChild(E('tr', { 'class': 'tr cbi-rowstyle-1'}, [
E('div', { 'class': 'td device-info'}, [
E('td', { 'class': 'td device-info'}, [
E('p', {}, [
E('span', { 'class': 'd-inline-block'}, [ deivce.hostname ]),
]),
]),
E('div', { 'class': 'td device-info'}, [
E('td', { 'class': 'td device-info'}, [
E('p', {}, [
E('span', { 'class': 'd-inline-block'}, [ deivce.ipv4 ]),
]),
]),
E('div', { 'class': 'td device-info'}, [
E('td', { 'class': 'td device-info'}, [
E('p', {}, [
E('span', { 'class': 'd-inline-block'}, [ deivce.macaddr ]),
]),

Some files were not shown because too many files have changed in this diff Show more