|
@@ -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,
|