Skip to content
Snippets Groups Projects
Commit ffd86668 authored by Matthias Schiffer's avatar Matthias Schiffer
Browse files

Validate site.conf

parent 626056e6
No related branches found
No related tags found
No related merge requests found
Showing with 111 additions and 14 deletions
include $(TOPDIR)/rules.mk include $(TOPDIR)/rules.mk
PKG_NAME:=gluon-autoupdater PKG_NAME:=gluon-autoupdater
PKG_VERSION:=2 PKG_VERSION:=3
PKG_RELEASE:=$(GLUON_BRANCH) PKG_RELEASE:=$(GLUON_BRANCH)
PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME) PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
include $(INCLUDE_DIR)/package.mk include $(GLUONDIR)/include/package.mk
define Package/gluon-autoupdater define Package/gluon-autoupdater
SECTION:=gluon SECTION:=gluon
...@@ -34,4 +34,9 @@ define Package/gluon-autoupdater/install ...@@ -34,4 +34,9 @@ define Package/gluon-autoupdater/install
fi fi
endef endef
define Package/gluon-autoupdater/postinst
#!/bin/sh
$(call GluonCheckSite,check_site.lua)
endef
$(eval $(call BuildPackage,gluon-autoupdater)) $(eval $(call BuildPackage,gluon-autoupdater))
need_string 'autoupdater.branch'
local function check_branch(k, _)
local prefix = string.format('autoupdater.branches[%q].', k)
need_string(prefix .. 'name')
need_string_array(prefix .. 'mirrors')
need_number(prefix .. 'probability')
need_number(prefix .. 'good_signatures')
need_string_array(prefix .. 'pubkeys')
end
need_table('autoupdater.branches', check_branch)
...@@ -4,11 +4,11 @@ ...@@ -4,11 +4,11 @@
include $(TOPDIR)/rules.mk include $(TOPDIR)/rules.mk
PKG_NAME:=gluon-config-mode PKG_NAME:=gluon-config-mode
PKG_VERSION:=2 PKG_VERSION:=3
PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME) PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
include $(INCLUDE_DIR)/package.mk include $(GLUONDIR)/include/package.mk
define Package/gluon-config-mode define Package/gluon-config-mode
SECTION:=gluon SECTION:=gluon
...@@ -35,4 +35,9 @@ define Package/gluon-config-mode/install ...@@ -35,4 +35,9 @@ define Package/gluon-config-mode/install
$(CP) ./files/* $(1)/ $(CP) ./files/* $(1)/
endef endef
define Package/gluon-config-mode/postinst
#!/bin/sh
$(call GluonCheckSite,check_site.lua)
endef
$(eval $(call BuildPackage,gluon-config-mode)) $(eval $(call BuildPackage,gluon-config-mode))
need_string 'config_mode.msg_welcome'
need_string 'config_mode.msg_pubkey'
need_string 'config_mode.msg_reboot'
include $(TOPDIR)/rules.mk include $(TOPDIR)/rules.mk
PKG_NAME:=gluon-core PKG_NAME:=gluon-core
PKG_VERSION:=2 PKG_VERSION:=3
PKG_RELEASE:=$(GLUON_VERSION) PKG_RELEASE:=$(GLUON_VERSION)
PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME) PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
include $(INCLUDE_DIR)/package.mk include $(GLUONDIR)/include/package.mk
define Package/gluon-core define Package/gluon-core
SECTION:=gluon SECTION:=gluon
...@@ -36,4 +36,9 @@ define Package/gluon-core/install ...@@ -36,4 +36,9 @@ define Package/gluon-core/install
echo "$(GLUON_VERSION)" > $(1)/lib/gluon/gluon-version echo "$(GLUON_VERSION)" > $(1)/lib/gluon/gluon-version
endef endef
define Package/gluon-core/postinst
#!/bin/sh
$(call GluonCheckSite,check_site.lua)
endef
$(eval $(call BuildPackage,gluon-core)) $(eval $(call BuildPackage,gluon-core))
need_string 'site_code'
need_string 'site_name'
need_string 'hostname_prefix'
need_string 'timezone'
need_string_array('ntp_servers', false)
need_string_match('prefix4', '^%d+.%d+.%d+.%d+/%d+$')
need_string_match('prefix6', '^[%x:]+/%d+$')
include $(TOPDIR)/rules.mk include $(TOPDIR)/rules.mk
PKG_NAME:=gluon-legacy PKG_NAME:=gluon-legacy
PKG_VERSION:=1 PKG_VERSION:=2
PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME) PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
include $(INCLUDE_DIR)/package.mk include $(GLUONDIR)/include/package.mk
define Package/gluon-legacy define Package/gluon-legacy
SECTION:=gluon SECTION:=gluon
...@@ -32,4 +32,9 @@ define Package/gluon-legacy/install ...@@ -32,4 +32,9 @@ define Package/gluon-legacy/install
$(CP) ./files/* $(1)/ $(CP) ./files/* $(1)/
endef endef
define Package/gluon-legacy/postinst
#!/bin/sh
$(call GluonCheckSite,check_site.lua)
endef
$(eval $(call BuildPackage,gluon-legacy)) $(eval $(call BuildPackage,gluon-legacy))
need_string_array 'legacy.version_files'
need_string_array 'legacy.old_files'
need_string_array 'legacy.config_mode_configs'
need_string_array 'legacy.fastd_configs'
need_string 'legacy.mesh_ifname'
need_string_array 'legacy.tc_configs'
need_string_array 'legacy.wifi_names'
include $(TOPDIR)/rules.mk include $(TOPDIR)/rules.mk
PKG_NAME:=gluon-mesh-batman-adv PKG_NAME:=gluon-mesh-batman-adv
PKG_VERSION:=2 PKG_VERSION:=3
PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME) PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
include $(INCLUDE_DIR)/package.mk include $(GLUONDIR)/include/package.mk
define Package/gluon-mesh-batman-adv define Package/gluon-mesh-batman-adv
SECTION:=gluon SECTION:=gluon
...@@ -32,4 +32,10 @@ define Package/gluon-mesh-batman-adv/install ...@@ -32,4 +32,10 @@ define Package/gluon-mesh-batman-adv/install
$(CP) ./files/* $(1)/ $(CP) ./files/* $(1)/
endef endef
define Package/gluon-mesh-batman-adv/postinst
#!/bin/sh
$(call GluonCheckSite,check_site.lua)
endef
$(eval $(call BuildPackage,gluon-mesh-batman-adv)) $(eval $(call BuildPackage,gluon-mesh-batman-adv))
need_string('regdom')
for _, config in ipairs({'wifi24', 'wifi5'}) do
need_string(config .. '.ssid')
need_number(config .. '.channel')
need_string(config .. '.htmode')
need_string(config .. '.mesh_ssid')
need_string_match(config .. '.mesh_bssid', '^%x[02468aAcCeE]:%x%x:%x%x:%x%x:%x%x:%x%x$')
need_number(config .. '.mesh_mcast_rate')
end
include $(TOPDIR)/rules.mk include $(TOPDIR)/rules.mk
PKG_NAME:=gluon-mesh-vpn-fastd PKG_NAME:=gluon-mesh-vpn-fastd
PKG_VERSION:=2 PKG_VERSION:=3
PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME) PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
include $(INCLUDE_DIR)/package.mk include $(GLUONDIR)/include/package.mk
define Package/gluon-mesh-vpn-fastd define Package/gluon-mesh-vpn-fastd
SECTION:=gluon SECTION:=gluon
...@@ -32,4 +32,9 @@ define Package/gluon-mesh-vpn-fastd/install ...@@ -32,4 +32,9 @@ define Package/gluon-mesh-vpn-fastd/install
$(CP) ./files/* $(1)/ $(CP) ./files/* $(1)/
endef endef
define Package/gluon-mesh-vpn-fastd/postinst
#!/bin/sh
$(call GluonCheckSite,check_site.lua)
endef
$(eval $(call BuildPackage,gluon-mesh-vpn-fastd)) $(eval $(call BuildPackage,gluon-mesh-vpn-fastd))
need_string_array 'fastd_mesh_vpn.methods'
need_number 'fastd_mesh_vpn.mtu'
need_number 'fastd_mesh_vpn.backbone.limit'
local function check_peer(k, _)
local prefix = string.format('fastd_mesh_vpn.backbone.peers[%q].', k)
need_string(prefix .. 'key')
need_string_array(prefix .. 'remotes')
end
need_table('fastd_mesh_vpn.backbone.peers', check_peer)
include $(TOPDIR)/rules.mk include $(TOPDIR)/rules.mk
PKG_NAME:=gluon-next-node PKG_NAME:=gluon-next-node
PKG_VERSION:=2 PKG_VERSION:=3
PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME) PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
include $(INCLUDE_DIR)/package.mk include $(GLUONDIR)/include/package.mk
define Package/gluon-next-node define Package/gluon-next-node
SECTION:=gluon SECTION:=gluon
...@@ -32,4 +32,9 @@ define Package/gluon-next-node/install ...@@ -32,4 +32,9 @@ define Package/gluon-next-node/install
$(CP) ./files/* $(1)/ $(CP) ./files/* $(1)/
endef endef
define Package/gluon-next-node/postinst
#!/bin/sh
$(call GluonCheckSite,check_site.lua)
endef
$(eval $(call BuildPackage,gluon-next-node)) $(eval $(call BuildPackage,gluon-next-node))
need_string_match('next_node.ip4', '^%d+.%d+.%d+.%d+$')
need_string_match('next_node.ip6', '^[%x:]+$')
need_string_match('next_node.mac', '^%x[02468aAcCeE]:%x%x:%x%x:%x%x:%x%x:%x%x$')
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment