diff --git a/docs/site-example/i18n/de.po b/docs/site-example/i18n/de.po index 141d42d3a477eefd8e332b9027534d25ef5841e6..ca2c5a53914e02df3836e4a51a393768aac3a60a 100644 --- a/docs/site-example/i18n/de.po +++ b/docs/site-example/i18n/de.po @@ -31,6 +31,13 @@ msgstr "" "<%= pubkey %>" "</div>" +msgid "gluon-config-mode:novpn" +msgstr "" +"<p><div class=\"the-key\">Du hast ausgewählt, <strong>kein Mesh-VPN</strong> " +"zu nutzen. Dein Knoten kann also nur dann eine Verbindung zum Freifunk Netz " +"aufbauen, wenn andere Freifunk-Router in WLAN-Reichweite sind." +"</div></p>" + msgid "gluon-config-mode:reboot" msgstr "" "<p>Dein Knoten <em><%= pcdata(hostname) %></em> startet gerade neu und wird " diff --git a/docs/site-example/i18n/en.po b/docs/site-example/i18n/en.po index 87181a980503f6f0300137cd5e8304cadf03c6c8..94b44ba4335edf9afd76ee354207b519de84969a 100644 --- a/docs/site-example/i18n/en.po +++ b/docs/site-example/i18n/en.po @@ -28,6 +28,12 @@ msgstr "" "<%= pubkey %>" "</div>" +msgid "gluon-config-mode:novpn" +msgstr "" +"<p><div class=\"the-key\">You have selected <strong>not</strong> to use the mesh VPN. " +"Your node will only be able to connect to the Freifunk network if other nodes in reach " +"already have a connection.</div></p>" + msgid "gluon-config-mode:reboot" msgstr "" "<p>Your node <em><%= pcdata(hostname) %></em> is currently rebooting and will " diff --git a/docs/site-example/i18n/fr.po b/docs/site-example/i18n/fr.po index b0e97ca2b0bfb532dd20f828d23f684650b769bd..2429ed63f831f909ffdb096717ba2eb3f1d13691 100644 --- a/docs/site-example/i18n/fr.po +++ b/docs/site-example/i18n/fr.po @@ -31,6 +31,12 @@ msgstr "" "<%= pubkey %>" "</div>" +msgid "gluon-config-mode:novpn" +msgstr "" +"<p><div class=\"the-key\">Vous avez choisi de <strong>ne pas utiliser</strong> " +"le réseau VPN. Votre nœud ne pourra se connecter au réseau Freifunk que si " +"d'autres nœuds à portée ont déjà une connexion.</div></p>" + msgid "gluon-config-mode:reboot" msgstr "" "<p>Votre nœud <em><%= pcdata(hostname) %></em> es en train de redémarrer et " diff --git a/docs/site-example/i18n/gluon-site.pot b/docs/site-example/i18n/gluon-site.pot index a161a12b04c6dbe3175905ae6e8118babe76ef67..7fe3293cf510835ee2bfeaa6ecea32d064177a7f 100644 --- a/docs/site-example/i18n/gluon-site.pot +++ b/docs/site-example/i18n/gluon-site.pot @@ -7,6 +7,9 @@ msgstr "" msgid "gluon-config-mode:pubkey" msgstr "" +msgid "gluon-config-mode:novpn" +msgstr "" + msgid "gluon-config-mode:reboot" msgstr "" diff --git a/docs/user/site.rst b/docs/user/site.rst index 021cea217648173b7356d0e3dadaef41ce2ace0d..abf787f0ace354cd85ee62401d92def93cbee003 100644 --- a/docs/user/site.rst +++ b/docs/user/site.rst @@ -368,6 +368,9 @@ gluon-config-mode:welcome gluon-config-mode:pubkey Information about the public VPN key on the reboot page. +gluon-config-mode:novpn + Information shown on the reboot page, if the mesh VPN was not selected. + gluon-config-mode:altitude-label Label for the ``altitude`` field diff --git a/package/gluon-config-mode-mesh-vpn/luasrc/lib/gluon/config-mode/reboot/0100-mesh-vpn.lua b/package/gluon-config-mode-mesh-vpn/luasrc/lib/gluon/config-mode/reboot/0100-mesh-vpn.lua index f5868c60540850498de496eaadf99b386d08066d..4901aa5d1da9aca184f50979fab1fa8c026df0ba 100644 --- a/package/gluon-config-mode-mesh-vpn/luasrc/lib/gluon/config-mode/reboot/0100-mesh-vpn.lua +++ b/package/gluon-config-mode-mesh-vpn/luasrc/lib/gluon/config-mode/reboot/0100-mesh-vpn.lua @@ -1,10 +1,4 @@ local uci = require("simple-uci").cursor() -local meshvpn_enabled = uci:get_bool("fastd", "mesh_vpn", "enabled") - -if not meshvpn_enabled then - return -end - local lutil = require "gluon.web.util" local site = require 'gluon.site_config' @@ -13,11 +7,23 @@ local util = require "gluon.util" local pretty_hostname = require 'pretty_hostname' -local pubkey = util.trim(lutil.exec("/etc/init.d/fastd show_key mesh_vpn")) + +local meshvpn_enabled = uci:get_bool("fastd", "mesh_vpn", "enabled") + local hostname = pretty_hostname.get(uci) local contact = uci:get_first("gluon-node-info", "owner", "contact") -local msg = translate('gluon-config-mode:pubkey') +local pubkey +local msg + +if meshvpn_enabled then + pubkey = util.trim(lutil.exec("/etc/init.d/fastd show_key mesh_vpn")) + msg = _translate('gluon-config-mode:pubkey') +else + msg = _translate('gluon-config-mode:novpn') +end + +if not msg then return end renderer.render_string(msg, { pubkey = pubkey,