From a49ef70c5383ab05fabfce9eb2fe80a93d52a0f4 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Fri, 10 Mar 2017 19:02:09 +0100 Subject: [PATCH] gluon-config-mode-mesh-vpn: add tunneldigger support Based-on-patch-by: Cyrus Fox --- package/gluon-config-mode-mesh-vpn/Makefile | 2 +- package/gluon-config-mode-mesh-vpn/i18n/de.po | 8 +++---- package/gluon-config-mode-mesh-vpn/i18n/fr.po | 13 ++++------ .../i18n/gluon-config-mode-mesh-vpn.pot | 2 +- .../config-mode/wizard/0300-mesh-vpn.lua | 24 +++++++++++++++---- 5 files changed, 29 insertions(+), 20 deletions(-) diff --git a/package/gluon-config-mode-mesh-vpn/Makefile b/package/gluon-config-mode-mesh-vpn/Makefile index c52ffed1..20e5c016 100644 --- a/package/gluon-config-mode-mesh-vpn/Makefile +++ b/package/gluon-config-mode-mesh-vpn/Makefile @@ -14,7 +14,7 @@ define Package/gluon-config-mode-mesh-vpn SECTION:=gluon CATEGORY:=Gluon 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 define Build/Prepare diff --git a/package/gluon-config-mode-mesh-vpn/i18n/de.po b/package/gluon-config-mode-mesh-vpn/i18n/de.po index 8c613aa0..06d44b8c 100644 --- a/package/gluon-config-mode-mesh-vpn/i18n/de.po +++ b/package/gluon-config-mode-mesh-vpn/i18n/de.po @@ -1,8 +1,8 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" -"PO-Revision-Date: 2015-03-19 22:05+0100\n" -"Last-Translator: Matthias Schiffer \n" +"PO-Revision-Date: 2015-10-07 00:32+0100\n" +"Last-Translator: Cyrus Fox \n" "Language-Team: German\n" "Language: de\n" "MIME-Version: 1.0\n" @@ -23,14 +23,14 @@ msgid "Use internet connection (mesh VPN)" msgstr "Internetverbindung nutzen (Mesh-VPN)" 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 " "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 " "node will use at most." msgstr "" "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 " "per WLAN erreichbaren Nachbarknoten in deiner Nähe sind oder du deine " "Internetverbindung für das Mesh-Netzwerk zur Verfügung stellen möchtest." diff --git a/package/gluon-config-mode-mesh-vpn/i18n/fr.po b/package/gluon-config-mode-mesh-vpn/i18n/fr.po index fc854613..0c324f32 100644 --- a/package/gluon-config-mode-mesh-vpn/i18n/fr.po +++ b/package/gluon-config-mode-mesh-vpn/i18n/fr.po @@ -1,12 +1,12 @@ msgid "" msgstr "" -"Content-Type: text/plain; charset=UTF-8\n" "Project-Id-Version: PACKAGE VERSION\n" "PO-Revision-Date: 2015-08-12 23:30+0100\n" "Last-Translator:Tobias Bernot \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" @@ -23,14 +23,9 @@ msgid "Use internet connection (mesh VPN)" msgstr "Utiliser la connection internet (Mesh-VPN)" msgid "" -"Your internet connection can be used to establish an encrypted connection " -"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 " +"Your internet connection can be used to establish a VPN connection 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 " "bandwidth available for the network. You can limit how much bandwidth the " "node will use at most." 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." - diff --git a/package/gluon-config-mode-mesh-vpn/i18n/gluon-config-mode-mesh-vpn.pot b/package/gluon-config-mode-mesh-vpn/i18n/gluon-config-mode-mesh-vpn.pot index 52e2eef8..b6722919 100644 --- a/package/gluon-config-mode-mesh-vpn/i18n/gluon-config-mode-mesh-vpn.pot +++ b/package/gluon-config-mode-mesh-vpn/i18n/gluon-config-mode-mesh-vpn.pot @@ -14,7 +14,7 @@ msgid "Use internet connection (mesh VPN)" msgstr "" 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 " "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 " diff --git a/package/gluon-config-mode-mesh-vpn/luasrc/lib/gluon/config-mode/wizard/0300-mesh-vpn.lua b/package/gluon-config-mode-mesh-vpn/luasrc/lib/gluon/config-mode/wizard/0300-mesh-vpn.lua index 6aa4ee52..69a64bd0 100644 --- a/package/gluon-config-mode-mesh-vpn/luasrc/lib/gluon/config-mode/wizard/0300-mesh-vpn.lua +++ b/package/gluon-config-mode-mesh-vpn/luasrc/lib/gluon/config-mode/wizard/0300-mesh-vpn.lua @@ -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) + if not (has_fastd or has_tunneldigger) then + return + end + local msg = translate( - 'Your internet connection can be used to establish an ' .. - 'encrypted connection with other nodes. ' .. + 'Your internet connection can be used to establish a ' .. + 'VPN connection 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 bandwidth available for the network. You can limit how ' .. @@ -13,9 +22,14 @@ return function(form, uci) local o 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) - uci:set("fastd", "mesh_vpn", "enabled", data) + if has_fastd then + uci:set("fastd", "mesh_vpn", "enabled", data) + end + if has_tunneldigger then + uci:set("tunneldigger", "mesh_vpn", "enabled", data) + end end local limit = s:option(Flag, "limit_enabled", translate("Limit bandwidth")) @@ -43,5 +57,5 @@ return function(form, uci) uci:set("simple-tc", "mesh_vpn", "limit_egress", data) end - return {'fastd', 'simple-tc'} + return {'fastd', 'tunneldigger', 'simple-tc'} end