0
0
mirror of https://github.com/openwrt/routing.git synced 2025-01-31 08:21:24 +00:00
Daniel Golle 89914e47de luci-app-cjdns: import package from SeattleMeshnet/meshbox
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2015-04-20 12:45:07 +02:00

33 lines
973 B
Lua

m = Map("cjdns", translate("cjdns"),
translate("Implements an encrypted IPv6 network using public-key \
cryptography for address allocation and a distributed hash table for \
routing. This provides near-zero-configuration networking, and prevents \
many of the security and scalability issues that plague existing \
networks."))
dkjson = require("dkjson")
cjdns = require("cjdns")
require("cjdns/uci")
local f = SimpleForm("cjdrouteconf", translate("Edit cjdroute.conf"),
translate("JSON interface to what's /etc/cjdroute.conf on other systems. \
Will be parsed and written to UCI by <code>cjdrouteconf set</code>."))
local o = f:field(Value, "_cjdrouteconf")
o.template = "cbi/tvalue"
o.rows = 25
function o.cfgvalue(self, section)
return dkjson.encode(cjdns.uci.get(), { indent = true })
end
function o.write(self, section, value)
local obj, pos, err = dkjson.decode(value, 1, nil)
if obj then
cjdns.uci.set(obj)
end
end
return f