cjdns: support the supernodes feature (#884)
authorWilliam Fleurant <meshnet@protonmail.com>
Mon, 20 Jun 2022 19:31:44 +0000 (21:31 +0200)
committerGitHub <noreply@github.com>
Mon, 20 Jun 2022 19:31:44 +0000 (21:31 +0200)
Signed-off-by: William Fleurant <meshnet@protonmail.com>
cjdns/Makefile
cjdns/lua/cjdns/uci.lua
luci-app-cjdns/Makefile
luci-app-cjdns/luasrc/model/cbi/cjdns/peering.lua

index b926bc7ba20df38737a4ca33e2279cb6d5f42faa..1f8592b60eb1fb66164decf7823e06e79a516f52 100644 (file)
@@ -18,7 +18,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=cjdns
 PKG_VERSION:=v21.1
-PKG_RELEASE:=3
+PKG_RELEASE:=4
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=https://codeload.github.com/cjdelisle/cjdns/tar.gz/$(PKG_NAME)-$(PKG_VERSION)?
index f4716b772bf89e219980d7e707d37b35f306a4b2..d6b6633e9968a69c30bd68075f93b5f649782c55 100644 (file)
@@ -53,6 +53,10 @@ function UCI.get()
     obj.router.interface.tunDevice = config.tun_device
   end
 
+  cursor:foreach("cjdns", "supernodes", function(supernodes)
+    table.insert(obj.router.supernodes, supernodes.public_key)
+  end)
+
   for i,section in pairs(obj.security) do
     if type(section.seccomp) == "number" then
       obj.security[i].seccomp = tonumber(config.seccomp)
index 9396528017e3dd2cec64c256eb0d6d3df8ef3584..0b6485a1264a5f18d1972928a3a503ec4490b63a 100644 (file)
@@ -18,7 +18,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=luci-app-cjdns
 PKG_VERSION:=1.3
-PKG_RELEASE:=8
+PKG_RELEASE:=9
 
 PKG_MAINTAINER:=William Fleurant <meshnet@protonmail.com>
 PKG_LICENSE:=GPL-3.0-or-later
index 2b1fc1be95e2682826e5cbebcf977c514f106404..3526afe03f2766814d337c9ed50182a1d4446ce2 100644 (file)
@@ -70,4 +70,13 @@ eth_peers:option(Value, "address", translate("MAC address")).datatype = "macaddr
 eth_peers:option(Value, "public_key", translate("Public key"))
 eth_peers:option(Value, "password", translate("Password"))
 
+-- Supernodes
+supernodes = m:section(TypedSection, "supernodes", translate("List of Supernodes"),
+  translate("If none are specified they'll be taken from your peers"))
+supernodes.anonymous = true
+supernodes.addremove = true
+supernodes.template  = "cbi/tblsection"
+
+supernodes:option(Value, "public_key", translate("Public Key")).size = 55
+
 return m