Previously, the config-mode was responsible for generating the fastd secret. This patch sets the default secret to "generate" causing a secret to be generated on its first use (e.g. show_key or start). This also changes the info page (in Expert Mode) to show "n/a" when the public key is not yet available.
14 lines
279 B
Lua
Executable File
14 lines
279 B
Lua
Executable File
#!/usr/bin/lua
|
|
|
|
local uci = require 'luci.model.uci'
|
|
|
|
local c = uci.cursor()
|
|
|
|
local secret = c:get("fastd", "mesh_vpn", "secret")
|
|
|
|
if not secret or not secret:match(("%x"):rep(64)) then
|
|
c:set("fastd", "mesh_vpn", "secret", "generate")
|
|
c:save("fastd")
|
|
c:commit("fastd")
|
|
end
|