gluon-yggdrasil: init

This commit is contained in:
Maciej Krüger 2022-04-07 02:38:06 +02:00 committed by Alexander List
parent 64a9023278
commit f4ccb80226
2 changed files with 32 additions and 0 deletions

View File

@ -0,0 +1,13 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=gluon-yggdrasil
include ../gluon.mk
define Package/gluon-yggdrasil
TITLE:=yggdrasil integration
DEPENDS:=+gluon-core +yggdrasil
endef
$(eval $(call BuildPackageGluon,gluon-yggdrasil))

View File

@ -0,0 +1,19 @@
#!/usr/bin/lua
-- TODO: maybe restrict multicast to mesh?
-- TODO: userpeers with user prefix (u_) in id plus config-mode webui for that
-- similar to static dns list field
if site.mesh.yggdrasil.enabled(false) then
os.execute('/etc/init.d/yggdrasil enable')
-- TODO: clear old peers (remove everything type peer, id ^s_[0-9]+)
for index, peer in pairs(site.mesh.yggdrasil.peers({})) do
uci:section('yggdrasil', 'peer', 's_' .. index, {
uri = peer
})
end
else
os.execute('/etc/init.d/yggdrasil disable')
end