diff --git a/dsvpn/files/init b/dsvpn/files/init index 73a3457a3..250c409df 100755 --- a/dsvpn/files/init +++ b/dsvpn/files/init @@ -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 diff --git a/glorytun-udp/init b/glorytun-udp/init index b9a18c526..5bb5a9a5d 100755 --- a/glorytun-udp/init +++ b/glorytun-udp/init @@ -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) +# Copyright (C) 2017-2020 Ycarus (Yannick Chabanois) START=90 STOP=10 @@ -19,22 +19,20 @@ _err() { } validate_section() { - uci_validate_section glorytun glorytun "${1}" \ + uci_validate_section glorytun-udp glorytun-udp "${1}" \ 'enable:bool:0' \ + 'mode:string' \ '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' \ + '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 +40,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 +60,13 @@ start_instance() { procd_open_instance procd_set_param command ${PROG} \ - ${bind:+bind from "$bind"} \ - ${bindport:+port "$bindport"} \ - ${host:+to addr "$host"} \ + ${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 +100,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() { diff --git a/glorytun/glorytun.config b/glorytun/glorytun.config index 9ee6e41e6..33c93f36f 100644 --- a/glorytun/glorytun.config +++ b/glorytun/glorytun.config @@ -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' \ No newline at end of file + option multiqueue '1' + option label 'Default VPN' \ No newline at end of file diff --git a/glorytun/init b/glorytun/init index 5d0233157..f5b868323 100755 --- a/glorytun/init +++ b/glorytun/init @@ -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 diff --git a/luci-app-dsvpn/Makefile b/luci-app-dsvpn/Makefile index d78150d98..cc5052f9d 100644 --- a/luci-app-dsvpn/Makefile +++ b/luci-app-dsvpn/Makefile @@ -1,11 +1,11 @@ # -# Copyright (C) 2018-2019 Ycarus (Yannick Chabanois) for OpenMPTCProuter +# Copyright (C) 2018-2020 Ycarus (Yannick Chabanois) # # include $(TOPDIR)/rules.mk -LUCI_TITLE:=LuCI Support for DSVPN +LUCI_TITLE:=LuCI Interface to DSVPN LUCI_DEPENDS:=+dsvpn PKG_LICENSE:=GPLv3 diff --git a/luci-app-dsvpn/htdocs/luci-static/resources/view/services/dsvpn.js b/luci-app-dsvpn/htdocs/luci-static/resources/view/services/dsvpn.js new file mode 100644 index 000000000..2f737b571 --- /dev/null +++ b/luci-app-dsvpn/htdocs/luci-static/resources/view/services/dsvpn.js @@ -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.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; + + o = s.option(form.Value, 'label', _('Label')); + o.rmempty = true; + + return m.render(); + } +}); diff --git a/luci-app-dsvpn/luasrc/controller/dsvpn.lua b/luci-app-dsvpn/luasrc/controller/dsvpn.lua deleted file mode 100644 index 99793584a..000000000 --- a/luci-app-dsvpn/luasrc/controller/dsvpn.lua +++ /dev/null @@ -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 diff --git a/luci-app-dsvpn/luasrc/model/cbi/dsvpn.lua b/luci-app-dsvpn/luasrc/model/cbi/dsvpn.lua deleted file mode 100644 index d0c6a3141..000000000 --- a/luci-app-dsvpn/luasrc/model/cbi/dsvpn.lua +++ /dev/null @@ -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 diff --git a/luci-app-dsvpn/po/de/dsvpn.po b/luci-app-dsvpn/po/de/dsvpn.po deleted file mode 100644 index 4bea475af..000000000 --- a/luci-app-dsvpn/po/de/dsvpn.po +++ /dev/null @@ -1,50 +0,0 @@ -msgid "" -msgstr "" -"PO-Revision-Date: 2020-10-05 12:39+0000\n" -"Last-Translator: Weblate Admin \n" -"Language-Team: German \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" diff --git a/luci-app-dsvpn/po/fr/dsvpn.po b/luci-app-dsvpn/po/fr/dsvpn.po deleted file mode 100644 index 8f06d0390..000000000 --- a/luci-app-dsvpn/po/fr/dsvpn.po +++ /dev/null @@ -1,53 +0,0 @@ -msgid "" -msgstr "" -"Project-Id-Version: \n" -"POT-Creation-Date: \n" -"PO-Revision-Date: 2020-09-30 08:50+0000\n" -"Last-Translator: Anonymous \n" -"Language-Team: French \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 -msgid "DSVPN" -msgstr "DSVPN" - -#: luci-app-dsvpn/luasrc/model/cbi/dsvpn.lua:12 -msgid "Enable" -msgstr "Activer" - -#: luci-app-dsvpn/luasrc/model/cbi/dsvpn.lua:39 -msgid "Interface name" -msgstr "Nom de l'interface" - -#: luci-app-dsvpn/luasrc/model/cbi/dsvpn.lua:26 -msgid "Key" -msgstr "Clé" - -#: 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/luasrc/model/cbi/dsvpn.lua:21 -msgid "Remote port" -msgstr "Port 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 "Adresse IP locale du tunnel" - -#: luci-app-dsvpn/luasrc/model/cbi/dsvpn.lua:35 -msgid "Tunnel remote IP" -msgstr "Adresse IP distance du tunnel" diff --git a/luci-app-dsvpn/po/it/dsvpn.po b/luci-app-dsvpn/po/it/dsvpn.po deleted file mode 100644 index dd2cd86a2..000000000 --- a/luci-app-dsvpn/po/it/dsvpn.po +++ /dev/null @@ -1,50 +0,0 @@ -msgid "" -msgstr "" -"PO-Revision-Date: 2020-09-21 12:51+0000\n" -"Last-Translator: Weblate Admin \n" -"Language-Team: Italian \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" diff --git a/luci-app-dsvpn/po/oc/dsvpn.po b/luci-app-dsvpn/po/oc/dsvpn.po deleted file mode 100644 index 4a806fe56..000000000 --- a/luci-app-dsvpn/po/oc/dsvpn.po +++ /dev/null @@ -1,50 +0,0 @@ -msgid "" -msgstr "" -"PO-Revision-Date: 2020-08-18 17:37+0000\n" -"Last-Translator: Quentin PAGÈS \n" -"Language-Team: Occitan \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 l’interfà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" diff --git a/luci-app-dsvpn/po/templates/dsvpn.pot b/luci-app-dsvpn/po/templates/dsvpn.pot deleted file mode 100644 index bc26ff694..000000000 --- a/luci-app-dsvpn/po/templates/dsvpn.pot +++ /dev/null @@ -1,41 +0,0 @@ -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 -msgid "DSVPN" -msgstr "" - -#: 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 "" - -#: luci-app-dsvpn/luasrc/model/cbi/dsvpn.lua:35 -msgid "Tunnel remote IP" -msgstr "" diff --git a/luci-app-dsvpn/po/zh_Hans/dsvpn.po b/luci-app-dsvpn/po/zh_Hans/dsvpn.po deleted file mode 100644 index f847c0504..000000000 --- a/luci-app-dsvpn/po/zh_Hans/dsvpn.po +++ /dev/null @@ -1,50 +0,0 @@ -msgid "" -msgstr "" -"PO-Revision-Date: 2020-06-11 16:36+0000\n" -"Last-Translator: antrouter \n" -"Language-Team: Chinese (Simplified) \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-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" diff --git a/luci-app-dsvpn/po/zh_Hant/dsvpn.po b/luci-app-dsvpn/po/zh_Hant/dsvpn.po deleted file mode 100644 index 858741a28..000000000 --- a/luci-app-dsvpn/po/zh_Hant/dsvpn.po +++ /dev/null @@ -1,50 +0,0 @@ -msgid "" -msgstr "" -"PO-Revision-Date: 2020-07-09 07:31+0000\n" -"Last-Translator: antrouter \n" -"Language-Team: Chinese (Traditional) \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" diff --git a/luci-app-dsvpn/root/usr/share/luci/menu.d/luci-app-dsvpn.json b/luci-app-dsvpn/root/usr/share/luci/menu.d/luci-app-dsvpn.json index 257a29fab..49ebec311 100644 --- a/luci-app-dsvpn/root/usr/share/luci/menu.d/luci-app-dsvpn.json +++ b/luci-app-dsvpn/root/usr/share/luci/menu.d/luci-app-dsvpn.json @@ -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" ] diff --git a/luci-app-dsvpn/root/usr/share/rpcd/acl.d/luci-app-dsvpn.json b/luci-app-dsvpn/root/usr/share/rpcd/acl.d/luci-app-dsvpn.json index c4c7f00c9..e11c9127c 100644 --- a/luci-app-dsvpn/root/usr/share/rpcd/acl.d/luci-app-dsvpn.json +++ b/luci-app-dsvpn/root/usr/share/rpcd/acl.d/luci-app-dsvpn.json @@ -1,6 +1,6 @@ { "luci-app-dsvpn": { - "description": "Grant UCI access for luci-app-dsvpn", + "description": "Grant access to DSVPN", "read": { "uci": [ "dsvpn" ] }, diff --git a/luci-app-glorytun-tcp/Makefile b/luci-app-glorytun-tcp/Makefile new file mode 100644 index 000000000..80d97c856 --- /dev/null +++ b/luci-app-glorytun-tcp/Makefile @@ -0,0 +1,16 @@ +# +# Copyright (C) 2018-2020 Ycarus (Yannick Chabanois) +# +# + +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 diff --git a/luci-app-glorytun-tcp/htdocs/luci-static/resources/view/services/glorytun-tcp.js b/luci-app-glorytun-tcp/htdocs/luci-static/resources/view/services/glorytun-tcp.js new file mode 100644 index 000000000..e4045f267 --- /dev/null +++ b/luci-app-glorytun-tcp/htdocs/luci-static/resources/view/services/glorytun-tcp.js @@ -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.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; + + o = s.taboption('general',form.Value, 'label', _('Label')); + o.rmempty = true; + + return m.render(); + } +}); diff --git a/luci-app-glorytun/root/etc/hotplug.d/iface/30-glorytun b/luci-app-glorytun-tcp/root/etc/hotplug.d/iface/30-glorytun similarity index 100% rename from luci-app-glorytun/root/etc/hotplug.d/iface/30-glorytun rename to luci-app-glorytun-tcp/root/etc/hotplug.d/iface/30-glorytun diff --git a/luci-app-glorytun/root/etc/uci-defaults/1200-luci-glorytun b/luci-app-glorytun-tcp/root/etc/uci-defaults/1200-luci-glorytun similarity index 100% rename from luci-app-glorytun/root/etc/uci-defaults/1200-luci-glorytun rename to luci-app-glorytun-tcp/root/etc/uci-defaults/1200-luci-glorytun diff --git a/luci-app-glorytun-tcp/root/usr/share/luci/menu.d/luci-app-glorytun-tcp.json b/luci-app-glorytun-tcp/root/usr/share/luci/menu.d/luci-app-glorytun-tcp.json new file mode 100644 index 000000000..03e7dcf7a --- /dev/null +++ b/luci-app-glorytun-tcp/root/usr/share/luci/menu.d/luci-app-glorytun-tcp.json @@ -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" ] + } + } +} diff --git a/luci-app-glorytun/root/usr/share/rpcd/acl.d/luci-app-glorytun.json b/luci-app-glorytun-tcp/root/usr/share/rpcd/acl.d/luci-app-glorytun-tcp.json similarity index 51% rename from luci-app-glorytun/root/usr/share/rpcd/acl.d/luci-app-glorytun.json rename to luci-app-glorytun-tcp/root/usr/share/rpcd/acl.d/luci-app-glorytun-tcp.json index 63a49918f..f4f288835 100644 --- a/luci-app-glorytun/root/usr/share/rpcd/acl.d/luci-app-glorytun.json +++ b/luci-app-glorytun-tcp/root/usr/share/rpcd/acl.d/luci-app-glorytun-tcp.json @@ -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" ] }, diff --git a/luci-app-glorytun-udp/Makefile b/luci-app-glorytun-udp/Makefile new file mode 100644 index 000000000..97608e0e7 --- /dev/null +++ b/luci-app-glorytun-udp/Makefile @@ -0,0 +1,16 @@ +# +# Copyright (C) 2018-2020 Ycarus (Yannick Chabanois) +# +# + +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 diff --git a/luci-app-glorytun-udp/htdocs/luci-static/resources/view/services/glorytun-udp.js b/luci-app-glorytun-udp/htdocs/luci-static/resources/view/services/glorytun-udp.js new file mode 100644 index 000000000..2975af525 --- /dev/null +++ b/luci-app-glorytun-udp/htdocs/luci-static/resources/view/services/glorytun-udp.js @@ -0,0 +1,104 @@ +'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.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; + + o = s.taboption('general',form.Value, 'label', _('Label')); + o.rmempty = true; + + return m.render(); + } +}); diff --git a/luci-app-glorytun-udp/root/etc/config/glorytun-udp b/luci-app-glorytun-udp/root/etc/config/glorytun-udp new file mode 100644 index 000000000..d5d356dd6 --- /dev/null +++ b/luci-app-glorytun-udp/root/etc/config/glorytun-udp @@ -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' diff --git a/luci-app-glorytun-udp/root/etc/hotplug.d/iface/30-glorytun-udp b/luci-app-glorytun-udp/root/etc/hotplug.d/iface/30-glorytun-udp new file mode 100644 index 000000000..b942fd60c --- /dev/null +++ b/luci-app-glorytun-udp/root/etc/hotplug.d/iface/30-glorytun-udp @@ -0,0 +1,28 @@ +#!/bin/sh +# +# Load the glorytun config +# +# Author: Ycarus (Yannick Chabanois) +# 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 + [ "$remoteip" != "" ] && [ "$localip" != "" ] && ifconfig $DEVICE $localip pointopoint $remoteip up + } +} + +config_load glorytun-udp +config_foreach set_default glorytun-udp diff --git a/luci-app-glorytun-udp/root/etc/uci-defaults/1201-luci-glorytun-udp b/luci-app-glorytun-udp/root/etc/uci-defaults/1201-luci-glorytun-udp new file mode 100644 index 000000000..dbecf5b5b --- /dev/null +++ b/luci-app-glorytun-udp/root/etc/uci-defaults/1201-luci-glorytun-udp @@ -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 diff --git a/luci-app-glorytun-udp/root/usr/share/luci/menu.d/luci-app-glorytun-udp.json b/luci-app-glorytun-udp/root/usr/share/luci/menu.d/luci-app-glorytun-udp.json new file mode 100644 index 000000000..b84551484 --- /dev/null +++ b/luci-app-glorytun-udp/root/usr/share/luci/menu.d/luci-app-glorytun-udp.json @@ -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" ] + } + } +} diff --git a/luci-app-glorytun-udp/root/usr/share/rpcd/acl.d/luci-app-glorytun-udp.json b/luci-app-glorytun-udp/root/usr/share/rpcd/acl.d/luci-app-glorytun-udp.json new file mode 100644 index 000000000..3e24adb8e --- /dev/null +++ b/luci-app-glorytun-udp/root/usr/share/rpcd/acl.d/luci-app-glorytun-udp.json @@ -0,0 +1,11 @@ +{ + "luci-app-glorytun-udp": { + "description": "Grant access to glorytun UDP", + "read": { + "uci": [ "glorytun-udp" ] + }, + "write": { + "uci": [ "glorytun-udp" ] + } + } +} \ No newline at end of file diff --git a/luci-app-glorytun/Makefile b/luci-app-glorytun/Makefile deleted file mode 100644 index b582773b2..000000000 --- a/luci-app-glorytun/Makefile +++ /dev/null @@ -1,21 +0,0 @@ -# -# Copyright (C) 2008-2014 The LuCI Team -# Copyright (C) 2017-2019 Ycarus (Yannick Chabanois) -# -# 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) - -#include ../luci/luci.mk -include $(TOPDIR)/feeds/luci/luci.mk - -# call BuildPackage - OpenWrt buildroot signature diff --git a/luci-app-glorytun/luasrc/controller/glorytun.lua b/luci-app-glorytun/luasrc/controller/glorytun.lua deleted file mode 100644 index c9917bb74..000000000 --- a/luci-app-glorytun/luasrc/controller/glorytun.lua +++ /dev/null @@ -1,14 +0,0 @@ --- Copyright 2018 - 2019 Ycarus (Yannick Chabanois) --- 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 diff --git a/luci-app-glorytun/luasrc/model/cbi/glorytun-settings.lua b/luci-app-glorytun/luasrc/model/cbi/glorytun-settings.lua deleted file mode 100644 index aab2f460c..000000000 --- a/luci-app-glorytun/luasrc/model/cbi/glorytun-settings.lua +++ /dev/null @@ -1,83 +0,0 @@ --- Copyright 2018 Ycarus (Yannick Chabanois) --- Copyright 2008 Steven Barth --- 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 - diff --git a/luci-app-glorytun/luasrc/model/cbi/glorytun.lua b/luci-app-glorytun/luasrc/model/cbi/glorytun.lua deleted file mode 100644 index 1fb1b829e..000000000 --- a/luci-app-glorytun/luasrc/model/cbi/glorytun.lua +++ /dev/null @@ -1,147 +0,0 @@ --- Copyright 2018 Ycarus (Yannick Chabanois) --- Copyright 2008 Steven Barth --- 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 diff --git a/luci-app-glorytun/luasrc/view/glorytun/cbi-select-input-add.htm b/luci-app-glorytun/luasrc/view/glorytun/cbi-select-input-add.htm deleted file mode 100644 index 898252325..000000000 --- a/luci-app-glorytun/luasrc/view/glorytun/cbi-select-input-add.htm +++ /dev/null @@ -1,11 +0,0 @@ -
- <% if self.invalid_cts then -%>
<% end %> - - - - <% if self.invalid_cts then %>
<%:Invalid%>
<% end %> -
diff --git a/luci-app-glorytun/luasrc/view/glorytun/pageswitch.htm b/luci-app-glorytun/luasrc/view/glorytun/pageswitch.htm deleted file mode 100644 index 652494e0c..000000000 --- a/luci-app-glorytun/luasrc/view/glorytun/pageswitch.htm +++ /dev/null @@ -1,13 +0,0 @@ -<%# - Copyright 2018 Ycarus (Yannick Chabanois) - Copyright 2008 Steven Barth - Copyright 2008 Jo-Philipp Wich - Licensed to the public under the Apache License 2.0. --%> - -
- - <%:Overview%> » - <%=luci.i18n.translatef("Instance \"%s\"", self.instance)%> - -
diff --git a/luci-app-glorytun/po/de/glorytun.po b/luci-app-glorytun/po/de/glorytun.po deleted file mode 100644 index f3f01f7fd..000000000 --- a/luci-app-glorytun/po/de/glorytun.po +++ /dev/null @@ -1,104 +0,0 @@ -msgid "" -msgstr "" -"PO-Revision-Date: 2020-10-05 12:39+0000\n" -"Last-Translator: Anonymous \n" -"Language-Team: German \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)" diff --git a/luci-app-glorytun/po/fr/glorytun.po b/luci-app-glorytun/po/fr/glorytun.po deleted file mode 100644 index 7b6b678ee..000000000 --- a/luci-app-glorytun/po/fr/glorytun.po +++ /dev/null @@ -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 \n" -"Language-Team: French \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)" diff --git a/luci-app-glorytun/po/it/glorytun.po b/luci-app-glorytun/po/it/glorytun.po deleted file mode 100644 index 96ae2b091..000000000 --- a/luci-app-glorytun/po/it/glorytun.po +++ /dev/null @@ -1,104 +0,0 @@ -msgid "" -msgstr "" -"PO-Revision-Date: 2020-09-21 12:51+0000\n" -"Last-Translator: Weblate Admin \n" -"Language-Team: Italian \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)" diff --git a/luci-app-glorytun/po/oc/glorytun.po b/luci-app-glorytun/po/oc/glorytun.po deleted file mode 100644 index be34c778d..000000000 --- a/luci-app-glorytun/po/oc/glorytun.po +++ /dev/null @@ -1,103 +0,0 @@ -msgid "" -msgstr "" -"PO-Revision-Date: 2020-10-13 07:30+0000\n" -"Last-Translator: Quentin PAGÈS \n" -"Language-Team: Occitan \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 l’interfà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)" diff --git a/luci-app-glorytun/po/templates/glorytun.pot b/luci-app-glorytun/po/templates/glorytun.pot deleted file mode 100644 index 9c862bb47..000000000 --- a/luci-app-glorytun/po/templates/glorytun.pot +++ /dev/null @@ -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 "" diff --git a/luci-app-glorytun/po/zh_Hans/glorytun.po b/luci-app-glorytun/po/zh_Hans/glorytun.po deleted file mode 100644 index 051d88490..000000000 --- a/luci-app-glorytun/po/zh_Hans/glorytun.po +++ /dev/null @@ -1,102 +0,0 @@ -msgid "" -msgstr "" -"PO-Revision-Date: 2020-06-27 17:26+0000\n" -"Last-Translator: antrouter \n" -"Language-Team: Chinese (Simplified) \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)" diff --git a/luci-app-glorytun/po/zh_Hant/glorytun.po b/luci-app-glorytun/po/zh_Hant/glorytun.po deleted file mode 100644 index 4a77f6410..000000000 --- a/luci-app-glorytun/po/zh_Hant/glorytun.po +++ /dev/null @@ -1,102 +0,0 @@ -msgid "" -msgstr "" -"PO-Revision-Date: 2020-07-09 07:31+0000\n" -"Last-Translator: antrouter \n" -"Language-Team: Chinese (Traditional) \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)" diff --git a/luci-app-glorytun/root/etc/config/glorytun_recipes b/luci-app-glorytun/root/etc/config/glorytun_recipes deleted file mode 100644 index 693eb6da6..000000000 --- a/luci-app-glorytun/root/etc/config/glorytun_recipes +++ /dev/null @@ -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" - diff --git a/luci-app-glorytun/root/usr/share/luci/menu.d/luci-app-glorytun.json b/luci-app-glorytun/root/usr/share/luci/menu.d/luci-app-glorytun.json deleted file mode 100644 index 414accf0b..000000000 --- a/luci-app-glorytun/root/usr/share/luci/menu.d/luci-app-glorytun.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "admin/vpn/glorytun": { - "title": "Glorytun", - "order": 20, - "action": { - "type": "cbi", - "path": "glorytun" - }, - "depends": { - "acl": [ "luci-app-glorytun" ] - } - } -} diff --git a/luci-app-mail/po/it/mail.po b/luci-app-mail/po/it/mail.po index 524ba6ee2..fd43053e7 100644 --- a/luci-app-mail/po/it/mail.po +++ b/luci-app-mail/po/it/mail.po @@ -1,7 +1,7 @@ msgid "" msgstr "" -"PO-Revision-Date: 2020-09-21 12:51+0000\n" -"Last-Translator: Weblate Admin \n" +"PO-Revision-Date: 2020-12-01 10:49+0000\n" +"Last-Translator: Giuseppe Dipierro \n" "Language-Team: Italian \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" diff --git a/luci-app-mlvpn/Makefile b/luci-app-mlvpn/Makefile index 33548c8e9..80d97c856 100644 --- a/luci-app-mlvpn/Makefile +++ b/luci-app-mlvpn/Makefile @@ -1,12 +1,12 @@ # -# Copyright (C) 2018-2019 Ycarus (Yannick Chabanois) +# Copyright (C) 2018-2020 Ycarus (Yannick Chabanois) # # 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 diff --git a/luci-app-mlvpn/htdocs/luci-static/resources/view/services/mlvpn.js b/luci-app-mlvpn/htdocs/luci-static/resources/view/services/mlvpn.js new file mode 100644 index 000000000..8dcfb422b --- /dev/null +++ b/luci-app-mlvpn/htdocs/luci-static/resources/view/services/mlvpn.js @@ -0,0 +1,83 @@ +'use strict'; +'require rpc'; +'require form'; +'require fs'; +'require uci'; +'require tools.widgets as widgets'; + +var callHostHints; + +return L.view.extend({ + callHostHints: rpc.declare({ + object: 'luci-rpc', + method: 'getHostHints', + expect: { '': {} } + }), + + load: function() { + return this.callHostHints(); + }, + + render: function(hosts) { + var m, s, o; + + m = new form.Map('mlvpn', _('MLVPN')); + + s = m.section(form.GridSection, 'mlvpn', _('Instances')); + s.addremove = true; + s.anonymous = true; + s.nodescriptions = true; + + s.tab('general', _('General Settings')); + s.tab('advanced', _('Advanced Settings')); + + o = s.taboption('general', form.Flag, 'enable', _('Enabled')); + o.default = o.enabled; + + o = s.taboption('general', form.ListValue, 'mode', _('Mode')); + o.value('client',_('Client')); + o.value('server',_('Server')); + o.modalonly = true; + + o = s.taboption('general', form.Value, 'host', _('Host')); + o.rmempty = false; + + o = s.taboption('general', form.Value, 'firstport', _('First Port')); + o.default = "65201" + o.datatype = "port" + o.rmempty = false; + + o = s.taboption('general', form.Value, 'password', _('Password')); + o.rmempty = false; + o.modalonly = true; + + o = s.taboption('general', form.Value, 'interface_name', _('Interface name')); + o.default = "mlvpn0" + o.placeholder = "mlvpn0" + o.rmempty = false; + o.modalonly = true; + + o = s.taboption('advanced', form.Value, 'timeout', _('Timeout (s)')); + o.default = '30'; + o.datatype = "uinteger" + o.rmempty = false; + o.modalonly = true; + + o = s.taboption('advanced', form.Value, 'reorder_buffer_size', _('Reorder buffer size')); + o.default = '128'; + o.datatype = "uinteger" + o.rmempty = false; + o.modalonly = true; + + o = s.taboption('advanced', form.Value, 'loss_tolerance', _('Loss tolerance')); + o.default = '50'; + o.datatype = "uinteger" + o.rmempty = false; + o.modalonly = true; + + o = s.taboption('general',form.Value, 'label', _('Label')); + o.rmempty = true; + + return m.render(); + } +}); diff --git a/luci-app-mlvpn/luasrc/controller/mlvpn.lua b/luci-app-mlvpn/luasrc/controller/mlvpn.lua deleted file mode 100644 index 154222265..000000000 --- a/luci-app-mlvpn/luasrc/controller/mlvpn.lua +++ /dev/null @@ -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 diff --git a/luci-app-mlvpn/luasrc/model/cbi/mlvpn.lua b/luci-app-mlvpn/luasrc/model/cbi/mlvpn.lua deleted file mode 100644 index eaef23d7e..000000000 --- a/luci-app-mlvpn/luasrc/model/cbi/mlvpn.lua +++ /dev/null @@ -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 diff --git a/luci-app-mlvpn/luasrc/view/mlvpn/cbi-select-add.htm b/luci-app-mlvpn/luasrc/view/mlvpn/cbi-select-add.htm deleted file mode 100644 index 97ee647d2..000000000 --- a/luci-app-mlvpn/luasrc/view/mlvpn/cbi-select-add.htm +++ /dev/null @@ -1,10 +0,0 @@ -
- <% if self.invalid_cts then -%>
<% end %> - - - <% if self.invalid_cts then %>
<%:Invalid%>
<% end %> -
diff --git a/luci-app-mlvpn/po/de/mlvpn.po b/luci-app-mlvpn/po/de/mlvpn.po deleted file mode 100644 index f60844ce4..000000000 --- a/luci-app-mlvpn/po/de/mlvpn.po +++ /dev/null @@ -1,59 +0,0 @@ -msgid "" -msgstr "" -"PO-Revision-Date: 2020-10-05 12:39+0000\n" -"Last-Translator: Weblate Admin \n" -"Language-Team: German \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)" diff --git a/luci-app-mlvpn/po/fr/mlvpn.po b/luci-app-mlvpn/po/fr/mlvpn.po deleted file mode 100644 index af2708373..000000000 --- a/luci-app-mlvpn/po/fr/mlvpn.po +++ /dev/null @@ -1,62 +0,0 @@ -msgid "" -msgstr "" -"Project-Id-Version: \n" -"POT-Creation-Date: \n" -"PO-Revision-Date: 2020-10-07 10:57+0000\n" -"Last-Translator: Weblate Admin \n" -"Language-Team: French \n" -"Language: fr\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Plural-Forms: nplurals=2; plural=n > 1;\n" -"X-Generator: Weblate 4.0.4\n" - -msgid "Add" -msgstr "Ajouter" - -msgid "Enable" -msgstr "Activer" - -msgid "First remote port" -msgstr "Premier port distant" - -msgid "Interface name" -msgstr "Nom de l'interface" - -msgid "Interface will increase port used beginning with this" -msgstr "L'interface augmentera le port utilisé à partir de celui ci" - -msgid "Interfaces" -msgstr "Interfaces" - -msgid "Invalid" -msgstr "Invalide" - -msgid "Loss tolerance" -msgstr "Tolérance aux pertes" - -msgid "MLVPN" -msgstr "MLVPN" - -msgid "Mode" -msgstr "Mode" - -msgid "Password" -msgstr "Mot de passe" - -msgid "Remote host" -msgstr "Nom de l'hôte distant ou adresse IP" - -msgid "Remote/Bind port" -msgstr "Port de connexion distant" - -msgid "Reorder buffer size" -msgstr "Taille du tampon de réordonnancement" - -msgid "Settings" -msgstr "Paramètres" - -msgid "Timeout (s)" -msgstr "Délais d'attente (s)" diff --git a/luci-app-mlvpn/po/it/mlvpn.po b/luci-app-mlvpn/po/it/mlvpn.po deleted file mode 100644 index f7c495c5c..000000000 --- a/luci-app-mlvpn/po/it/mlvpn.po +++ /dev/null @@ -1,59 +0,0 @@ -msgid "" -msgstr "" -"PO-Revision-Date: 2020-09-21 12:51+0000\n" -"Last-Translator: Weblate Admin \n" -"Language-Team: Italian \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'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 "" diff --git a/luci-app-mlvpn/po/templates/mlvpn.pot b/luci-app-mlvpn/po/templates/mlvpn.pot deleted file mode 100644 index 0eecd2f65..000000000 --- a/luci-app-mlvpn/po/templates/mlvpn.pot +++ /dev/null @@ -1,50 +0,0 @@ -msgid "" -msgstr "Content-Type: text/plain; charset=UTF-8" - -msgid "Add" -msgstr "" - -msgid "Enable" -msgstr "" - -msgid "First remote port" -msgstr "" - -msgid "Interface name" -msgstr "" - -msgid "Interface will increase port used beginning with this" -msgstr "" - -msgid "Interfaces" -msgstr "" - -msgid "Invalid" -msgstr "" - -msgid "Loss tolerance" -msgstr "" - -msgid "MLVPN" -msgstr "" - -msgid "Mode" -msgstr "" - -msgid "Password" -msgstr "" - -msgid "Remote host" -msgstr "" - -msgid "Remote/Bind port" -msgstr "" - -msgid "Reorder buffer size" -msgstr "" - -msgid "Settings" -msgstr "" - -msgid "Timeout (s)" -msgstr "" diff --git a/luci-app-mlvpn/po/zh_Hans/mlvpn.po b/luci-app-mlvpn/po/zh_Hans/mlvpn.po deleted file mode 100644 index eca37c59d..000000000 --- a/luci-app-mlvpn/po/zh_Hans/mlvpn.po +++ /dev/null @@ -1,59 +0,0 @@ -msgid "" -msgstr "" -"PO-Revision-Date: 2020-06-11 16:36+0000\n" -"Last-Translator: antrouter \n" -"Language-Team: Chinese (Simplified) \n" -"Language: zh_Hans\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Plural-Forms: nplurals=1; plural=0;\n" -"X-Generator: Weblate 4.0.4\n" - -msgid "Add" -msgstr "添加" - -msgid "Enable" -msgstr "开启" - -msgid "First remote port" -msgstr "第一个远程端口" - -msgid "Interface name" -msgstr "网卡名称" - -msgid "Interface will increase port used beginning with this" -msgstr "接口将从此开始增加使用的端口" - -msgid "Interfaces" -msgstr "网卡" - -msgid "Invalid" -msgstr "无效" - -msgid "Loss tolerance" -msgstr "损失容忍" - -msgid "MLVPN" -msgstr "MLVPN设置" - -msgid "Mode" -msgstr "模式" - -msgid "Password" -msgstr "密码" - -msgid "Remote host" -msgstr "远程主机" - -msgid "Remote/Bind port" -msgstr "远程/绑定端口" - -msgid "Reorder buffer size" -msgstr "重新排序缓冲区大小" - -msgid "Settings" -msgstr "设置" - -msgid "Timeout (s)" -msgstr "超时 (秒)" diff --git a/luci-app-mlvpn/root/usr/share/luci/menu.d/luci-app-mlvpn.json b/luci-app-mlvpn/root/usr/share/luci/menu.d/luci-app-mlvpn.json index 085d95305..90afc4494 100644 --- a/luci-app-mlvpn/root/usr/share/luci/menu.d/luci-app-mlvpn.json +++ b/luci-app-mlvpn/root/usr/share/luci/menu.d/luci-app-mlvpn.json @@ -3,8 +3,8 @@ "title": "MLVPN", "order": 30, "action": { - "type": "cbi", - "path": "mlvpn" + "type": "view", + "path": "services/mlvpn" }, "depends": { "acl": [ "luci-app-mlvpn" ] diff --git a/luci-app-mptcp/po/it/mptcp.po b/luci-app-mptcp/po/it/mptcp.po index 9302b4a4c..272ac94dc 100644 --- a/luci-app-mptcp/po/it/mptcp.po +++ b/luci-app-mptcp/po/it/mptcp.po @@ -1,7 +1,7 @@ msgid "" msgstr "" -"PO-Revision-Date: 2020-10-02 08:44+0000\n" -"Last-Translator: Weblate Admin \n" +"PO-Revision-Date: 2020-12-01 10:49+0000\n" +"Last-Translator: Giuseppe Dipierro \n" "Language-Team: Italian \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 diff --git a/luci-app-openmptcprouter/luasrc/controller/openmptcprouter.lua b/luci-app-openmptcprouter/luasrc/controller/openmptcprouter.lua index 3a07d144d..b294af40c 100644 --- a/luci-app-openmptcprouter/luasrc/controller/openmptcprouter.lua +++ b/luci-app-openmptcprouter/luasrc/controller/openmptcprouter.lua @@ -71,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) @@ -491,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) @@ -512,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) @@ -538,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") @@ -552,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") @@ -606,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) @@ -617,13 +625,7 @@ 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") @@ -639,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") + end + ucic:set("network","omrvpn","proto","none") + 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) @@ -845,6 +870,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 diff --git a/luci-app-openmptcprouter/luasrc/view/openmptcprouter/settings.htm b/luci-app-openmptcprouter/luasrc/view/openmptcprouter/settings.htm index fbc61a7a9..50c4ccce3 100644 --- a/luci-app-openmptcprouter/luasrc/view/openmptcprouter/settings.htm +++ b/luci-app-openmptcprouter/luasrc/view/openmptcprouter/settings.htm @@ -244,6 +244,12 @@ +
+ +
+ checked<% end %>> +
+
diff --git a/luci-app-openmptcprouter/po/it/openmptcprouter.po b/luci-app-openmptcprouter/po/it/openmptcprouter.po index 0a900f075..9cdcf0e42 100644 --- a/luci-app-openmptcprouter/po/it/openmptcprouter.po +++ b/luci-app-openmptcprouter/po/it/openmptcprouter.po @@ -1,7 +1,7 @@ msgid "" msgstr "" -"PO-Revision-Date: 2020-10-21 12:55+0000\n" -"Last-Translator: Weblate Admin \n" +"PO-Revision-Date: 2020-12-01 17:19+0000\n" +"Last-Translator: Giuseppe Dipierro \n" "Language-Team: Italian \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 diff --git a/luci-app-shutdown/po/it/shutdown.po b/luci-app-shutdown/po/it/shutdown.po index 500e9eba6..03ca58813 100644 --- a/luci-app-shutdown/po/it/shutdown.po +++ b/luci-app-shutdown/po/it/shutdown.po @@ -1,7 +1,7 @@ msgid "" msgstr "" -"PO-Revision-Date: 2020-09-15 11:36+0000\n" -"Last-Translator: Weblate Admin \n" +"PO-Revision-Date: 2020-12-01 10:49+0000\n" +"Last-Translator: Giuseppe Dipierro \n" "Language-Team: Italian \n" "Language: it\n" @@ -21,11 +21,11 @@ msgstr "Eseguire l'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" diff --git a/luci-mod-dashboard/Makefile b/luci-mod-dashboard/Makefile index 4a9aec96f..6a6d84166 100644 --- a/luci-mod-dashboard/Makefile +++ b/luci-mod-dashboard/Makefile @@ -1,8 +1,11 @@ # # Copyright 2019-2020 ZHANG Zhao +# Copyright 2020 Ycarus (Yannick Chabanois) for OpenMPTCProuter # # This is free software, licensed under the Apache License, Version 2.0 . # +# Based on openwrt luci commit 03c77dafe3cfb922b995adfe9c0f8a75c98a18af +# include $(TOPDIR)/rules.mk diff --git a/luci-mod-dashboard/htdocs/luci-static/resources/view/dashboard/include/20_lan.js b/luci-mod-dashboard/htdocs/luci-static/resources/view/dashboard/include/20_lan.js index ab86568e8..c673fa681 100644 --- a/luci-mod-dashboard/htdocs/luci-static/resources/view/dashboard/include/20_lan.js +++ b/luci-mod-dashboard/htdocs/luci-static/resources/view/dashboard/include/20_lan.js @@ -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 ]), ]), diff --git a/luci-mod-network/Makefile b/luci-mod-network/Makefile index 7a043dc40..71e847f31 100644 --- a/luci-mod-network/Makefile +++ b/luci-mod-network/Makefile @@ -4,7 +4,7 @@ # # This is free software, licensed under the Apache License, Version 2.0 . # -# From https://github.com/openwrt/luci/commit/83c912716e482000e92443cffc3202726314f480 +# From https://github.com/openwrt/luci/commit/f5c04e1a2e173f536597f220db0380cc08869e8e include $(TOPDIR)/rules.mk diff --git a/luci-mod-network/htdocs/luci-static/resources/view/network/dhcp.js b/luci-mod-network/htdocs/luci-static/resources/view/network/dhcp.js index 95abeb6d0..d3f564d47 100644 --- a/luci-mod-network/htdocs/luci-static/resources/view/network/dhcp.js +++ b/luci-mod-network/htdocs/luci-static/resources/view/network/dhcp.js @@ -31,15 +31,15 @@ CBILeaseStatus = form.DummyValue.extend({ renderWidget: function(section_id, option_id, cfgvalue) { return E([ E('h4', _('Active DHCP Leases')), - E('div', { 'id': 'lease_status_table', 'class': 'table' }, [ - E('div', { 'class': 'tr table-titles' }, [ - E('div', { 'class': 'th' }, _('Hostname')), - E('div', { 'class': 'th' }, _('IPv4-Address')), - E('div', { 'class': 'th' }, _('MAC-Address')), - E('div', { 'class': 'th' }, _('Lease time remaining')) + E('table', { 'id': 'lease_status_table', 'class': 'table' }, [ + E('tr', { 'class': 'tr table-titles' }, [ + E('th', { 'class': 'th' }, _('Hostname')), + E('th', { 'class': 'th' }, _('IPv4-Address')), + E('th', { 'class': 'th' }, _('MAC-Address')), + E('th', { 'class': 'th' }, _('Lease time remaining')) ]), - E('div', { 'class': 'tr placeholder' }, [ - E('div', { 'class': 'td' }, E('em', _('Collecting data...'))) + E('tr', { 'class': 'tr placeholder' }, [ + E('td', { 'class': 'td' }, E('em', _('Collecting data...'))) ]) ]) ]); @@ -50,15 +50,15 @@ CBILease6Status = form.DummyValue.extend({ renderWidget: function(section_id, option_id, cfgvalue) { return E([ E('h4', _('Active DHCPv6 Leases')), - E('div', { 'id': 'lease6_status_table', 'class': 'table' }, [ - E('div', { 'class': 'tr table-titles' }, [ - E('div', { 'class': 'th' }, _('Host')), - E('div', { 'class': 'th' }, _('IPv6-Address')), - E('div', { 'class': 'th' }, _('DUID')), - E('div', { 'class': 'th' }, _('Lease time remaining')) + E('table', { 'id': 'lease6_status_table', 'class': 'table' }, [ + E('tr', { 'class': 'tr table-titles' }, [ + E('th', { 'class': 'th' }, _('Host')), + E('th', { 'class': 'th' }, _('IPv6-Address')), + E('th', { 'class': 'th' }, _('DUID')), + E('th', { 'class': 'th' }, _('Lease time remaining')) ]), - E('div', { 'class': 'tr placeholder' }, [ - E('div', { 'class': 'td' }, E('em', _('Collecting data...'))) + E('tr', { 'class': 'tr placeholder' }, [ + E('td', { 'class': 'td' }, E('em', _('Collecting data...'))) ]) ]) ]); diff --git a/luci-mod-network/htdocs/luci-static/resources/view/network/diagnostics.js b/luci-mod-network/htdocs/luci-static/resources/view/network/diagnostics.js index 1855ee642..5d6bd4765 100644 --- a/luci-mod-network/htdocs/luci-static/resources/view/network/diagnostics.js +++ b/luci-mod-network/htdocs/luci-static/resources/view/network/diagnostics.js @@ -66,9 +66,9 @@ return view.extend({ return E([], [ E('h2', {}, [ _('Network Utilities') ]), - E('div', { 'class': 'table' }, [ - E('div', { 'class': 'tr' }, [ - E('div', { 'class': 'td left' }, [ + E('table', { 'class': 'table' }, [ + E('tr', { 'class': 'tr' }, [ + E('td', { 'class': 'td left' }, [ E('input', { 'style': 'margin:5px 0', 'type': 'text', @@ -91,7 +91,7 @@ return view.extend({ ]) ]), - E('div', { 'class': 'td left' }, [ + E('td', { 'class': 'td left' }, [ E('input', { 'style': 'margin:5px 0', 'type': 'text', @@ -114,7 +114,7 @@ return view.extend({ ]) ]), - E('div', { 'class': 'td left' }, [ + E('td', { 'class': 'td left' }, [ E('input', { 'style': 'margin:5px 0', 'type': 'text', diff --git a/luci-mod-network/htdocs/luci-static/resources/view/network/wireless.js b/luci-mod-network/htdocs/luci-static/resources/view/network/wireless.js index bb9877217..d19b025e3 100644 --- a/luci-mod-network/htdocs/luci-static/resources/view/network/wireless.js +++ b/luci-mod-network/htdocs/luci-static/resources/view/network/wireless.js @@ -649,7 +649,7 @@ return view.extend({ if (bss.network.isClientDisconnectSupported()) { if (table.firstElementChild.childNodes.length < 6) - table.firstElementChild.appendChild(E('div', { 'class': 'th cbi-section-actions'})); + table.firstElementChild.appendChild(E('th', { 'class': 'th cbi-section-actions'})); row.push(E('button', { 'class': 'cbi-button cbi-button-remove', @@ -850,7 +850,7 @@ return view.extend({ ]; } - return E('div', { 'class': 'td middle cbi-section-actions' }, E('div', btns)); + return E('td', { 'class': 'td middle cbi-section-actions' }, E('div', btns)); }; s.addModalOptions = function(s) { @@ -889,6 +889,12 @@ return view.extend({ o = ss.taboption('advanced', CBIWifiCountryValue, 'country', _('Country Code')); o.wifiNetwork = radioNet; + o = ss.taboption('advanced', form.ListValue, 'cell_density', _('Coverage cell density'), _('Configures data rates based on the coverage cell density. Normal configures basic rates to 6, 12, 24 Mbps if legacy 802.11b rates are not used else to 5.5, 11 Mbps. High configures basic rates to 12, 24 Mbps if legacy 802.11b rates are not used else to the 11 Mbps rate. Very High configures 24 Mbps as the basic rate. Supported rates lower than the minimum basic rate are not offered.')); + o.value('0', _('Disabled')); + o.value('1', _('Normal')); + o.value('2', _('High')); + o.value('3', _('Very High')); + o = ss.taboption('advanced', form.Flag, 'legacy_rates', _('Allow legacy 802.11b rates')); o.default = o.enabled; @@ -1656,15 +1662,15 @@ return view.extend({ }; s.handleScan = function(radioDev, ev) { - var table = E('div', { 'class': 'table' }, [ - E('div', { 'class': 'tr table-titles' }, [ - E('div', { 'class': 'th col-2 middle center' }, _('Signal')), - E('div', { 'class': 'th col-4 middle left' }, _('SSID')), - E('div', { 'class': 'th col-2 middle center hide-xs' }, _('Channel')), - E('div', { 'class': 'th col-2 middle left hide-xs' }, _('Mode')), - E('div', { 'class': 'th col-3 middle left hide-xs' }, _('BSSID')), - E('div', { 'class': 'th col-3 middle left' }, _('Encryption')), - E('div', { 'class': 'th cbi-section-actions right' }, ' '), + var table = E('table', { 'class': 'table' }, [ + E('tr', { 'class': 'tr table-titles' }, [ + E('th', { 'class': 'th col-2 middle center' }, _('Signal')), + E('th', { 'class': 'th col-4 middle left' }, _('SSID')), + E('th', { 'class': 'th col-2 middle center hide-xs' }, _('Channel')), + E('th', { 'class': 'th col-2 middle left hide-xs' }, _('Mode')), + E('th', { 'class': 'th col-3 middle left hide-xs' }, _('BSSID')), + E('th', { 'class': 'th col-3 middle left' }, _('Encryption')), + E('th', { 'class': 'th cbi-section-actions right' }, ' '), ]) ]); @@ -2073,13 +2079,13 @@ return view.extend({ .then(L.bind(this.poll_status, this, nodes)); }, this), 5); - var table = E('div', { 'class': 'table assoclist', 'id': 'wifi_assoclist_table' }, [ - E('div', { 'class': 'tr table-titles' }, [ - E('div', { 'class': 'th nowrap' }, _('Network')), - E('div', { 'class': 'th hide-xs' }, _('MAC-Address')), - E('div', { 'class': 'th' }, _('Host')), - E('div', { 'class': 'th' }, _('Signal / Noise')), - E('div', { 'class': 'th' }, _('RX Rate / TX Rate')) + var table = E('table', { 'class': 'table assoclist', 'id': 'wifi_assoclist_table' }, [ + E('tr', { 'class': 'tr table-titles' }, [ + E('th', { 'class': 'th nowrap' }, _('Network')), + E('th', { 'class': 'th hide-xs' }, _('MAC-Address')), + E('th', { 'class': 'th' }, _('Host')), + E('th', { 'class': 'th' }, _('Signal / Noise')), + E('th', { 'class': 'th' }, _('RX Rate / TX Rate')) ]) ]); diff --git a/mptcp/files/etc/init.d/mptcp b/mptcp/files/etc/init.d/mptcp index 95c9a4fb9..77310f5eb 100755 --- a/mptcp/files/etc/init.d/mptcp +++ b/mptcp/files/etc/init.d/mptcp @@ -322,6 +322,7 @@ interface_multipath_settings() { EOF else ip -6 rule add from $ip6addr table 6$id pref 0 + ip -6 route replace $network6/$netmask6 dev $iface scope link metric 6$id ip -6 route replace $network6/$netmask6 dev $iface scope link table 6$id ip -6 route replace default via $gateway6 dev $iface table 6$id ip -6 route replace default via $gateway6 dev $iface metric $id diff --git a/mptcp/files/usr/share/omr/post-tracking.d/post-tracking b/mptcp/files/usr/share/omr/post-tracking.d/post-tracking index 71f248689..f20e47f96 100755 --- a/mptcp/files/usr/share/omr/post-tracking.d/post-tracking +++ b/mptcp/files/usr/share/omr/post-tracking.d/post-tracking @@ -371,7 +371,7 @@ if [ "$OMR_TRACKER_STATUS" = "ERROR" ] || [ "$interface_up" != "true" ]; then config_load network config_foreach set_route interface $OMR_TRACKER_INTERFACE fi - if [ "$(uci -q get shadowsocks-libev.sss0.disabled)" != "1" ] && [ "$(uci -q get openmptcprouter.omr.shadowsocks)" = "up" ] && [ "$(uci -q get shadowsocks-libev.ss_rules.redir_udp)" = "" ] && [ "$(uci -q get shadowsocks-libev.hi2.mode)" = "tcp_and_udp" ] && [ "$(uci -q get shadowsocks-libev.sss0.obfs)" != "1" ]; then + if [ "$(uci -q get openmptcprouter.settings.shadowsocksudp)" = "1" ] && [ "$(uci -q get shadowsocks-libev.sss0.disabled)" != "1" ] && [ "$(uci -q get openmptcprouter.omr.shadowsocks)" = "up" ] && [ "$(uci -q get shadowsocks-libev.ss_rules.redir_udp)" = "" ] && [ "$(uci -q get shadowsocks-libev.hi2.mode)" = "tcp_and_udp" ] && [ "$(uci -q get shadowsocks-libev.sss0.obfs)" != "1" ]; then _log "Tunnel down use ShadowSocks for UDP" uci -q set shadowsocks-libev.ss_rules.redir_udp='hi2' if /etc/init.d/shadowsocks-libev rules_exist ; then @@ -390,6 +390,9 @@ if [ "$OMR_TRACKER_STATUS" = "ERROR" ] || [ "$interface_up" != "true" ]; then if [ "$(uci -q get glorytun.vpn.enable)" = "1" ]; then _log "Glorytun VPN down, restart it" /etc/init.d/glorytun restart + fi + if [ "$(uci -q get glorytun-udp.vpn.enable)" = "1" ]; then + _log "Glorytun UDP VPN down, restart it" /etc/init.d/glorytun-udp restart fi config_load openmptcprouter @@ -438,7 +441,7 @@ if [ "$OMR_TRACKER_INTERFACE" = "glorytun" ] || [ "$OMR_TRACKER_INTERFACE" = "om fi uci -q set openmptcprouter.$OMR_TRACKER_INTERFACE="interface" uci -q set openmptcprouter.$OMR_TRACKER_INTERFACE.latency="$OMR_TRACKER_LATENCY" - if [ "$(uci -q get glorytun.vpn.enable)" != "1" ]; then + if [ "$(uci -q get glorytun.vpn.enable)" != "1" ] || [ "$(uci -q get glorytun-udp.vpn.enable)" != "1" ]; then if [ -n "$(uci -q get network.$OMR_TRACKER_INTERFACE.mtu)" ]; then mtu=$(uci -q get network.$OMR_TRACKER_INTERFACE.mtu) uci -q set openmptcprouter.$OMR_TRACKER_INTERFACE.mtu=$mtu @@ -576,13 +579,13 @@ if [ "$multipath_config" = "on" ] || [ "$multipath_config" = "backup" ]; then [ "$(uci -q get openmptcprouter.$OMR_TRACKER_INTERFACE.multipathvpn)" != "1" ] && [ "$multipath_config" = "backup" ] && [ "$(pgrep glorytun-udp)" != "" ] && gtudpst="backup" if [ "$(uci -q get openmptcprouter.$OMR_TRACKER_INTERFACE.vpn)" != "1" ] && [ "$(pgrep glorytun-udp)" != "" ] && [ "$(glorytun-udp path | grep $OMR_TRACKER_DEVICE_IP)" = "" ]; then if [ "$download" != "0" ] && [ "$download" != "" ] && [ "$upload" != "0" ] && [ "$upload" != "" ]; then - if [ "$(uci -q get glorytun.vpn.rateauto)" = "1" ]; then + if [ "$(uci -q get glorytun-udp.vpn.rateauto)" = "1" ]; then glorytun-udp path addr $OMR_TRACKER_DEVICE_IP dev tun0 set up rate auto tx $((upload*1000/8)) rx $((download*1000/8)) > /dev/null 2>&1 else glorytun-udp path addr $OMR_TRACKER_DEVICE_IP dev tun0 set up rate fixed tx $((upload*1000/8)) rx $((download*1000/8)) > /dev/null 2>&1 fi else - if [ "$(uci -q get glorytun.vpn.rateauto)" = "1" ]; then + if [ "$(uci -q get glorytun-udp.vpn.rateauto)" = "1" ]; then glorytun-udp path addr $OMR_TRACKER_DEVICE_IP dev tun0 set up rate auto tx 12500000 rx 12500000 > /dev/null 2>&1 else glorytun-udp path addr $OMR_TRACKER_DEVICE_IP dev tun0 set up rate fixed tx 12500000 rx 12500000 > /dev/null 2>&1 @@ -665,7 +668,7 @@ if [ "$(uci -q get openmptcprouter.$OMR_TRACKER_INTERFACE.lc)" = "" ] || [ $(($( [ -n "$asn" ] && { uci -q set openmptcprouter.$OMR_TRACKER_INTERFACE.asn="$asn" } - if [ "$OMR_TRACKER_INTERFACE" != "omrvpn" ] && [ "$(uci -q get glorytun.vpn.enable)" != "1" ]; then + if [ "$OMR_TRACKER_INTERFACE" != "omrvpn" ] && [ "$(uci -q get glorytun.vpn.enable)" != "1" ] && [ "$(uci -q get glorytun-udp.vpn.enable)" != "1" ]; then if [ -n "$(uci -q get network.$OMR_TRACKER_INTERFACE.mtu)" ]; then mtu=$(uci -q get network.$OMR_TRACKER_INTERFACE.mtu) [ -n "$mtu" ] && { @@ -775,6 +778,10 @@ fi if [ "$(pgrep glorytun)" = "" ] && [ "$(uci -q get glorytun.vpn.enable)" = "1" ] && [ -f /etc/init.d/glorytun ] && [ "$(uci -q get glorytun.vpn.key)" != "" ]; then _log "Can't find Glorytun, restart it..." /etc/init.d/glorytun restart + sleep 5 +fi +if [ "$(pgrep glorytun-udp)" = "" ] && [ "$(uci -q get glorytun-usp.vpn.enable)" = "1" ] && [ -f /etc/init.d/glorytun-udp ] && [ "$(uci -q get glorytun-udp.vpn.key)" != "" ]; then + _log "Can't find Glorytun UDP, restart it..." /etc/init.d/glorytun-udp restart sleep 5 fi diff --git a/ndpi-netfilter2/Makefile b/ndpi-netfilter2/Makefile index e977efbc5..9f04c4e87 100644 --- a/ndpi-netfilter2/Makefile +++ b/ndpi-netfilter2/Makefile @@ -11,7 +11,7 @@ include $(INCLUDE_DIR)/kernel.mk PKG_NAME:=ndpi-netfilter2 PKG_RELEASE:=2 -PKG_REV:=86eaa857129cdd63152ebcd483366706e28089cc +PKG_REV:=0a03249da911f4033fd2a0d38a97cdba72eee2b6 PKG_VERSION:=3.2-$(PKG_REV) PKG_SOURCE_PROTO:=git diff --git a/omr-6in4/files/bin/omr-6in4 b/omr-6in4/files/bin/omr-6in4 index cc0fe0e59..c7eba5bfa 100755 --- a/omr-6in4/files/bin/omr-6in4 +++ b/omr-6in4/files/bin/omr-6in4 @@ -6,6 +6,10 @@ while true; do iface=$(uci -q get glorytun.vpn.dev) addr=$(uci -q get glorytun.vpn.localip) peer=$(uci -q get glorytun.vpn.remoteip) + elif [ "$(uci -q get glorytun-udp.vpn.enable)" = "1" ]; then + iface=$(uci -q get glorytun-udp.vpn.dev) + addr=$(uci -q get glorytun-udp.vpn.localip) + peer=$(uci -q get glorytun-udp.vpn.remoteip) elif [ "$(uci -q get dsvpn.vpn.enable)" = "1" ]; then iface=$(uci -q get dsvpn.vpn.dev) addr=$(uci -q get dsvpn.vpn.localip) diff --git a/omr-tracker/files/bin/omr-tracker b/omr-tracker/files/bin/omr-tracker index b0a90246d..8b64a3785 100755 --- a/omr-tracker/files/bin/omr-tracker +++ b/omr-tracker/files/bin/omr-tracker @@ -204,6 +204,8 @@ while true; do if [ -z "$OMR_TRACKER_DEVICE_GATEWAY" ] || [ "$OMR_TRACKER_DEVICE_GATEWAY" = "0.0.0.0" ]; then if [ "$OMR_TRACKER_INTERFACE" = "omrvpn" ] && [ "$(uci -q get glorytun.vpn.enable)" = "1" ]; then OMR_TRACKER_DEVICE_GATEWAY=$(uci -q get glorytun.vpn.remoteip) + elif [ "$OMR_TRACKER_INTERFACE" = "omrvpn" ] && [ "$(uci -q get glorytun-udp.vpn.enable)" = "1" ]; then + OMR_TRACKER_DEVICE_GATEWAY=$(uci -q get glorytun-udp.vpn.remoteip) else OMR_TRACKER_DEVICE_GATEWAY="" fi diff --git a/openmptcprouter-full/Makefile b/openmptcprouter-full/Makefile index 0d060fa9a..0ab4f84fd 100644 --- a/openmptcprouter-full/Makefile +++ b/openmptcprouter-full/Makefile @@ -35,7 +35,7 @@ MY_DEPENDS := \ wireless-tools \ libiwinfo-lua \ ca-bundle ca-certificates \ - luci-mod-admin-full luci-app-firewall luci-app-glorytun luci-app-shadowsocks-libev luci-app-unbound luci-theme-openmptcprouter luci-theme-argon luci-base \ + luci-mod-admin-full luci-app-firewall luci-app-glorytun-tcp luci-app-glorytun-udp luci-app-shadowsocks-libev luci-app-unbound luci-theme-openmptcprouter luci-theme-argon luci-base \ luci-app-omr-tracker luci-app-omr-dscp \ luci-app-sqm sqm-scripts-extra \ luci-app-vnstat2 omr-quota luci-app-omr-quota \ diff --git a/openmptcprouter/files/etc/init.d/mptcpovervpn b/openmptcprouter/files/etc/init.d/mptcpovervpn index 73f804191..870148e5b 100755 --- a/openmptcprouter/files/etc/init.d/mptcpovervpn +++ b/openmptcprouter/files/etc/init.d/mptcpovervpn @@ -132,11 +132,17 @@ start_service() uci -q batch <<-EOF >/dev/null set shadowsocks-libev.sss0.disabled='1' set glorytun.vpn.host='10.255.250.1' + set glorytun-udp.vpn.host='10.255.250.1' + commit glorytun + commit glorytun-udp EOF elif [ "$(uci -q get glorytun.vpn.host)" = "10.255.250.1" ] && [ "$nbintf" != "$nbintfvpn" ]; then uci -q batch <<-EOF >/dev/null delete shadowsocks-libev.sss0.disabled set glorytun.vpn.host="$(uci -q get openmptcprouter.vps.ip)" + set glorytun-udp.vpn.host="$(uci -q get openmptcprouter.vps.ip)" + commit glorytun + commit glorytun-udp EOF fi NBCPU=$(grep -c '^processor' /proc/cpuinfo | tr -d "\n") diff --git a/openmptcprouter/files/etc/init.d/openmptcprouter-vps b/openmptcprouter/files/etc/init.d/openmptcprouter-vps index 8db25ea42..b84667234 100755 --- a/openmptcprouter/files/etc/init.d/openmptcprouter-vps +++ b/openmptcprouter/files/etc/init.d/openmptcprouter-vps @@ -296,20 +296,20 @@ _get_vps_config() { fi if [ "$vpn" = "glorytun_udp" ]; then glorytun_state=1 - uci -q set glorytun.vpn.proto='udp' + #uci -q set glorytun.vpn.proto='udp' client_ip="$(echo "$vps_config" | jsonfilter -q -e '@.glorytun.udp.client_ip')" host_ip="$(echo "$vps_config" | jsonfilter -q -e '@.glorytun.udp.host_ip')" port="$(echo "$vps_config" | jsonfilter -q -e '@.glorytun.port')" - if [ "$(uci -q get glorytun.vpn.port)" != "$port" ] && [ "$port" != "" ]; then + if [ "$(uci -q get glorytun-udp.vpn.port)" != "$port" ] && [ "$port" != "" ]; then uci -q batch <<-EOF >/dev/null - set glorytun.vpn.port=$port + set glorytun-udp.vpn.port=$port EOF fi if [ "$client_ip" != "dhcp" ] && [ -n "$client_ip" ]; then - if [ "$host_ip" != "$(uci -q get glorytun.vpn.remoteip)" ] || [ "$client_ip" != "$(uci -q get glorytun.vpn.localip)" ]; then + if [ "$host_ip" != "$(uci -q get glorytun-udp.vpn.remoteip)" ] || [ "$client_ip" != "$(uci -q get glorytun-udp.vpn.localip)" ]; then uci -q batch <<-EOF >/dev/null - set glorytun.vpn.localip=$client_ip - set glorytun.vpn.remoteip=$host_ip + set glorytun-udp.vpn.localip=$client_ip + set glorytun-udp.vpn.remoteip=$host_ip EOF glorytun_change=1 fi @@ -321,10 +321,10 @@ _get_vps_config() { glorytun_change=1 fi else - if [ "$(uci -q get glorytun.vpn.remoteip)" != "" ] || [ "$(uci -q get glorytun.vpn.localip)" != "" ]; then + if [ "$(uci -q get glorytun-udp.vpn.remoteip)" != "" ] || [ "$(uci -q get glorytun-udp.vpn.localip)" != "" ]; then uci -q batch <<-EOF >/dev/null - delete glorytun.vpn.localip - delete glorytun.vpn.remoteip + delete glorytun-udp.vpn.localip + delete glorytun-udp.vpn.remoteip EOF glorytun_change=1 fi @@ -403,14 +403,24 @@ _get_vps_config() { EOF glorytun_change=1 fi + if [ "$(uci -q get glorytun-udp.vpn.host)" != "127.0.0.1" ] && [ "$(uci -q get glorytun-udp.vpn.host)" != "$vpsip" ] && [ "$(uci -q get openmptcprouter.settings.ha)" != "1" ]; then + uci -q batch <<-EOF >/dev/null + set glorytun-udp.vpn.host="$vpsip" + EOF + glorytun_change=1 + fi if [ "$glorytun_change" != "0" ]; then uci -q batch <<-EOF >/dev/null commit glorytun + commit glorytun-udp EOF if [ "$(uci -q get glorytun.vpn.enable)" = "1" ]; then logger -t "OMR-VPS" "Restart glorytun..." /etc/init.d/glorytun restart >/dev/null 2>&1 + fi + if [ "$(uci -q get glorytun-udp.vpn.enable)" = "1" ]; then + logger -t "OMR-VPS" "Restart glorytun-udp..." /etc/init.d/glorytun-udp restart >/dev/null 2>&1 fi fi @@ -1148,9 +1158,6 @@ _set_config_from_vps() { if [ "$vpn" = "glorytun_tcp" ]; then glorytun_state=1 fi - if [ "$vpn" = "glorytun_udp" ]; then - glorytun_state=1 - fi [ -z "$glorytun_port" ] && glorytun_port="65001" glorytun_chacha="$(echo "$vps_config" | jsonfilter -q -e '@.glorytun.chacha')" [ -z "$glorytun_chacha" ] || [ "$glorytun_chacha" = "true" ] && glorytun_chacha=1 @@ -1167,6 +1174,28 @@ _set_config_from_vps() { uci -q commit glorytun logger -t "OMR-VPS" "Glorytun restart..." /etc/init.d/glorytun restart >/dev/null 2>&1 + fi + if ([ -n "$glorytun_key" ] && [ "$glorytun_key" != "$(uci -q get glorytun-udp.vpn.key)" ]) || ([ -n "$glorytun_port" ] || [ "$glorytun_port" != "$(uci -q get glorytun-udp.vpn.port)" ]); then + vpn="$(uci -q get openmptcprouter.settings.vpn)" + glorytun_state=0 + if [ "$vpn" = "glorytun_udp" ]; then + glorytun_state=1 + fi + [ -z "$glorytun_port" ] && glorytun_port="65001" + glorytun_chacha="$(echo "$vps_config" | jsonfilter -q -e '@.glorytun.chacha')" + [ -z "$glorytun_chacha" ] || [ "$glorytun_chacha" = "true" ] && glorytun_chacha=1 + [ "$glorytun_chacha" = "false" ] && glorytun_chacha=0 + uci -q batch <<-EOF >/dev/null + set glorytun-udp.vpn.port=$glorytun_port + set glorytun-udp.vpn.key=$glorytun_key + set glorytun-udp.vpn.enable=$glorytun_state + set glorytun-udp.vpn.chacha=$glorytun_chacha + EOF + if [ "$(uci -q get glorytun-udp.vpn.host)" != "127.0.0.1" ]; then + uci -q set glorytun-udp.vpn.host="$vpsip" + fi + uci -q commit glorytun-udp + logger -t "OMR-VPS" "Glorytun UDP restart..." /etc/init.d/glorytun-udp restart >/dev/null 2>&1 fi @@ -1535,6 +1564,14 @@ _config_service() { return } error=0 + if [ -n "$serial" ]; then + [ -z "$vps_config" ] && vps_config=$(_get_json "config?serial=${serial}") + if [ -n "$vps_config" ] && [ "$( echo "$vps_config" | jsonfilter -q -e '@.error')" = "False serial number" ]; then + logger -t "OMR-VPS" "Invalid serial number" + sed -i "s:${server}::g" /etc/config/* + return + fi + fi [ "$(uci -q get openmptcprouter.${servername}.get_config)" = "1" ] && [ "$(uci -q get openmptcprouter.${servername}.master)" = "1" ] && { _set_config_from_vps _get_gre_tunnel @@ -1555,6 +1592,8 @@ _config_service() { uci -q batch <<-EOF >/dev/null set glorytun.vpn.chacha20="0" commit glorytun + set glorytun-udp.vpn.chacha="0" + commit glorytun-udp EOF config_foreach _set_ss_server server "method" "aes-256-gcm" uci -q commit shadowsocks-libev @@ -1631,6 +1670,9 @@ set_pihole() { start_service() { serversnb=0 wanips="" + serial=$(cat /proc/cpuinfo | grep Serial | awk '{print $3}') + [ -z "$serial" ] && [ -f "/usr/sbin/dmidecode" ] && serial=$(/usr/sbin/dmidecode -t 1 | egrep 'Serial' | awk '{print $3}') + uci -q set openmptcprouter.settings.serial=${serial} config_load openmptcprouter config_foreach _count_server server config_foreach _get_local_wan_ip interface @@ -1642,6 +1684,6 @@ start_service() { } service_triggers() { - procd_add_reload_trigger openmptcprouter shadowsocks-libev glorytun mlvpn openvpn network upnpd dsvpn v2ray firewall + procd_add_reload_trigger openmptcprouter shadowsocks-libev glorytun glorytun-udp mlvpn openvpn network upnpd dsvpn v2ray firewall #procd_add_reload_trigger openmptcprouter shadowsocks-libev network upnpd } \ No newline at end of file diff --git a/openmptcprouter/files/etc/uci-defaults/2020-omr-vpn b/openmptcprouter/files/etc/uci-defaults/2020-omr-vpn index 201c4c226..bb4dbf559 100755 --- a/openmptcprouter/files/etc/uci-defaults/2020-omr-vpn +++ b/openmptcprouter/files/etc/uci-defaults/2020-omr-vpn @@ -74,11 +74,18 @@ if [ "$(uci -q get dsvpn.vpn)" = "" ]; then set dsvpn.vpn.port=65011 set dsvpn.vpn.localip=10.255.251.2 set dsvpn.vpn.remoteip=10.255.251.1 + set dsvpn.vpn.mode=client set dsvpn.vpn.enable=0 commit dsvpn EOF fi +if [ "$(uci -q get dsvpn.vpn.mode)" = "" ]; then + uci -q batch <<-EOF >/dev/null + set dsvpn.vpn.mode=client + commit dsvpn + EOF +fi if [ "$(uci -q show firewall | grep omrvpn)" = "" ]; then uci -q batch <<-EOF >/dev/null @@ -100,6 +107,12 @@ if [ "$(uci -q get ucitrack.@network[-1].affects | grep glorytun)" = "" ]; then commit ucitrack EOF fi +if [ "$(uci -q get ucitrack.@network[-1].affects | grep glorytun-udp)" = "" ]; then + uci -q batch <<-EOF >/dev/null + add_list ucitrack.@network[-1].affects="glorytun-udp" + commit ucitrack + EOF +fi if [ "$(uci -q get ucitrack.@network[-1].affects | grep dsvpn)" = "" ]; then uci -q batch <<-EOF >/dev/null add_list ucitrack.@network[-1].affects="dsvpn" @@ -112,6 +125,28 @@ if [ "$(uci -q get ucitrack.@glorytun[-1].affects | grep openmptcprouter-vps)" = commit ucitrack EOF fi +if [ "$(uci -q get ucitrack.@glorytun-udp[-1].affects | grep openmptcprouter-vps)" = "" ]; then + uci -q batch <<-EOF >/dev/null + add_list ucitrack.@glorytun-udp[-1].affects="openmptcprouter-vps" + commit ucitrack + EOF +fi + +if [ "$(uci -q get glorytun-udp.vpn.key)" = "" ] && [ "$(uci -q get glorytun.vpn.key)" != "" ]; then + uci -q batch <<-EOF >/dev/null + set glorytun-udp.vpn.key=$(uci -q get glorytun.vpn.key) + set glorytun-udp.vpn.host=$(uci -q get glorytun.vpn.host) + EOF + if [ "$(uci -q get glorytun-udp.vpn.proto)" = "udp" ]; then + uci -q batch <<-EOF >/dev/null + set glorytun-udp.vpn.enable=1 + set glorytun.vpn.enable=0 + commit glorytun + EOF + fi + uci -q commit glorytun-udp +fi + rm -f /tmp/luci-indexcache diff --git a/v2ray-core/files/etc/init.d/v2ray b/v2ray-core/files/etc/init.d/v2ray index 98aacf26e..34acc668b 100755 --- a/v2ray-core/files/etc/init.d/v2ray +++ b/v2ray-core/files/etc/init.d/v2ray @@ -413,8 +413,12 @@ add_v2ray_redirect_rules() { test -n "$port" || return # This part need a rewrite + v2ray-rules -f v2ray-rules -l ${port} -L ${port} -s $OUTBOUND_SERVERS_V4 --rule-name def --src-default forward --dst-default forward --local-default forward - [ "$(uci -q get v2ray.main.inbounds | grep omr6)" != "" ] && v2ray-rules6 -l $((port+1)) -L $((port+1)) --rule-name def --src-default forward --dst-default forward --local-default forward + [ "$(uci -q get v2ray.main.inbounds | grep omr6)" != "" ] && { + v2ray-rules6 -f + v2ray-rules6 -l $((port+1)) -L $((port+1)) --rule-name def --src-default forward --dst-default forward --local-default forward + } [ -f /etc/init.d/omr-bypass ] && { logger -t "v2ray" "Reload omr-bypass rules" /etc/init.d/omr-bypass reload_rules diff --git a/v2ray-core/files/etc/uci-defaults/3010-omr-v2ray b/v2ray-core/files/etc/uci-defaults/3010-omr-v2ray index 18a3cc65d..f0a22aff0 100644 --- a/v2ray-core/files/etc/uci-defaults/3010-omr-v2ray +++ b/v2ray-core/files/etc/uci-defaults/3010-omr-v2ray @@ -6,9 +6,9 @@ if [ -z "$(uci -q get v2ray.main)" ]; then set v2ray.main=v2ray set v2ray.main.v2ray_file='/usr/bin/v2ray' set v2ray.main.mem_percentage='0' - set v2ray.main.loglevel='warning' + set v2ray.main.loglevel='debug' set v2ray.main.access_log='/dev/null' - set v2ray.main.error_log='/var/log/v2ray-error.log' + set v2ray.main.error_log='/dev/null' set v2ray.main.enabled='0' set v2ray.main.outbounds='omrout' set v2ray.main.inbounds='omr' @@ -136,5 +136,11 @@ if [ "$(uci -q get v2ray.omrrouting)" = "" ]; then EOF fi +if [ "$(uci -q get v2ray.main.error_log)" != "/dev/null" ]; then + uci -q batch <<-EOF >/dev/null + set v2ray.main.error_log='/dev/null' + commit v2ray + EOF +fi exit 0 \ No newline at end of file