From: Steven Barth Date: Sun, 14 Sep 2008 21:59:14 +0000 (+0000) Subject: Overall Freifunk improvements X-Git-Tag: 0.9.0~1305 X-Git-Url: https://git.archive.openwrt.org/?p=project%2Fluci.git;a=commitdiff_plain;h=5872bfa084797e903b5ba1a722c22938a6a9cc95;hp=d0442f8aab131cb53deaed1da81e09001cc33a82 Overall Freifunk improvements --- diff --git a/applications/community-halle/root/etc/uci-defaults/luci-community-halle b/applications/community-halle/root/etc/uci-defaults/luci-community-halle index 9242f3f9d..d6d40f028 100644 --- a/applications/community-halle/root/etc/uci-defaults/luci-community-halle +++ b/applications/community-halle/root/etc/uci-defaults/luci-community-halle @@ -1,12 +1,7 @@ #!/bin/sh 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.lang=de - commit freifunk commit luci EOF diff --git a/applications/community-leipzig/root/etc/uci-defaults/luci-community-leipzig b/applications/community-leipzig/root/etc/uci-defaults/luci-community-leipzig index 29d549b0a..ca07f18d3 100644 --- a/applications/community-leipzig/root/etc/uci-defaults/luci-community-leipzig +++ b/applications/community-leipzig/root/etc/uci-defaults/luci-community-leipzig @@ -1,12 +1,7 @@ #!/bin/sh 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.lang=de - commit freifunk commit luci EOF \ No newline at end of file diff --git a/applications/luci-ffwizard-leipzig/luasrc/model/cbi/ffwizard.lua b/applications/luci-ffwizard-leipzig/luasrc/model/cbi/ffwizard.lua index 74a66e825..afde3fdf9 100644 --- a/applications/luci-ffwizard-leipzig/luasrc/model/cbi/ffwizard.lua +++ b/applications/luci-ffwizard-leipzig/luasrc/model/cbi/ffwizard.lua @@ -36,11 +36,9 @@ main = f:field(Flag, "wifi", "Freifunkzugang einrichten") net = f:field(Value, "net", "Freifunknetz") net.rmempty = true net:depends("wifi", "1") -net:value("104.0", "Berlin (104.0)") -net:value("104.59", "Leisnig/Gadow/div. (104.59)") -net:value("104.61", "Leipzig (104.61)") -net:value("104.62", "Halle (104.62)") -net:value("191.161", "Augsburg (191.161)") +uci:foreach("freifunk", "community", function(s) + net:value(s[".name"], s.name) +end) function net.cfgvalue(self, section) return uci:get("freifunk", "wizard", "net") @@ -51,12 +49,9 @@ function net.write(self, section, value) end -subnet = f:field(ListValue, "subnet", "Subnetz (Projekt)") +subnet = f:field(Value, "subnet", "Subnetz (Projekt)") subnet.rmempty = true subnet:depends("wifi", "1") -for i=0, 255 do - subnet:value(i) -end function subnet.cfgvalue(self, section) return uci:get("freifunk", "wizard", "subnet") end @@ -120,6 +115,7 @@ function main.write(self, section, value) end local device = dev:formvalue(section) + local community -- Collect IP-Address local inet = net:formvalue(section) @@ -129,6 +125,9 @@ function main.write(self, section, value) -- Invalidate fields if not inet then net.tag_missing[section] = true + else + community = inet + inet = uci:get("freifunk", community, "prefix") or inet end if not isubnet then subnet.tag_missing[section] = true @@ -145,13 +144,14 @@ function main.write(self, section, value) -- Cleanup - luci.util.perror("1") tools.wifi_delete_ifaces(device) - luci.util.perror("2") tools.network_remove_interface(device) - luci.util.perror("3") 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 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")) ifconfig.device = device ifconfig.network = device + ifconfig.ssid = uci:get("freifunk", community, "ssid") uci:section("wireless", "wifi-iface", nil, ifconfig) -- Save wifi @@ -241,6 +242,8 @@ function client.write(self, section, value) if not inet or not isubnet or not inode then return end + + inet = uci:get("freifunk", inet, "prefix") or inet local dhcpbeg = 48 + tonumber(inode) * 4 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: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 diff --git a/contrib/package/olsrd-luci/files/etc/config/olsrd b/contrib/package/olsrd-luci/files/etc/config/olsrd index 2e0e4e6a1..3cbfa627b 100644 --- a/contrib/package/olsrd-luci/files/etc/config/olsrd +++ b/contrib/package/olsrd-luci/files/etc/config/olsrd @@ -16,6 +16,7 @@ config 'LoadPlugin' config 'LoadPlugin' option 'library' 'olsrd_nameservice.so.0.3' option 'name' 'luci-node.olsr' + option 'latlon_file' '/dev/null' config 'LoadPlugin' option 'library' 'olsrd_txtinfo.so.0.1' diff --git a/modules/freifunk/luasrc/model/cbi/freifunk/contact.lua b/modules/freifunk/luasrc/model/cbi/freifunk/contact.lua index 203b1ce6d..fd3bcf7ef 100644 --- a/modules/freifunk/luasrc/model/cbi/freifunk/contact.lua +++ b/modules/freifunk/luasrc/model/cbi/freifunk/contact.lua @@ -20,7 +20,12 @@ c:option(Value, "name", translate("name")) c:option(Value, "mail", translate("mail"), translate("mail1")) c:option(Value, "phone", translate("phone")) c:option(Value, "location", translate("location")) -c:option(Value, "geo", translate("coord"), translate("coord1")) c:option(Value, "note", translate("note")) -return m \ No newline at end of file +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 \ No newline at end of file diff --git a/modules/freifunk/luasrc/model/cbi/freifunk/freifunk.lua b/modules/freifunk/luasrc/model/cbi/freifunk/freifunk.lua index f1bf64163..1a147460b 100644 --- a/modules/freifunk/luasrc/model/cbi/freifunk/freifunk.lua +++ b/modules/freifunk/luasrc/model/cbi/freifunk/freifunk.lua @@ -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.]]) c:option(Value, "name", "Gemeinschaft") c:option(Value, "homepage", "Webseite") -c:option(Value, "realm", "Realm") +c:option(Value, "ssid", "ESSID") +c:option(Value, "prefix", "Netzprefix") return m \ No newline at end of file diff --git a/modules/freifunk/root/etc/config/freifunk b/modules/freifunk/root/etc/config/freifunk index 832f69da3..7678fc775 100644 --- a/modules/freifunk/root/etc/config/freifunk +++ b/modules/freifunk/root/etc/config/freifunk @@ -1,32 +1,28 @@ +config settings wizard config public contact - option nickname - option name - option mail - option phone - option location - option geo - option note + option nickname '' + option name '' + option mail '' + option phone '' + option location '' + option note '' config public community - option name "Freifunk Halle" - option homepage http://halle.freifunk.net - option realm netz.freifunk-halle.net - -config settings wizard - + option name 'Freifunk' + option homepage 'http://freifunk.net' config fw_rule http option src freifunk option target ACCEPT option proto tcp option dest_port 80 - + config fw_rule https option src freifunk option target ACCEPT option proto tcp option dest_port 443 - + config fw_rule ssh option src freifunk option target ACCEPT @@ -38,12 +34,11 @@ config fw_rule olsr option target ACCEPT option proto udp option dest_port 698 - + config fw_forwarding lan option src lan option dest freifunk - config defaults wifi_device option channel 1 @@ -53,17 +48,16 @@ config defaults wifi_device option rxant 1 option diversity 0 option disabled 0 - + config defaults wifi_iface option mode adhoc - option ssid halle.freifunk.net option bssid 02:CA:FF:EE:BA:BE option txpower 10 option rts 2347 option frag 512 - - + + config defaults interface 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" @@ -71,12 +65,12 @@ config defaults interface config defaults alias option netmask 255.255.255.0 - - + + config defaults dhcp option leasetime 30m - - + + config defaults olsr_interface option HelloInterval 6.0 option HelloValidityTime 108.0 @@ -85,4 +79,35 @@ config defaults olsr_interface option MidInterval 18.0 option MidValidityTime 324.0 option HnaInterval 18.0 - option HnaValidityTime 108.0 \ No newline at end of file + 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" \ No newline at end of file