From a66f8c395d129eefb40fece7fa7610f045d88060 Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Tue, 12 Jul 2011 20:46:24 +0000 Subject: [PATCH] luci-0.10: merge r7249 - r7265 --- .../root/etc/uci-defaults/meshwizard | 2 ++ .../luci-splash/htdocs/cgi-bin/splash/splash.sh | 32 +++++++++--------- .../luci-splash/root/etc/init.d/luci_splash | 4 +-- applications/luci-splash/root/usr/sbin/luci-splash | 2 +- .../usr/bin/meshwizard/helpers/setup_firewall.sh | 9 +++++ .../usr/bin/meshwizard/helpers/setup_splash.sh | 7 ++-- .../usr/bin/meshwizard/helpers/setup_system.sh | 12 +++++++ .../meshwizard/files/usr/bin/meshwizard/wizard.sh | 13 +++----- .../luasrc/model/cbi/admin_network/ifaces.lua | 39 ++++++++++------------ .../luasrc/model/cbi/admin_system/system.lua | 16 ++++----- .../admin-full/luasrc/view/admin_status/index.htm | 2 +- modules/freifunk/luasrc/view/freifunk/index.htm | 4 +-- modules/freifunk/root/etc/config/freifunk | 4 +++ modules/freifunk/root/etc/config/profile_gadow | 3 +- modules/freifunk/root/etc/config/profile_l59 | 3 ++ modules/freifunk/root/etc/config/profile_leipzig | 3 +- modules/freifunk/root/etc/init.d/freifunk | 2 +- po/it/base.po | 8 ++--- po/ru/ahcp.po | 10 +++--- .../htdocs/luci-static/freifunk-generic/mobile.css | 10 +++--- 20 files changed, 106 insertions(+), 79 deletions(-) create mode 100755 contrib/package/meshwizard/files/usr/bin/meshwizard/helpers/setup_system.sh diff --git a/applications/luci-meshwizard/root/etc/uci-defaults/meshwizard b/applications/luci-meshwizard/root/etc/uci-defaults/meshwizard index 2154e9771..eae65d5a1 100644 --- a/applications/luci-meshwizard/root/etc/uci-defaults/meshwizard +++ b/applications/luci-meshwizard/root/etc/uci-defaults/meshwizard @@ -4,3 +4,5 @@ set ucitrack.meshwizard="meshwizard" set ucitrack.meshwizard.exec="/etc/init.d/wizard boot" commit ucitrack EOF + +rm -f /tmp/luci-indexcache diff --git a/applications/luci-splash/htdocs/cgi-bin/splash/splash.sh b/applications/luci-splash/htdocs/cgi-bin/splash/splash.sh index 75e3c2edf..cbffaf6ab 100755 --- a/applications/luci-splash/htdocs/cgi-bin/splash/splash.sh +++ b/applications/luci-splash/htdocs/cgi-bin/splash/splash.sh @@ -2,24 +2,22 @@ echo -en "Cache-Control: no-cache, max-age=0, no-store, must-revalidate\r\n" echo -en "Pragma: no-cache\r\n" echo -en "Expires: -1\r\n" -echo -en "Status: 403 Forbidden\r\n" -echo -en "Content-Type: text/html\r\n\r\n" -#echo -en "Status: 307 Temporary Redirect\r\n" -#echo -en "Location: http://$SERVER_ADDR/cgi-bin/luci/splash\r\n\r\n" +echo -en "Status: 307 Temporary Redirect\r\n" +echo -en "Location: http://$SERVER_ADDR/cgi-bin/luci/splash\r\n" +echo -en "\r\n" cat < - - Splash - - - -

Splash on $(cat /proc/sys/kernel/hostname)

-

- Redirecting to authentication for $REMOTE_ADDR on $SERVER_ADDR.

- [Click here to continue...] -

- - + + + + 100 + 0 + 1.0 + 12 + $SERVER_ADDR + http://$SERVER_ADDR/cgi-bin/luci/splash?wispr=1 + http://$SERVER_ADDR/ + + EOT diff --git a/applications/luci-splash/root/etc/init.d/luci_splash b/applications/luci-splash/root/etc/init.d/luci_splash index 285471773..e4980d968 100755 --- a/applications/luci-splash/root/etc/init.d/luci_splash +++ b/applications/luci-splash/root/etc/init.d/luci_splash @@ -161,7 +161,7 @@ EOF } start() { - lock -w $LOCK && lock $LOCK + lock $LOCK include /lib/network scan_interfaces @@ -238,7 +238,7 @@ start() { } stop() { - lock -w $LOCK && lock $LOCK + lock $LOCK include /lib/network scan_interfaces diff --git a/applications/luci-splash/root/usr/sbin/luci-splash b/applications/luci-splash/root/usr/sbin/luci-splash index b8b701458..7738679f6 100755 --- a/applications/luci-splash/root/usr/sbin/luci-splash +++ b/applications/luci-splash/root/usr/sbin/luci-splash @@ -14,7 +14,7 @@ local limit_up = 0 local limit_down = 0 function lock() - os.execute("lock -w /var/run/luci_splash.lock && lock /var/run/luci_splash.lock") + os.execute("lock /var/run/luci_splash.lock") end function unlock() diff --git a/contrib/package/meshwizard/files/usr/bin/meshwizard/helpers/setup_firewall.sh b/contrib/package/meshwizard/files/usr/bin/meshwizard/helpers/setup_firewall.sh index 299b167fe..c9681425f 100755 --- a/contrib/package/meshwizard/files/usr/bin/meshwizard/helpers/setup_firewall.sh +++ b/contrib/package/meshwizard/files/usr/bin/meshwizard/helpers/setup_firewall.sh @@ -12,6 +12,15 @@ config_load firewall type="$(uci -q get wireless.$net.type)" vap="$(uci -q get meshwizard.netconfig.$net\_vap)" +# Add local_restrict to wan firewall zone +handle_zonewan() { + config_get name "$1" name + if [ "$name" == "wan" ]; then + uci set firewall.$1.local_restrict=1 + fi +} +config_foreach handle_zonewan zone && echo " + Enable local_restrict for zone wan" + # Delete old firewall zone for freifunk handle_fwzone() { config_get name "$1" name diff --git a/contrib/package/meshwizard/files/usr/bin/meshwizard/helpers/setup_splash.sh b/contrib/package/meshwizard/files/usr/bin/meshwizard/helpers/setup_splash.sh index 8e143d338..b28ccc93c 100755 --- a/contrib/package/meshwizard/files/usr/bin/meshwizard/helpers/setup_splash.sh +++ b/contrib/package/meshwizard/files/usr/bin/meshwizard/helpers/setup_splash.sh @@ -23,10 +23,13 @@ config_foreach handle_splash iface uci batch << EOF set luci_splash.${netrenamed}dhcp="iface" -set luci_splash.${netrenamed}dhcp.network="${net}dhcp" +set luci_splash.${netrenamed}dhcp.network="${netrenamed}dhcp" set luci_splash.${netrenamed}dhcp.zone="freifunk" EOF echo " network: ${netrenamed}dhcp" -uci commit \ No newline at end of file +uci commit + +/etc/init.d/luci_splash enable + diff --git a/contrib/package/meshwizard/files/usr/bin/meshwizard/helpers/setup_system.sh b/contrib/package/meshwizard/files/usr/bin/meshwizard/helpers/setup_system.sh new file mode 100755 index 000000000..d6b30e3dd --- /dev/null +++ b/contrib/package/meshwizard/files/usr/bin/meshwizard/helpers/setup_system.sh @@ -0,0 +1,12 @@ +#!/bin/sh +# Sets values from /etc/config/freifunk and/or the community profile in /etc/config/system + +if [ -n "$(env | grep '^system_')" ]; then + echo "++++ Setup system" + env | grep "^system_" | sed "s/system_/uci set system.system./g" | while read line; do + eval $line + echo " $line" + done +fi + +uci commit system diff --git a/contrib/package/meshwizard/files/usr/bin/meshwizard/wizard.sh b/contrib/package/meshwizard/files/usr/bin/meshwizard/wizard.sh index 547f44afd..d6d7fb7cc 100755 --- a/contrib/package/meshwizard/files/usr/bin/meshwizard/wizard.sh +++ b/contrib/package/meshwizard/files/usr/bin/meshwizard/wizard.sh @@ -32,7 +32,7 @@ export networks [ -z "$networks" ] && echo "Error: No networks to setup could be found in /etc/config/meshwizard, aborting now." && exit 1 -echo "+++ wizard 0.0.1 +++ +echo "+++ wizard 0.0.2 +++ Community=$community Network(s)=$networks" @@ -49,6 +49,9 @@ done < /tmp/meshwizard.tmp echo "++++ dnsmasq config" $dir/helpers/setup_dnsmasq.sh +# system + $dir/helpers/setup_system.sh + # Configure found networks for net in $networks; do @@ -87,12 +90,6 @@ for net in $networks; do echo " Configuration of $net finished." done -##### Restart services -#services="network olsrd dnsmasq luci_splash" -#echo " Restarting services:" -#for s in $services; do -# /etc/init.d/$s restart >/dev/null 2>&1 -# echo " * $s" -#done +##### Reboot the router (because simply restarting services gave errors) reboot diff --git a/modules/admin-full/luasrc/model/cbi/admin_network/ifaces.lua b/modules/admin-full/luasrc/model/cbi/admin_network/ifaces.lua index cc54d4516..84d7ba5c6 100644 --- a/modules/admin-full/luasrc/model/cbi/admin_network/ifaces.lua +++ b/modules/admin-full/luasrc/model/cbi/admin_network/ifaces.lua @@ -663,8 +663,7 @@ end if has_dnsmasq and net:proto() == "static" then m2 = Map("dhcp", "", "") - local section_id = "-" - + local section_id function m2.on_parse() m2.uci:foreach("dhcp", "dhcp", function(s) if s.interface == arg[1] then @@ -672,6 +671,15 @@ if has_dnsmasq and net:proto() == "static" then return false end end) + + if not section_id then + local c = 1 + section_id = arg[1] + while m2.uci:get("dhcp", section_id) do + section_id = arg[1] .. c + c = c + 1 + end + end end s = m2:section(TypedSection, "dhcp", translate("DHCP Server")) @@ -690,17 +698,16 @@ if has_dnsmasq and net:proto() == "static" then "this interface.")) ignore.rmempty = false - - function ignore.cfgvalue(self, section) - return (section == "-") and self.enabled or Flag.cfgvalue(self, section) - end + ignore.default = ignore.enabled function ignore.write(self, section, value) - section_id = m2.uci:section("dhcp", "dhcp", nil, { - ignore = value, - interface = arg[1] - }) - end + if m2.uci:get("dhcp", section) ~= "dhcp" then + m2.uci:section("dhcp", "dhcp", section, { + interface = arg[1] + }) + end + m2.uci:set("dhcp", section, "ignore", (value == "1") and "1" or "0") + end local start = s:taboption("general", Value, "start", translate("Start"), @@ -746,19 +753,9 @@ if has_dnsmasq and net:proto() == "static" then "192.168.2.2\" which advertises different DNS servers to clients.")) - local function write_opt(self, section, value) - return getmetatable(self).__index.write(self, section_id, value) - end - - local function remove_opt(self, section, value) - return getmetatable(self).__index.remove(self, section_id, value) - end - for i, n in ipairs(s.children) do if n ~= ignore then n:depends("ignore", "") - n.write = write_opt - n.remove = remove_opt end end end diff --git a/modules/admin-full/luasrc/model/cbi/admin_system/system.lua b/modules/admin-full/luasrc/model/cbi/admin_system/system.lua index 4fe10d0ed..f2e83401e 100644 --- a/modules/admin-full/luasrc/model/cbi/admin_system/system.lua +++ b/modules/admin-full/luasrc/model/cbi/admin_system/system.lua @@ -123,14 +123,14 @@ o.placeholder = 514 o.datatype = "port" o = s:taboption("logging", ListValue, "conloglevel", translate("Log output level")) -o:value(7, translate("Debug")) -o:value(6, translate("Info")) -o:value(5, translate("Notice")) -o:value(4, translate("Warning")) -o:value(3, translate("Error")) -o:value(2, translate("Critical")) -o:value(1, translate("Alert")) -o:value(0, translate("Emergency")) +o:value(8, translate("Debug")) +o:value(7, translate("Info")) +o:value(6, translate("Notice")) +o:value(5, translate("Warning")) +o:value(4, translate("Error")) +o:value(3, translate("Critical")) +o:value(2, translate("Alert")) +o:value(1, translate("Emergency")) o = s:taboption("logging", ListValue, "cronloglevel", translate("Cron Log Level")) o.default = 8 diff --git a/modules/admin-full/luasrc/view/admin_status/index.htm b/modules/admin-full/luasrc/view/admin_status/index.htm index f6432ef6f..16cd32a2c 100644 --- a/modules/admin-full/luasrc/view/admin_status/index.htm +++ b/modules/admin-full/luasrc/view/admin_status/index.htm @@ -409,7 +409,7 @@ $Id$ tr.insertCell(-1).innerHTML = String.format('%d dBm', assoclist[i].noise); } - if (ac.rows.length == 0) + if (ac.rows.length == 1) { var tr = ac.rows[0].parentNode.insertRow(-1); tr.className = 'cbi-section-table-row'; diff --git a/modules/freifunk/luasrc/view/freifunk/index.htm b/modules/freifunk/luasrc/view/freifunk/index.htm index 4a9ab2efe..a8cf62e4b 100644 --- a/modules/freifunk/luasrc/view/freifunk/index.htm +++ b/modules/freifunk/luasrc/view/freifunk/index.htm @@ -40,8 +40,8 @@ if (ff.community.DefaultText or "") ~= "disabled" then ' '.. luci.sys.hostname().. '. '.. - translate("It is operated by ").. - ''.. (ff.contact.nickname or translate("Please set your contact information")).. diff --git a/modules/freifunk/root/etc/config/freifunk b/modules/freifunk/root/etc/config/freifunk index 99a53269c..051dc4acf 100644 --- a/modules/freifunk/root/etc/config/freifunk +++ b/modules/freifunk/root/etc/config/freifunk @@ -85,6 +85,10 @@ config 'fw_forwarding' 'fffwd' option 'src' 'freifunk' option 'dest' 'freifunk' +config 'defaults' 'system' + option 'zonename' 'Europe/Berlin' + option 'timezone' 'CET-1CEST,M3.5.0,M10.5.0/3' + config 'defaults' 'wifi_device' option 'channel' '1' option 'diversity' '1' diff --git a/modules/freifunk/root/etc/config/profile_gadow b/modules/freifunk/root/etc/config/profile_gadow index 5b963bcbf..ca4143b91 100644 --- a/modules/freifunk/root/etc/config/profile_gadow +++ b/modules/freifunk/root/etc/config/profile_gadow @@ -11,4 +11,5 @@ config 'community' 'profile' config 'defaults' 'interface' option 'netmask' '255.0.0.0' - +config 'defaults' 'bssidscheme' + option '1' '02:CA:FF:EE:BA:BE' diff --git a/modules/freifunk/root/etc/config/profile_l59 b/modules/freifunk/root/etc/config/profile_l59 index 67c48cc81..6185f0257 100644 --- a/modules/freifunk/root/etc/config/profile_l59 +++ b/modules/freifunk/root/etc/config/profile_l59 @@ -7,3 +7,6 @@ config 'community' 'profile' option 'splash_prefix' '27' option 'latitude' '52.26337' option 'longitude' '10.52103' + +config 'defaults' 'bssidscheme' + option '1' '02:CA:FF:EE:BA:BE' diff --git a/modules/freifunk/root/etc/config/profile_leipzig b/modules/freifunk/root/etc/config/profile_leipzig index 1418f7aae..24e20ce48 100644 --- a/modules/freifunk/root/etc/config/profile_leipzig +++ b/modules/freifunk/root/etc/config/profile_leipzig @@ -9,4 +9,5 @@ config 'community' 'profile' option 'longitude' '12.40297' - +config 'defaults' 'bssidscheme' + option '1' '02:CA:FF:EE:BA:BE' diff --git a/modules/freifunk/root/etc/init.d/freifunk b/modules/freifunk/root/etc/init.d/freifunk index 273f83285..f5248698a 100755 --- a/modules/freifunk/root/etc/init.d/freifunk +++ b/modules/freifunk/root/etc/init.d/freifunk @@ -33,5 +33,5 @@ boot() { done } - ( /usr/sbin/ff_rdate; /etc/init.d/cron restart ) & + ( sleep 40; /usr/sbin/ff_rdate; /etc/init.d/cron restart ) & } diff --git a/po/it/base.po b/po/it/base.po index b0ec1a43c..6911922cb 100644 --- a/po/it/base.po +++ b/po/it/base.po @@ -3,13 +3,13 @@ msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2009-06-10 03:40+0200\n" -"PO-Revision-Date: 2011-05-22 10:50+0200\n" +"PO-Revision-Date: 2011-06-26 16:20+0200\n" "Last-Translator: Massimo \n" "Language-Team: LANGUAGE \n" +"Language: it\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: it\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" "X-Generator: Pootle 2.0.4\n" @@ -41,10 +41,10 @@ msgid "15 Minute Load:" msgstr "15 minuti carico::" msgid "40MHz 2nd channel above" -msgstr "40MHz secondo canale insieme" +msgstr "40MHz superiore" msgid "40MHz 2nd channel below" -msgstr "40MHz per il secondo canale " +msgstr "40MHz inferiore" msgid "5 Minute Load:" msgstr "5 minuti carico:" diff --git a/po/ru/ahcp.po b/po/ru/ahcp.po index 0c6f09a4e..baa7276a8 100644 --- a/po/ru/ahcp.po +++ b/po/ru/ahcp.po @@ -1,8 +1,8 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" -"PO-Revision-Date: 2011-06-20 14:49+0200\n" -"Last-Translator: Alex \n" +"PO-Revision-Date: 2011-07-01 12:49+0200\n" +"Last-Translator: Jo-Philipp \n" "Language-Team: none\n" "Language: ru\n" "MIME-Version: 1.0\n" @@ -40,10 +40,10 @@ msgid "Age" msgstr "" msgid "Announced DNS servers" -msgstr "" +msgstr "Объявленные DNS сервера" msgid "Announced NTP servers" -msgstr "" +msgstr "Объявленные NTP сервера " msgid "Announced prefixes" msgstr "" @@ -52,7 +52,7 @@ msgid "Collecting data..." msgstr "Сбор данных.." msgid "Forwarder" -msgstr "" +msgstr "Средство передачи" msgid "General Setup" msgstr "" diff --git a/themes/freifunk-generic/htdocs/luci-static/freifunk-generic/mobile.css b/themes/freifunk-generic/htdocs/luci-static/freifunk-generic/mobile.css index 8649b34ff..e20ab69d3 100644 --- a/themes/freifunk-generic/htdocs/luci-static/freifunk-generic/mobile.css +++ b/themes/freifunk-generic/htdocs/luci-static/freifunk-generic/mobile.css @@ -86,7 +86,7 @@ } #maincontent{ - font-size:35px!important; + font-size:25px!important; line-height:40px; } @@ -98,7 +98,7 @@ input[type=submit], float:none !important; padding:10px 30px !important; margin: 0px 10px !important; - font-size:45px !important; + font-size:25px !important; font-family: impact, sans-serif !important; background:#ff8800 none !important; border-color:#000000 !important; @@ -109,13 +109,13 @@ input[type=submit], .cbi-input-user, .cbi-input-password{ display:block !important; - font-size:35px !important; + font-size:25px !important; margin: 0 !important; padding:0 !important; } .cbi-value-field{ - font-size:35px; + font-size:25px; margin:0 !important; margin-bottom: 1em !important; width:100% !important; @@ -129,7 +129,7 @@ input[type=submit], } .cbi-value-title{ - font-size:35px; + font-size:25px; font-weight:bold; float:none !important; } -- 2.11.0