Overall Freifunk improvements

This commit is contained in:
Steven Barth 2008-09-14 21:59:14 +00:00
parent d0442f8aab
commit 5872bfa084
7 changed files with 92 additions and 52 deletions

View file

@ -1,12 +1,7 @@
#!/bin/sh #!/bin/sh
uci batch <<-EOF uci batch <<-EOF
set freifunk.community.name='Freifunk Halle'
set freifunk.community.homepage=http://halle.freifunk.net
set freifunk.community.realm=pool.freifunk-halle.net
set freifunk.wifi_iface.ssid=halle.freifunk.net
set luci.main.mediaurlbase=/luci-static/fledermaus set luci.main.mediaurlbase=/luci-static/fledermaus
set luci.main.lang=de set luci.main.lang=de
commit freifunk
commit luci commit luci
EOF EOF

View file

@ -1,12 +1,7 @@
#!/bin/sh #!/bin/sh
uci batch <<-EOF uci batch <<-EOF
set freifunk.community.name='Freifunk Leipzig'
set freifunk.community.homepage=http://leipzig.freifunk.net
set freifunk.community.realm=db.leipzig.freifunk.net
set freifunk.wifi_iface.ssid=leipzig.freifunk.net
set luci.main.mediaurlbase=/luci-static/fledermaus set luci.main.mediaurlbase=/luci-static/fledermaus
set luci.main.lang=de set luci.main.lang=de
commit freifunk
commit luci commit luci
EOF EOF

View file

@ -36,11 +36,9 @@ main = f:field(Flag, "wifi", "Freifunkzugang einrichten")
net = f:field(Value, "net", "Freifunknetz") net = f:field(Value, "net", "Freifunknetz")
net.rmempty = true net.rmempty = true
net:depends("wifi", "1") net:depends("wifi", "1")
net:value("104.0", "Berlin (104.0)") uci:foreach("freifunk", "community", function(s)
net:value("104.59", "Leisnig/Gadow/div. (104.59)") net:value(s[".name"], s.name)
net:value("104.61", "Leipzig (104.61)") end)
net:value("104.62", "Halle (104.62)")
net:value("191.161", "Augsburg (191.161)")
function net.cfgvalue(self, section) function net.cfgvalue(self, section)
return uci:get("freifunk", "wizard", "net") return uci:get("freifunk", "wizard", "net")
@ -51,12 +49,9 @@ function net.write(self, section, value)
end end
subnet = f:field(ListValue, "subnet", "Subnetz (Projekt)") subnet = f:field(Value, "subnet", "Subnetz (Projekt)")
subnet.rmempty = true subnet.rmempty = true
subnet:depends("wifi", "1") subnet:depends("wifi", "1")
for i=0, 255 do
subnet:value(i)
end
function subnet.cfgvalue(self, section) function subnet.cfgvalue(self, section)
return uci:get("freifunk", "wizard", "subnet") return uci:get("freifunk", "wizard", "subnet")
end end
@ -120,6 +115,7 @@ function main.write(self, section, value)
end end
local device = dev:formvalue(section) local device = dev:formvalue(section)
local community
-- Collect IP-Address -- Collect IP-Address
local inet = net:formvalue(section) local inet = net:formvalue(section)
@ -129,6 +125,9 @@ function main.write(self, section, value)
-- Invalidate fields -- Invalidate fields
if not inet then if not inet then
net.tag_missing[section] = true net.tag_missing[section] = true
else
community = inet
inet = uci:get("freifunk", community, "prefix") or inet
end end
if not isubnet then if not isubnet then
subnet.tag_missing[section] = true subnet.tag_missing[section] = true
@ -145,13 +144,14 @@ function main.write(self, section, value)
-- Cleanup -- Cleanup
luci.util.perror("1")
tools.wifi_delete_ifaces(device) tools.wifi_delete_ifaces(device)
luci.util.perror("2")
tools.network_remove_interface(device) tools.network_remove_interface(device)
luci.util.perror("3")
tools.firewall_zone_remove_interface("freifunk", device) tools.firewall_zone_remove_interface("freifunk", device)
-- Tune community settings
if community then
uci:tset("freifunk", "community", uci:get_all("freifunk", community))
end
-- Tune wifi device -- Tune wifi device
local devconfig = _strip_internals(uci:get_all("freifunk", "wifi_device")) local devconfig = _strip_internals(uci:get_all("freifunk", "wifi_device"))
@ -161,6 +161,7 @@ function main.write(self, section, value)
local ifconfig = _strip_internals(uci:get_all("freifunk", "wifi_iface")) local ifconfig = _strip_internals(uci:get_all("freifunk", "wifi_iface"))
ifconfig.device = device ifconfig.device = device
ifconfig.network = device ifconfig.network = device
ifconfig.ssid = uci:get("freifunk", community, "ssid")
uci:section("wireless", "wifi-iface", nil, ifconfig) uci:section("wireless", "wifi-iface", nil, ifconfig)
-- Save wifi -- Save wifi
@ -241,6 +242,8 @@ function client.write(self, section, value)
if not inet or not isubnet or not inode then if not inet or not isubnet or not inode then
return return
end end
inet = uci:get("freifunk", inet, "prefix") or inet
local dhcpbeg = 48 + tonumber(inode) * 4 local dhcpbeg = 48 + tonumber(inode) * 4
local dclient = "%s.%s.%s" % {inet:gsub("^[0-9]+", "10"), isubnet, dhcpbeg} local dclient = "%s.%s.%s" % {inet:gsub("^[0-9]+", "10"), isubnet, dhcpbeg}
@ -266,6 +269,21 @@ function client.write(self, section, value)
uci:section("dhcp", "dhcp", device .. "dhcp", dhcpbase) uci:section("dhcp", "dhcp", device .. "dhcp", dhcpbase)
uci:save("dhcp") uci:save("dhcp")
uci:delete_all("firewall", "rule", {
src="freifunk",
proto="udp",
src_port="68",
dest_port="67"
})
uci:section("firewall", "rule", nil, {
src="freifunk",
proto="udp",
src_port="68",
dest_port="67",
target="ACCEPT"
})
-- Delete old splash -- Delete old splash

View file

@ -16,6 +16,7 @@ config 'LoadPlugin'
config 'LoadPlugin' config 'LoadPlugin'
option 'library' 'olsrd_nameservice.so.0.3' option 'library' 'olsrd_nameservice.so.0.3'
option 'name' 'luci-node.olsr' option 'name' 'luci-node.olsr'
option 'latlon_file' '/dev/null'
config 'LoadPlugin' config 'LoadPlugin'
option 'library' 'olsrd_txtinfo.so.0.1' option 'library' 'olsrd_txtinfo.so.0.1'

View file

@ -20,7 +20,12 @@ c:option(Value, "name", translate("name"))
c:option(Value, "mail", translate("mail"), translate("mail1")) c:option(Value, "mail", translate("mail"), translate("mail1"))
c:option(Value, "phone", translate("phone")) c:option(Value, "phone", translate("phone"))
c:option(Value, "location", translate("location")) c:option(Value, "location", translate("location"))
c:option(Value, "geo", translate("coord"), translate("coord1"))
c:option(Value, "note", translate("note")) c:option(Value, "note", translate("note"))
return m m2 = Map("system", translate("geo"))
s = m2:section(TypedSection, "system", "")
s:option(Value, "latitude", translate("latitude", "Breite")).rmempty = true
s:option(Value, "longitude", translate("longitude", "Länge")).rmempty = true
return m, m2

View file

@ -18,6 +18,7 @@ für die lokale Freifunkgemeinschaft. Diese Werte wirken sich NICHT auf die Konf
des Routers aus, sondern definieren nur die Vorgaben für den Freifunkassistenten.]]) des Routers aus, sondern definieren nur die Vorgaben für den Freifunkassistenten.]])
c:option(Value, "name", "Gemeinschaft") c:option(Value, "name", "Gemeinschaft")
c:option(Value, "homepage", "Webseite") c:option(Value, "homepage", "Webseite")
c:option(Value, "realm", "Realm") c:option(Value, "ssid", "ESSID")
c:option(Value, "prefix", "Netzprefix")
return m return m

View file

@ -1,32 +1,28 @@
config settings wizard
config public contact config public contact
option nickname option nickname ''
option name option name ''
option mail option mail ''
option phone option phone ''
option location option location ''
option geo option note ''
option note
config public community config public community
option name "Freifunk Halle" option name 'Freifunk'
option homepage http://halle.freifunk.net option homepage 'http://freifunk.net'
option realm netz.freifunk-halle.net
config settings wizard
config fw_rule http config fw_rule http
option src freifunk option src freifunk
option target ACCEPT option target ACCEPT
option proto tcp option proto tcp
option dest_port 80 option dest_port 80
config fw_rule https config fw_rule https
option src freifunk option src freifunk
option target ACCEPT option target ACCEPT
option proto tcp option proto tcp
option dest_port 443 option dest_port 443
config fw_rule ssh config fw_rule ssh
option src freifunk option src freifunk
option target ACCEPT option target ACCEPT
@ -38,12 +34,11 @@ config fw_rule olsr
option target ACCEPT option target ACCEPT
option proto udp option proto udp
option dest_port 698 option dest_port 698
config fw_forwarding lan config fw_forwarding lan
option src lan option src lan
option dest freifunk option dest freifunk
config defaults wifi_device config defaults wifi_device
option channel 1 option channel 1
@ -53,17 +48,16 @@ config defaults wifi_device
option rxant 1 option rxant 1
option diversity 0 option diversity 0
option disabled 0 option disabled 0
config defaults wifi_iface config defaults wifi_iface
option mode adhoc option mode adhoc
option ssid halle.freifunk.net
option bssid 02:CA:FF:EE:BA:BE option bssid 02:CA:FF:EE:BA:BE
option txpower 10 option txpower 10
option rts 2347 option rts 2347
option frag 512 option frag 512
config defaults interface config defaults interface
option netmask 255.0.0.0 option netmask 255.0.0.0
option dns "88.198.178.18 141.54.1.1 212.204.49.83 208.67.220.220 208.67.222.222" option dns "88.198.178.18 141.54.1.1 212.204.49.83 208.67.220.220 208.67.222.222"
@ -71,12 +65,12 @@ config defaults interface
config defaults alias config defaults alias
option netmask 255.255.255.0 option netmask 255.255.255.0
config defaults dhcp config defaults dhcp
option leasetime 30m option leasetime 30m
config defaults olsr_interface config defaults olsr_interface
option HelloInterval 6.0 option HelloInterval 6.0
option HelloValidityTime 108.0 option HelloValidityTime 108.0
@ -85,4 +79,35 @@ config defaults olsr_interface
option MidInterval 18.0 option MidInterval 18.0
option MidValidityTime 324.0 option MidValidityTime 324.0
option HnaInterval 18.0 option HnaInterval 18.0
option HnaValidityTime 108.0 option HnaValidityTime 108.0
config community leipzig
option name "Freifunk Leipzig (104.61)"
option homepage http://leipzig.freifunk.net
option ssid "leipzig.freifunk.net"
option prefix "104.61"
config community halle
option name "Freifunk Halle (104.62)"
option homepage http://halle.freifunk.net
option ssid "halle.freifunk.net"
option prefix "104.62"
config community l59
option name "Leisnig, Gadow, ... (104.59)"
option homepage http://freifunk.net
option ssid "start.freifunk.net"
option prefix "104.59"
config community berlin
option name "Freifunk Berlin (104)"
option homepage http://berlin.freifunk.net
option ssid "olsr.freifunk.net"
option prefix "104"
config community augsburg
option name "Freifunk Augsburg (191.161)"
option homepage http://augsburg.freifunk.net
option ssid "augsburg.freifunk.net"
option prefix "191.161"