summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWilliam Fleurant <meshnet@protonmail.com>2022-06-20 21:31:44 +0200
committerNick Hainke <vincent@systemli.org>2022-06-21 00:00:51 +0200
commit846a7fd72f9491081e4bfa3c672dd52436d42d0d (patch)
treef28afd5bb50a467a3925f465014d5edf1e4e66d1
parent6b7863eb0f48b701e99e4d28f7432c158a622443 (diff)
cjdns: support the supernodes feature (#884)
Signed-off-by: William Fleurant <meshnet@protonmail.com> (cherry picked from commit d705f7989080f38feba4329e5f24d2c85f99a902) Signed-off-by: Nick Hainke <vincent@systemli.org>
-rw-r--r--cjdns/Makefile2
-rw-r--r--cjdns/lua/cjdns/uci.lua4
-rw-r--r--luci-app-cjdns/Makefile2
-rw-r--r--luci-app-cjdns/luasrc/model/cbi/cjdns/peering.lua9
4 files changed, 15 insertions, 2 deletions
diff --git a/cjdns/Makefile b/cjdns/Makefile
index e1c217a..6bdcd83 100644
--- a/cjdns/Makefile
+++ b/cjdns/Makefile
@@ -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)?
diff --git a/cjdns/lua/cjdns/uci.lua b/cjdns/lua/cjdns/uci.lua
index f4716b7..d6b6633 100644
--- a/cjdns/lua/cjdns/uci.lua
+++ b/cjdns/lua/cjdns/uci.lua
@@ -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)
diff --git a/luci-app-cjdns/Makefile b/luci-app-cjdns/Makefile
index 9396528..0b6485a 100644
--- a/luci-app-cjdns/Makefile
+++ b/luci-app-cjdns/Makefile
@@ -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
diff --git a/luci-app-cjdns/luasrc/model/cbi/cjdns/peering.lua b/luci-app-cjdns/luasrc/model/cbi/cjdns/peering.lua
index 2b1fc1b..3526afe 100644
--- a/luci-app-cjdns/luasrc/model/cbi/cjdns/peering.lua
+++ b/luci-app-cjdns/luasrc/model/cbi/cjdns/peering.lua
@@ -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