From 43ec5c7a6d630be3514483a5db46b726fa9b92ad Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Tue, 13 May 2014 16:43:42 +0200 Subject: [PATCH] Convert site config to Lua, move variable parts (release number) to site.mk --- site.conf | 194 +++++++++++++++++++++++++++--------------------------- site.mk | 6 ++ 2 files changed, 102 insertions(+), 98 deletions(-) diff --git a/site.conf b/site.conf index c49a219..6e7ae98 100644 --- a/site.conf +++ b/site.conf @@ -1,128 +1,126 @@ { - hostname_prefix => 'freifunk', - site_name => 'Freifunk Lübeck', - site_code => 'ffhl', - release => '0.4+0-exp' . nightly, + hostname_prefix = 'freifunk', + site_name = 'Freifunk Lübeck', + site_code = 'ffhl', - prefix4 => '10.130.0.0/20', - prefix6 => 'fdef:ffc0:3dd7::/64', + prefix4 = '10.130.0.0/20', + prefix6 = 'fdef:ffc0:3dd7::/64', - timezone => 'CET-1CEST,M3.5.0,M10.5.0/3', # Europe/Berlin - ntp_servers => ['1.ntp.services.ffhl'], - regdom => 'DE', + timezone = 'CET-1CEST,M3.5.0,M10.5.0/3', -- Europe/Berlin + ntp_servers = {'1.ntp.services.ffhl'}, + regdom = 'DE', - wifi24 => { - ssid => 'luebeck.freifunk.net', - channel => 1, - htmode => 'HT40+', - mesh_ssid => '02:d1:11:37:fc:38', - mesh_bssid => '02:d1:11:37:fc:38', - mesh_mcast_rate => 12000, + wifi24 = { + ssid = 'luebeck.freifunk.net', + channel = 1, + htmode = 'HT40+', + mesh_ssid = '02:d1:11:37:fc:38', + mesh_bssid = '02:d1:11:37:fc:38', + mesh_mcast_rate = 12000, }, - wifi5 => { - ssid => 'luebeck.freifunk.net (5GHz)', - channel => 44, - htmode => 'HT40+', - mesh_ssid => '02:d1:11:37:fc:38', - mesh_bssid => '02:d1:11:37:fc:38', - mesh_mcast_rate => 12000, + wifi5 = { + ssid = 'luebeck.freifunk.net (5GHz)', + channel = 44, + htmode = 'HT40+', + mesh_ssid = '02:d1:11:37:fc:38', + mesh_bssid = '02:d1:11:37:fc:38', + mesh_mcast_rate = 12000, }, - next_node => { - ip4 => '10.130.0.1', - ip6 => 'fdef:ffc0:3dd7::1', + next_node = { + ip4 = '10.130.0.1', + ip6 = 'fdef:ffc0:3dd7::1', - mac => '16:41:95:40:f7:dc', + mac = '16:41:95:40:f7:dc', }, - fastd_mesh_vpn => { - methods => ['salsa2012+gmac'], - mtu => 1426, - backbone => { - limit => 2, - peers => { - burgtor => { - key => '657af03e36ff1b8bbe5a5134982a4f110c8523a9a63293870caf548916a95a03', - remotes => ['ipv4 "burgtor.mesh.ffhl.chaotikum.org" port 10000'], + fastd_mesh_vpn = { + methods = {'salsa2012+gmac'}, + mtu = 1426, + backbone = { + limit = 2, + peers = { + burgtor = { + key = '657af03e36ff1b8bbe5a5134982a4f110c8523a9a63293870caf548916a95a03', + remotes = {'ipv4 "burgtor.mesh.ffhl.chaotikum.org" port 10000'}, }, - holstentor => { - key => '8c660f7511bf101ea1b599fe53af20e1146cd923c9e9d2a3a0d534ee75af9067', - remotes => ['ipv4 "holstentor.mesh.ffhl.chaotikum.org" port 10000'], + holstentor = { + key = '8c660f7511bf101ea1b599fe53af20e1146cd923c9e9d2a3a0d534ee75af9067', + remotes = {'ipv4 "holstentor.mesh.ffhl.chaotikum.org" port 10000'}, }, - huextertor => { - key => 'a1b124f43eae4f5929850c09cda825ef35d659e3db4d7746e3d97627e9fa7238', - remotes => ['ipv4 "huextertor.mesh.ffhl.chaotikum.org" port 10000'], + huextertor = { + key = 'a1b124f43eae4f5929850c09cda825ef35d659e3db4d7746e3d97627e9fa7238', + remotes = {'ipv4 "huextertor.mesh.ffhl.chaotikum.org" port 10000'}, }, - muehlentor => { - key => 'bd4ec3cf87bb0042eed2fa121fbc402154d28fb1ae9dff9cdb71bb21892f401a', - remotes => ['ipv4 "muehlentor.mesh.ffhl.chaotikum.org" port 10000'], + muehlentor = { + key = 'bd4ec3cf87bb0042eed2fa121fbc402154d28fb1ae9dff9cdb71bb21892f401a', + remotes = {'ipv4 "muehlentor.mesh.ffhl.chaotikum.org" port 10000'}, }, }, }, }, - autoupdater => { - enabled => 1, - branch => 'experimental', - branches => { - stable => { - name => 'stable', - mirrors => ['http://1.updates.services.ffhl/stable/sysupgrade'], - probability => 0.08, - good_signatures => 2, - pubkeys => [ - 'daa19b44bbd7033965e02088127bad9516ba0fea8f34267a777144a23ec8900c', # Linus - 'a8dd60765b07330a4bbfdf8406102befca132881a4b65f3efda32cf2d5b362d9', # Nils - '323bd3285c4e5547a89cd6da1f2aef67f1654b0928bbd5b104efc9dab2156d0b', # NeoRaider - ], + autoupdater = { + branch = 'experimental', + branches = { + stable = { + name = 'stable', + mirrors = {'http://1.updates.services.ffhl/stable/sysupgrade'}, + probability = 0.08, + good_signatures = 2, + pubkeys = { + 'daa19b44bbd7033965e02088127bad9516ba0fea8f34267a777144a23ec8900c', -- Linus + 'a8dd60765b07330a4bbfdf8406102befca132881a4b65f3efda32cf2d5b362d9', -- Nils + '323bd3285c4e5547a89cd6da1f2aef67f1654b0928bbd5b104efc9dab2156d0b', -- NeoRaider + }, }, - beta => { - name => 'beta', - mirrors => ['http://1.updates.services.ffhl/beta/sysupgrade'], - probability => 0.08, - good_signatures => 2, - pubkeys => [ - 'daa19b44bbd7033965e02088127bad9516ba0fea8f34267a777144a23ec8900c', # Linus - 'a8dd60765b07330a4bbfdf8406102befca132881a4b65f3efda32cf2d5b362d9', # Nils - '323bd3285c4e5547a89cd6da1f2aef67f1654b0928bbd5b104efc9dab2156d0b', # NeoRaider - ], + beta = { + name = 'beta', + mirrors = {'http://1.updates.services.ffhl/beta/sysupgrade'}, + probability = 0.08, + good_signatures = 2, + pubkeys = { + 'daa19b44bbd7033965e02088127bad9516ba0fea8f34267a777144a23ec8900c', -- Linus + 'a8dd60765b07330a4bbfdf8406102befca132881a4b65f3efda32cf2d5b362d9', -- Nils + '323bd3285c4e5547a89cd6da1f2aef67f1654b0928bbd5b104efc9dab2156d0b', -- NeoRaider + }, }, - experimental => { - name => 'experimental', - mirrors => ['http://1.updates.services.ffhl/experimental/sysupgrade'], - probability => 1.00, - good_signatures => 1, - pubkeys => [ - '496136b37e5f561dfdf523611f14e4b6bc2a745cbc1ab7daffa59fded5f202d1', # philae - ], + experimental = { + name = 'experimental', + mirrors = {'http://1.updates.services.ffhl/experimental/sysupgrade'}, + probability = 1.00, + good_signatures = 1, + pubkeys = { + '496136b37e5f561dfdf523611f14e4b6bc2a745cbc1ab7daffa59fded5f202d1', -- philae + }, }, }, }, - simple_tc => { - mesh_vpn => { - ifname => 'mesh-vpn', - enabled => 0, - limit_egress => 200, - limit_ingress => 3000, + simple_tc = { + mesh_vpn = { + ifname = 'mesh-vpn', + enabled = 0, + limit_egress = 200, + limit_ingress = 3000, }, }, - config_mode => { - msg_welcome => <<'END', + config_mode = { + msg_welcome = [[ Willkommen zum Einrichtungsassistenten für deinen neuen Lübecker Freifunk-Knoten. Fülle das folgende Formular deinen Vorstellungen entsprechend aus und sende es ab. -END - msg_pubkey => <<'END', +]], + msg_pubkey = [[ Dies ist der öffentliche Schlüssel deines Freifunkknotens. Erst nachdem er auf den Servern des Lübecker Freifunk-Projektes eingetragen wurde, kann sich dein Knoten mit dem Lübecker Mesh-VPN zu verbinden. Bitte schicke dazu diesen Schlüssel und den Namen deines Knotens (<%=hostname%>) an keys@luebeck.freifunk.net. -END - msg_reboot => <<'END', +]], + msg_reboot = [[

Dein Knoten startet gerade neu und wird anschließend versuchen, sich anschließend mit anderen Freifunkknoten in seiner Nähe zu @@ -133,17 +131,17 @@ Lübecker Freifunk-Community findest du auf

Viel Spaß mit deinem Knoten und der Erkundung von Freifunk!

-END +]], }, - legacy => { - version_files => ['/etc/.freifunk_version_keep', '/etc/.lff_version_keep'], - old_files => ['/etc/config/config_mode', '/etc/config/ffhl', '/etc/config/freifunk'], + legacy = { + version_files = {'/etc/.freifunk_version_keep', '/etc/.lff_version_keep'}, + old_files = {'/etc/config/config_mode', '/etc/config/ffhl', '/etc/config/freifunk'}, - config_mode_configs => ['config_mode.@wizard[0]', 'ffhl.@wizard[0]', 'freifunk.@wizard[0]'], - fastd_configs => ['ffhl_mesh_vpn', 'mesh_vpn'], - mesh_ifname => 'freifunk', - tc_configs => ['ffhl.@bandwidth[0]', 'freifunk.@bandwidth[0]'], - wifi_names => ['wifi_freifunk', 'wifi_freifunk5', 'wifi_mesh', 'wifi_mesh5'], + config_mode_configs = {'config_mode', 'ffhl', 'freifunk'}, + fastd_configs = {'ffhl_mesh_vpn', 'mesh_vpn'}, + mesh_ifname = 'freifunk', + tc_configs = {'ffhl', 'freifunk'}, + wifi_names = {'wifi_freifunk', 'wifi_freifunk5', 'wifi_mesh', 'wifi_mesh5'}, }, } diff --git a/site.mk b/site.mk index 53b5124..d2e2c08 100644 --- a/site.mk +++ b/site.mk @@ -15,3 +15,9 @@ GLUON_SITE_PACKAGES := \ iwinfo \ iptables \ haveged + + +DEFAULT_GLUON_RELEASE := 0.4+0-exp$(shell date '+%Y%m%d') + +# Allow overriding the release number from the command line +GLUON_RELEASE ?= $(DEFAULT_GLUON_RELEASE)