gluon-config-mode-mesh-vpn: add tunneldigger support

Based-on-patch-by: Cyrus Fox <cyrus@lambdacore.de>
This commit is contained in:
Matthias Schiffer 2017-03-10 19:02:09 +01:00
parent ad7a36fdce
commit a49ef70c53
No known key found for this signature in database
GPG Key ID: 16EF3F64CB201D9C
5 changed files with 29 additions and 20 deletions

View File

@ -14,7 +14,7 @@ define Package/gluon-config-mode-mesh-vpn
SECTION:=gluon SECTION:=gluon
CATEGORY:=Gluon CATEGORY:=Gluon
TITLE:=Toggle mesh-vpn and bandwidth limit TITLE:=Toggle mesh-vpn and bandwidth limit
DEPENDS:=gluon-config-mode-core-virtual +gluon-mesh-vpn-fastd DEPENDS:=gluon-config-mode-core-virtual +gluon-mesh-vpn-core
endef endef
define Build/Prepare define Build/Prepare

View File

@ -1,8 +1,8 @@
msgid "" msgid ""
msgstr "" msgstr ""
"Project-Id-Version: PACKAGE VERSION\n" "Project-Id-Version: PACKAGE VERSION\n"
"PO-Revision-Date: 2015-03-19 22:05+0100\n" "PO-Revision-Date: 2015-10-07 00:32+0100\n"
"Last-Translator: Matthias Schiffer <mschiffer@universe-factory.net>\n" "Last-Translator: Cyrus Fox <cyrus@lambdacore.de>\n"
"Language-Team: German\n" "Language-Team: German\n"
"Language: de\n" "Language: de\n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
@ -23,14 +23,14 @@ msgid "Use internet connection (mesh VPN)"
msgstr "Internetverbindung nutzen (Mesh-VPN)" msgstr "Internetverbindung nutzen (Mesh-VPN)"
msgid "" msgid ""
"Your internet connection can be used to establish an encrypted connection " "Your internet connection can be used to establish a VPN connection "
"with other nodes. Enable this option if there are no other nodes reachable " "with other nodes. Enable this option if there are no other nodes reachable "
"over WLAN in your vicinity or you want to make a part of your connection's " "over WLAN in your vicinity or you want to make a part of your connection's "
"bandwidth available for the network. You can limit how much bandwidth the " "bandwidth available for the network. You can limit how much bandwidth the "
"node will use at most." "node will use at most."
msgstr "" msgstr ""
"Dein Knoten kann deine Internetverbindung nutzen um darüber eine " "Dein Knoten kann deine Internetverbindung nutzen um darüber eine "
"verschlüsselte Verbindung zu anderen Knoten aufzubauen. Die dafür " "VPN-Verbindung zu anderen Knoten aufzubauen. Die dafür "
"genutzte Bandbreite kannst du beschränken. Aktiviere die Option, falls keine " "genutzte Bandbreite kannst du beschränken. Aktiviere die Option, falls keine "
"per WLAN erreichbaren Nachbarknoten in deiner Nähe sind oder du deine " "per WLAN erreichbaren Nachbarknoten in deiner Nähe sind oder du deine "
"Internetverbindung für das Mesh-Netzwerk zur Verfügung stellen möchtest." "Internetverbindung für das Mesh-Netzwerk zur Verfügung stellen möchtest."

View File

@ -1,12 +1,12 @@
msgid "" msgid ""
msgstr "" msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Project-Id-Version: PACKAGE VERSION\n" "Project-Id-Version: PACKAGE VERSION\n"
"PO-Revision-Date: 2015-08-12 23:30+0100\n" "PO-Revision-Date: 2015-08-12 23:30+0100\n"
"Last-Translator:Tobias Bernot <tqbs@airmail.cc>\n" "Last-Translator:Tobias Bernot <tqbs@airmail.cc>\n"
"Language-Team: French\n" "Language-Team: French\n"
"Language: fr\n" "Language: fr\n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n"
@ -23,14 +23,9 @@ msgid "Use internet connection (mesh VPN)"
msgstr "Utiliser la connection internet (Mesh-VPN)" msgstr "Utiliser la connection internet (Mesh-VPN)"
msgid "" msgid ""
"Your internet connection can be used to establish an encrypted connection " "Your internet connection can be used to establish a VPN connection with "
"with other nodes. Enable this option if there are no other nodes reachable " "other nodes. Enable this option if there are no other nodes reachable over "
"over WLAN in your vicinity or you want to make a part of your connection's " "WLAN in your vicinity or you want to make a part of your connection's "
"bandwidth available for the network. You can limit how much bandwidth the " "bandwidth available for the network. You can limit how much bandwidth the "
"node will use at most." "node will use at most."
msgstr "" msgstr ""
"Votre nœud peut partager votre accès internet grâce une communication encryptée "
"avec d'autres nœuds. Vous pouvez limiter la bande passante utilisée par ceci. "
"Active cette option, si vous n'avez pas d'autres nœuds atteignables par WLAN "
"ou si vous voulez partager votre bande passante pour le réseau MESH."

View File

@ -14,7 +14,7 @@ msgid "Use internet connection (mesh VPN)"
msgstr "" msgstr ""
msgid "" msgid ""
"Your internet connection can be used to establish an encrypted connection " "Your internet connection can be used to establish a VPN connection "
"with other nodes. Enable this option if there are no other nodes reachable " "with other nodes. Enable this option if there are no other nodes reachable "
"over WLAN in your vicinity or you want to make a part of your connection's " "over WLAN in your vicinity or you want to make a part of your connection's "
"bandwidth available for the network. You can limit how much bandwidth the " "bandwidth available for the network. You can limit how much bandwidth the "

View File

@ -1,7 +1,16 @@
local fs = require "nixio.fs"
local has_fastd = fs.access('/lib/gluon/mesh-vpn/fastd')
local has_tunneldigger = fs.access('/lib/gluon/mesh-vpn/tunneldigger')
return function(form, uci) return function(form, uci)
if not (has_fastd or has_tunneldigger) then
return
end
local msg = translate( local msg = translate(
'Your internet connection can be used to establish an ' .. 'Your internet connection can be used to establish a ' ..
'encrypted connection with other nodes. ' .. 'VPN connection with other nodes. ' ..
'Enable this option if there are no other nodes reachable ' .. 'Enable this option if there are no other nodes reachable ' ..
'over WLAN in your vicinity or you want to make a part of ' .. 'over WLAN in your vicinity or you want to make a part of ' ..
'your connection\'s bandwidth available for the network. You can limit how ' .. 'your connection\'s bandwidth available for the network. You can limit how ' ..
@ -13,10 +22,15 @@ return function(form, uci)
local o local o
local meshvpn = s:option(Flag, "meshvpn", translate("Use internet connection (mesh VPN)")) local meshvpn = s:option(Flag, "meshvpn", translate("Use internet connection (mesh VPN)"))
meshvpn.default = uci:get_bool("fastd", "mesh_vpn", "enabled") meshvpn.default = uci:get_bool("fastd", "mesh_vpn", "enabled") or uci:get_bool("tunneldigger", "mesh_vpn", "enabled")
function meshvpn:write(data) function meshvpn:write(data)
if has_fastd then
uci:set("fastd", "mesh_vpn", "enabled", data) uci:set("fastd", "mesh_vpn", "enabled", data)
end end
if has_tunneldigger then
uci:set("tunneldigger", "mesh_vpn", "enabled", data)
end
end
local limit = s:option(Flag, "limit_enabled", translate("Limit bandwidth")) local limit = s:option(Flag, "limit_enabled", translate("Limit bandwidth"))
limit:depends(meshvpn, true) limit:depends(meshvpn, true)
@ -43,5 +57,5 @@ return function(form, uci)
uci:set("simple-tc", "mesh_vpn", "limit_egress", data) uci:set("simple-tc", "mesh_vpn", "limit_egress", data)
end end
return {'fastd', 'simple-tc'} return {'fastd', 'tunneldigger', 'simple-tc'}
end end