From eb590bdc128947324f9590b8c59d00660932de82 Mon Sep 17 00:00:00 2001 From: Jan-Philipp Litza Date: Sun, 30 Aug 2015 21:41:57 +0200 Subject: [PATCH] gluon-config-mode-mesh-vpn: Move display of key to translations When rebooting the node in config mode, currently the fastd key is forcefully displayed in a fixed format. This is confusing in communities where fastd accepts all keys and no key submission is needed. Furthermore, some communities might want to personalize the display of the key (see #387). This patch moves the displaying
from the package's lua file to the translation files of the sample site configuration and mentiones the change in the release notes. --- docs/index.rst | 1 + docs/releases/v2015.2.rst | 37 +++++++++++++++++++ docs/site-example/i18n/de.po | 8 +++- docs/site-example/i18n/en.po | 8 +++- .../config-mode/reboot/0100-mesh-vpn.lua | 7 +--- 5 files changed, 53 insertions(+), 8 deletions(-) create mode 100644 docs/releases/v2015.2.rst diff --git a/docs/index.rst b/docs/index.rst index 2b4bc8db..1fd9d16d 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -57,6 +57,7 @@ Releases .. toctree:: :maxdepth: 1 + releases/v2015.2 releases/v2015.1.2 releases/v2015.1.1 releases/v2015.1 diff --git a/docs/releases/v2015.2.rst b/docs/releases/v2015.2.rst new file mode 100644 index 00000000..eda71390 --- /dev/null +++ b/docs/releases/v2015.2.rst @@ -0,0 +1,37 @@ +Gluon 2015.2 (in development) +============================= + +Added (and removed) hardware support +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + +New features +~~~~~~~~~~~~ + + +Bugfixes +~~~~~~~~ + + +Site changes +~~~~~~~~~~~~ +* ``i18n/`` + + - The translations of ``gluon-config-mode:pubkey`` now have to show the fastd + public key itself if desired, making its format and whether it is shown at + all configurable. To retain the old format, add ``

`` to the beginning of + your translations and append:: + + "

" + "
" + " # <%= hostname %>" + "
" + "<%= pubkey %>" + "
" + +Internals +~~~~~~~~~ + + +Known Issues +~~~~~~~~~~~~ diff --git a/docs/site-example/i18n/de.po b/docs/site-example/i18n/de.po index ce27c813..c4a9f9dc 100644 --- a/docs/site-example/i18n/de.po +++ b/docs/site-example/i18n/de.po @@ -18,12 +18,18 @@ msgstr "" msgid "gluon-config-mode:pubkey" msgstr "" -"Dies ist der öffentliche Schlüssel deines Freifunk-Knotens. Erst nachdem " +"

Dies ist der öffentliche Schlüssel deines Freifunk-Knotens. Erst nachdem " "er auf den Servern des Entenhausener Freifunk-Projektes eingetragen wurde, " "kann sich dein Knoten mit dem Entenhausener Mesh-VPN zu verbinden. Bitte " "schicke dazu diesen Schlüssel und den Namen deines Knotens " "(<%=hostname%>) an " "keys@entenhausen.freifunk.net." +"

" +"
" +" # <%= hostname %>" +"
" +"<%= pubkey %>" +"
" msgid "gluon-config-mode:reboot" msgstr "" diff --git a/docs/site-example/i18n/en.po b/docs/site-example/i18n/en.po index dedc06e1..ac28fea5 100644 --- a/docs/site-example/i18n/en.po +++ b/docs/site-example/i18n/en.po @@ -17,11 +17,17 @@ msgstr "" msgid "gluon-config-mode:pubkey" msgstr "" -"This is your Freifunk node's public key. The node won't be able to " +"

This is your Freifunk node's public key. The node won't be able to " "connect to the mesh VPN until the key has been registered on the Freifunk " "Duckburg servers. " "To register the key send it together with your node's name (<%=hostname%>) to " "keys@entenhausen.freifunk.net." +"

" +"
" +" # <%= hostname %>" +"
" +"<%= pubkey %>" +"
" msgid "gluon-config-mode:reboot" diff --git a/package/gluon-config-mode-mesh-vpn/files/lib/gluon/config-mode/reboot/0100-mesh-vpn.lua b/package/gluon-config-mode-mesh-vpn/files/lib/gluon/config-mode/reboot/0100-mesh-vpn.lua index 1b32c731..9bd31486 100644 --- a/package/gluon-config-mode-mesh-vpn/files/lib/gluon/config-mode/reboot/0100-mesh-vpn.lua +++ b/package/gluon-config-mode-mesh-vpn/files/lib/gluon/config-mode/reboot/0100-mesh-vpn.lua @@ -12,12 +12,7 @@ else local pubkey = util.trim(util.exec("/etc/init.d/fastd show_key " .. "mesh_vpn")) local hostname = uci:get_first("system", "system", "hostname") - local msg = [[

]] .. i18n.translate('gluon-config-mode:pubkey') .. [[

-
- # <%= hostname %> -
- <%= pubkey %> -
]] + local msg = i18n.translate('gluon-config-mode:pubkey') return function () luci.template.render_string(msg, { pubkey=pubkey