Browse Source

Weitere anpassungen für multidomain

Michael Schwarz 4 years ago
parent
commit
7d635a6f07
6 changed files with 145 additions and 129 deletions
  1. 0 1
      .gitignore
  2. 6 0
      extra/sites.conf
  3. 4 110
      extra/template.conf
  4. 0 15
      scripts/gensites.py
  5. 133 0
      site.conf
  6. 2 3
      site.mk

+ 0 - 1
.gitignore

@@ -1,2 +1 @@
-site.conf
 domains
 domains

+ 6 - 0
extra/sites.conf

@@ -18,6 +18,12 @@
 #	},
 #	},
 #},
 #},
 sites = (
 sites = (
+	{
+		'site_name' : 'Bitte wählen',
+		'site_code' : 'ffho',
+		'ssid' : 'hochstift.freifunk.net/unset',
+		'group' : 'uml',
+	},
 	{
 	{
 		'site_name' : 'Freifunk Hochstift - Altenbeken',
 		'site_name' : 'Freifunk Hochstift - Altenbeken',
 		'site_code' : 'ffho_abn',
 		'site_code' : 'ffho_abn',

+ 4 - 110
extra/template.conf

@@ -1,19 +1,10 @@
 {
 {
-	-- A new node's name will be autogenerated from
-	-- it's primary MAC address and this prefix.
-	-- e.g. freifunk-0123456789ab
-	hostname_prefix = 'freifunk',
-
-	-- name of this site
-	-- site_name = 'Freifunk Hochstift - ${site}',
-	site_name = '%SN',
-
-	-- short name of this site
-	-- site_code = 'ffho_${un-code}'
-	site_code = '%SC',
+	domain_names = {
+		%SC = '%SN',
+	},
 
 
 	-- hide domain
 	-- hide domain
-	hide_domain = '%HIDE',
+	hide_domain = %HIDE,
 
 
 	-- 32 bytes of random data, encoded in hexadecimal, used to seed other 
 	-- 32 bytes of random data, encoded in hexadecimal, used to seed other 
 	-- random values specific to the mesh domain. It must be the same for all 
 	-- random values specific to the mesh domain. It must be the same for all 
@@ -26,12 +17,6 @@
 	prefix4 = '%V4',
 	prefix4 = '%V4',
 	prefix6 = '2a03:2260:2342:%V6::/64',
 	prefix6 = '2a03:2260:2342:%V6::/64',
 
 
-	-- timezone
-	timezone = 'CET-1CEST,M3.5.0,M10.5.0/3', -- Europe/Berlin
-
-	-- network-internal ntp service
-	ntp_servers = {'ntp.srv.in.ffho.net'},
-
 	-- OpenWRT Package Repository (IPv6 capable)
 	-- OpenWRT Package Repository (IPv6 capable)
 	opkg = {
 	opkg = {
 		openwrt = 'http://firmware.srv.in.ffho.net/openwrt/packages-%v/%A',
 		openwrt = 'http://firmware.srv.in.ffho.net/openwrt/packages-%v/%A',
@@ -40,9 +25,6 @@
 		},
 		},
 	},
 	},
 
 
-	-- regulatory domain of your wifi
-	regdom = 'DE',
-
 	mesh = {
 	mesh = {
 		-- for now, we don't use vxlan on the mesh
 		-- for now, we don't use vxlan on the mesh
 		vxlan = false,
 		vxlan = false,
@@ -61,7 +43,6 @@
 		},
 		},
 		mesh = {
 		mesh = {
 			id = 'ffho-mesh-%GN',
 			id = 'ffho-mesh-%GN',
-			mcast_rate = 12000,
 		},
 		},
 	},
 	},
 
 
@@ -72,7 +53,6 @@
 		},
 		},
 		mesh = {
 		mesh = {
 			id = 'ffho-mesh-%GN',
 			id = 'ffho-mesh-%GN',
-			mcast_rate = 12000,
 		},
 		},
 	},
 	},
 
 
@@ -91,14 +71,8 @@
 	},
 	},
 
 
 	mesh_vpn = {
 	mesh_vpn = {
-		-- the maximum transfer unit
-		mtu = 1406,
-
 		-- fastd (vpn) settings
 		-- fastd (vpn) settings
 		fastd = {
 		fastd = {
-			-- cipher(s) to use
-			methods = {'salsa2012+umac'},
-
 			groups = {
 			groups = {
 				backbone = {
 				backbone = {
 					-- specifies how many servers are contacted
 					-- specifies how many servers are contacted
@@ -164,86 +138,6 @@
 			},
 			},
 		},
 		},
 
 
-		-- default traffic shaping (bandwidth limit) settings
-		bandwidth_limit = {
-			enabled = false,
-			egress = 500,
-			ingress = 4000,
-		},
 	},
 	},
 
 
-	-- configure the autoupdater
-	autoupdater = {
-		-- default branch for a firmware without enabled autoupdater
-		branch = 'stable',
-
-		-- available branches for the autoupdater
-		branches = {
-			stable = {
-				-- visible name of this branch (why not use the internal identifier here, too)
-				name = 'stable',
-
-				-- where to get the manifest file (without the trailing /manifest)
-				-- It's wise to use an internal address here,
-				-- but specifying a publicly available update site does not hurt.
-				mirrors = {'http://firmware.srv.in.ffho.net/stable/sysupgrade', 'http://[2a03:2260:2342:f251::6]/stable/sysupgrade', 'http://firmware.ffho.net/stable/sysupgrade'},
-
-				-- Number of valid manifest signatures necessary to accept the manifest as "good".
-				good_signatures = 3,
-
-				-- list of public keys which are considered "good" for manifest signatures
-				pubkeys = {
-					'ba2e6ff4de41ade9959702195d4c26c764e7aab85c627363681c29dbc4a8a2c5', -- oscar-
-					'fb9d6beba63dcb6175d0248c1e743b5fe4359474eb264d27f389d7a962e24477', -- northalpha
-					'f70f9ddeb307fff8fca31a76f4fbd0ac676dab8ad143625f0a4160d434d72876', -- Barbarossa
-					'39ef16b1853e54249dae2d06948329a93e3e13f354aaab792552aacd1d0b45ba', -- phimeas
-				},
-			},
-			testing = {
-				name = 'testing',
-				mirrors = {'http://firmware.srv.in.ffho.net/testing/sysupgrade', 'http://[2a03:2260:2342:f251::6]/testing/sysupgrade', 'http://firmware.ffho.net/testing/sysupgrade'},
-				good_signatures = 2,
-				pubkeys = {
-					'ba2e6ff4de41ade9959702195d4c26c764e7aab85c627363681c29dbc4a8a2c5', -- oscar-
-					'fb9d6beba63dcb6175d0248c1e743b5fe4359474eb264d27f389d7a962e24477', -- northalpha
-					'f70f9ddeb307fff8fca31a76f4fbd0ac676dab8ad143625f0a4160d434d72876', -- Barbarossa
-					'39ef16b1853e54249dae2d06948329a93e3e13f354aaab792552aacd1d0b45ba', -- phimeas
-				},
-			},
-			experimental = {
-				name = 'experimental',
-				mirrors = {'http://firmware.srv.in.ffho.net/experimental/sysupgrade', 'http://[2a03:2260:2342:f251::6]/experimental/sysupgrade', 'http://firmware.ffho.net/experimental/sysupgrade'},
-				good_signatures = 1,
-				pubkeys = {
-					'ba2e6ff4de41ade9959702195d4c26c764e7aab85c627363681c29dbc4a8a2c5', -- oscar-
-					'fb9d6beba63dcb6175d0248c1e743b5fe4359474eb264d27f389d7a962e24477', -- northalpha
-					'f70f9ddeb307fff8fca31a76f4fbd0ac676dab8ad143625f0a4160d434d72876', -- Barbarossa
-					'39ef16b1853e54249dae2d06948329a93e3e13f354aaab792552aacd1d0b45ba', -- phimeas
-				},
-			},
-		},
-	},
-
-	config_mode = {
-		-- Show/hide the altitude field
-		geo_location = {
-			show_altitude = false,
-			osm = {
-				center = {
-					lat = 51.695543946,
-					lon = 8.958663940,
-				},
-				zoom = 11,
-			},
-		},
-		-- define if the contact field is obligatory (optional)
-		owner = {
-			obligatory = false,
-		},
-	},
-
-	-- configure DNS forwarding
-	dns = {
-		servers = { '2a03:2260:2342:f251::53' },
-	},
 }
 }

+ 0 - 15
scripts/gensites.py

@@ -20,21 +20,6 @@ if not os.path.isdir(os.environ['GLUON_SITEDIR'] + "/domains"):
     except OSError:
     except OSError:
         print ("Creation of the directory %s failed" % os.environ['GLUON_SITEDIR'] + "/domains")
         print ("Creation of the directory %s failed" % os.environ['GLUON_SITEDIR'] + "/domains")
 
 
-# generate default site.conf
-with open(os.environ['GLUON_SITEDIR'] + "/site.conf", "w") as f:
-    for line in TEMPLATE:
-        # Substitute values
-        line = line.replace('%SN', 'Bitte wählen')
-        line = line.replace('%SC', 'ffho')
-        line = line.replace('%DS', '6fdb7c99404fe91fca18e84bf48864681018741dc33fb6bde67d6041fc99210c')
-        line = line.replace('%V4', '10.132.112.0/21')
-        line = line.replace('%V6', 'a00')
-        line = line.replace('%N4', '10.132.112.1')
-        line = line.replace('%ID', '10')
-        line = line.replace('%GN', 'uml')
-        line = line.replace('%HIDE', 'false')
-        f.write(line)
-
 # generate domain specific site confs
 # generate domain specific site confs
 for s in sites:
 for s in sites:
     with open(DOMAINS + s['site_code'] + ".conf", "w") as f:
     with open(DOMAINS + s['site_code'] + ".conf", "w") as f:

+ 133 - 0
site.conf

@@ -0,0 +1,133 @@
+{
+	-- A new node's name will be autogenerated from
+	-- it's primary MAC address and this prefix.
+	-- e.g. freifunk-0123456789ab
+	hostname_prefix = 'freifunk',
+
+	-- name of this site
+	-- site_name = 'Freifunk Hochstift - ${site}',
+	site_name = 'Bitte wählen',
+
+	-- short name of this site
+	-- site_code = 'ffho_${un-code}'
+	site_code = 'ffho',
+
+	default_domain = 'ffho',
+
+	-- timezone
+	timezone = 'CET-1CEST,M3.5.0,M10.5.0/3', -- Europe/Berlin
+
+	-- network-internal ntp service
+	ntp_servers = {'ntp.srv.in.ffho.net'},
+
+	-- regulatory domain of your wifi
+	regdom = 'DE',
+
+	-- wifi settings (2.4 GHz and 5 GHz)
+	-- ap.ssid = 'hochstift.freifunk.net/${kürzel}',
+	-- mesh.id = 'ffho-mesh-${group-name}',
+	wifi24 = {
+		mesh = {
+			mcast_rate = 12000,
+		},
+	},
+
+	wifi5 = {
+		mesh = {
+			mcast_rate = 12000,
+		},
+	},
+
+	mesh_vpn = {
+		-- the maximum transfer unit
+		mtu = 1406,
+
+		-- fastd (vpn) settings
+		fastd = {
+			-- cipher(s) to use
+			methods = {'salsa2012+umac'},
+		},
+
+		-- default traffic shaping (bandwidth limit) settings
+		bandwidth_limit = {
+			enabled = false,
+			egress = 500,
+			ingress = 4000,
+		},
+	},
+
+	-- configure the autoupdater
+	autoupdater = {
+		-- default branch for a firmware without enabled autoupdater
+		branch = 'stable',
+
+		-- available branches for the autoupdater
+		branches = {
+			stable = {
+				-- visible name of this branch (why not use the internal identifier here, too)
+				name = 'stable',
+
+				-- where to get the manifest file (without the trailing /manifest)
+				-- It's wise to use an internal address here,
+				-- but specifying a publicly available update site does not hurt.
+				mirrors = {'http://firmware.srv.in.ffho.net/stable/sysupgrade', 'http://[2a03:2260:2342:f251::6]/stable/sysupgrade', 'http://firmware.ffho.net/stable/sysupgrade'},
+
+				-- Number of valid manifest signatures necessary to accept the manifest as "good".
+				good_signatures = 3,
+
+				-- list of public keys which are considered "good" for manifest signatures
+				pubkeys = {
+					'ba2e6ff4de41ade9959702195d4c26c764e7aab85c627363681c29dbc4a8a2c5', -- oscar-
+					'fb9d6beba63dcb6175d0248c1e743b5fe4359474eb264d27f389d7a962e24477', -- northalpha
+					'f70f9ddeb307fff8fca31a76f4fbd0ac676dab8ad143625f0a4160d434d72876', -- Barbarossa
+					'39ef16b1853e54249dae2d06948329a93e3e13f354aaab792552aacd1d0b45ba', -- phimeas
+				},
+			},
+			testing = {
+				name = 'testing',
+				mirrors = {'http://firmware.srv.in.ffho.net/testing/sysupgrade', 'http://[2a03:2260:2342:f251::6]/testing/sysupgrade', 'http://firmware.ffho.net/testing/sysupgrade'},
+				good_signatures = 2,
+				pubkeys = {
+					'ba2e6ff4de41ade9959702195d4c26c764e7aab85c627363681c29dbc4a8a2c5', -- oscar-
+					'fb9d6beba63dcb6175d0248c1e743b5fe4359474eb264d27f389d7a962e24477', -- northalpha
+					'f70f9ddeb307fff8fca31a76f4fbd0ac676dab8ad143625f0a4160d434d72876', -- Barbarossa
+					'39ef16b1853e54249dae2d06948329a93e3e13f354aaab792552aacd1d0b45ba', -- phimeas
+				},
+			},
+			experimental = {
+				name = 'experimental',
+				mirrors = {'http://firmware.srv.in.ffho.net/experimental/sysupgrade', 'http://[2a03:2260:2342:f251::6]/experimental/sysupgrade', 'http://firmware.ffho.net/experimental/sysupgrade'},
+				good_signatures = 1,
+				pubkeys = {
+					'ba2e6ff4de41ade9959702195d4c26c764e7aab85c627363681c29dbc4a8a2c5', -- oscar-
+					'fb9d6beba63dcb6175d0248c1e743b5fe4359474eb264d27f389d7a962e24477', -- northalpha
+					'f70f9ddeb307fff8fca31a76f4fbd0ac676dab8ad143625f0a4160d434d72876', -- Barbarossa
+					'39ef16b1853e54249dae2d06948329a93e3e13f354aaab792552aacd1d0b45ba', -- phimeas
+				},
+			},
+		},
+	},
+
+	config_mode = {
+		-- Show/hide the altitude field
+		geo_location = {
+			show_altitude = false,
+			osm = {
+				center = {
+					lat = 51.695543946,
+					lon = 8.958663940,
+				},
+				zoom = 11,
+			},
+		},
+		-- define if the contact field is obligatory (optional)
+		owner = {
+			obligatory = false,
+		},
+	},
+
+	-- configure DNS forwarding
+	dns = {
+		servers = { '2a03:2260:2342:f251::53' },
+	},
+}

+ 2 - 3
site.mk

@@ -34,9 +34,7 @@ USB_NIC := \
 	kmod-usb-net-rtl8152 \
 	kmod-usb-net-rtl8152 \
 	kmod-usb-net-dm9601-ether
 	kmod-usb-net-dm9601-ether
 
 
-WLAN := \
-	kmod-ath9k \
-	kmod-ath10k-ct \
+WLAN := kmod-ath9k
 
 
 ifeq ($(GLUON_TARGET),x86-generic)
 ifeq ($(GLUON_TARGET),x86-generic)
 	GLUON_SITE_PACKAGES += \
 	GLUON_SITE_PACKAGES += \
@@ -63,3 +61,4 @@ GLUON_REGION ?= eu
 GLUON_LANGS ?= en de
 GLUON_LANGS ?= en de
 GLUON_ATH10K_MESH ?= 11s
 GLUON_ATH10K_MESH ?= 11s
 GLUON_DEPRECATED ?= full
 GLUON_DEPRECATED ?= full
+GLUON_MULTIDOMAIN=1