Skip to content
Snippets Groups Projects
Commit 663b419c authored by Nils Schneider's avatar Nils Schneider
Browse files

configmode: read pubkey message from site configuration

parent 91d70b98
No related branches found
No related tags found
No related merge requests found
...@@ -34,6 +34,7 @@ endef ...@@ -34,6 +34,7 @@ endef
define Package/gluon-config-mode/install define Package/gluon-config-mode/install
$(CP) ./files/* $(1)/ $(CP) ./files/* $(1)/
$(GLUON_GENERATE) ./generate/* $(1)/
endef endef
$(eval $(call BuildPackage,gluon-config-mode)) $(eval $(call BuildPackage,gluon-config-mode))
config wizard config wizard
option enabled '1' option enabled '1'
option configured '0' option configured '0'
option keyaddress '<a href="mailto:keys@luebeck.freifunk.net">keys@luebeck.freifunk.net</a>'
...@@ -47,12 +47,11 @@ function action_reboot() ...@@ -47,12 +47,11 @@ function action_reboot()
local configmode = require "luci.tools.configmode" local configmode = require "luci.tools.configmode"
local pubkey local pubkey
local uci = luci.model.uci.cursor() local uci = luci.model.uci.cursor()
local address = uci:get_first("configmode", "wizard", "keyaddress")
local meshvpn_enabled = uci:get("fastd", meshvpn_name, "enabled", "0") local meshvpn_enabled = uci:get("fastd", meshvpn_name, "enabled", "0")
if meshvpn_enabled == "1" then if meshvpn_enabled == "1" then
pubkey = configmode.get_fastd_pubkey(meshvpn_name) pubkey = configmode.get_fastd_pubkey(meshvpn_name)
end end
luci.template.render("configmode/reboot", {pubkey=pubkey, address=address}) luci.template.render("configmode/reboot", {pubkey=pubkey})
uci:foreach("configmode", "wizard", function(s) uci:foreach("configmode", "wizard", function(s)
uci:set("configmode", s[".name"], "configured", "1") uci:set("configmode", s[".name"], "configured", "1")
......
...@@ -25,7 +25,7 @@ $Id$ ...@@ -25,7 +25,7 @@ $Id$
<% if pubkey then %> <% if pubkey then %>
<fieldset class="cbi-section"> <fieldset class="cbi-section">
<p> <p>
Dies ist der öffentliche Schlüssel deines Freifunkknotens. Bitte schicke ihn an <%=address%>, um ihn auf den Freifunkservern eintragen zu lassen. Sobald der Schlüssel eingetragen wurde, kann dein Knoten das Mesh-VPN nutzen. @configmode.msg_pubkey@
</p> </p>
<div style="text-align: center;font-size: 2em;line-height: 1em; background: #f5f5f5; border: 1px solid #ececec; margin-bottom: 0.5em; padding: 0.5em"> <div style="text-align: center;font-size: 2em;line-height: 1em; background: #f5f5f5; border: 1px solid #ececec; margin-bottom: 0.5em; padding: 0.5em">
<%=pubkey%> <%=pubkey%>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment