luci-0.10: merge r7249 - r7265
authorJo-Philipp Wich <jow@openwrt.org>
Tue, 12 Jul 2011 20:46:24 +0000 (20:46 +0000)
committerJo-Philipp Wich <jow@openwrt.org>
Tue, 12 Jul 2011 20:46:24 +0000 (20:46 +0000)
20 files changed:
applications/luci-meshwizard/root/etc/uci-defaults/meshwizard
applications/luci-splash/htdocs/cgi-bin/splash/splash.sh
applications/luci-splash/root/etc/init.d/luci_splash
applications/luci-splash/root/usr/sbin/luci-splash
contrib/package/meshwizard/files/usr/bin/meshwizard/helpers/setup_firewall.sh
contrib/package/meshwizard/files/usr/bin/meshwizard/helpers/setup_splash.sh
contrib/package/meshwizard/files/usr/bin/meshwizard/helpers/setup_system.sh [new file with mode: 0755]
contrib/package/meshwizard/files/usr/bin/meshwizard/wizard.sh
modules/admin-full/luasrc/model/cbi/admin_network/ifaces.lua
modules/admin-full/luasrc/model/cbi/admin_system/system.lua
modules/admin-full/luasrc/view/admin_status/index.htm
modules/freifunk/luasrc/view/freifunk/index.htm
modules/freifunk/root/etc/config/freifunk
modules/freifunk/root/etc/config/profile_gadow
modules/freifunk/root/etc/config/profile_l59
modules/freifunk/root/etc/config/profile_leipzig
modules/freifunk/root/etc/init.d/freifunk
po/it/base.po
po/ru/ahcp.po
themes/freifunk-generic/htdocs/luci-static/freifunk-generic/mobile.css

index 2154e9771df053649316618db50864b148c56d27..eae65d5a10cbdb36d3d6efbbaeea8e1ceec3343d 100644 (file)
@@ -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
index 75e3c2edfdcf02fca44838a655ceee1bb002d17c..cbffaf6ab3f88223f27e97062b3d16f925652d4d 100755 (executable)
@@ -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 <<EOT
-<html>
-       <head>
-               <title>Splash</title>
-               <meta http-equiv="refresh" content="0; url=http://$SERVER_ADDR/cgi-bin/luci/splash" />
-       </head>
-       <body style="font-family:sans-serif">
-               <h1>Splash on $(cat /proc/sys/kernel/hostname)</h1>
-               <p>
-                       Redirecting to authentication for $REMOTE_ADDR on $SERVER_ADDR.<br /><br />
-                       [<a href="http://$SERVER_ADDR/cgi-bin/luci/splash">Click here to continue...</a>]
-               </p>
-       </body>
-</html>
+<?xml version="1.0" encoding="UTF-8"?>
+<WISPAccessGatewayParam xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://www.wballiance.net/wispr_2_0.xsd">
+       <Redirect>
+               <MessageType>100</MessageType>
+               <ResponseCode>0</ResponseCode>
+               <AccessProcedure>1.0</AccessProcedure>
+               <AccessLocation>12</AccessLocation>
+               <LocationName>$SERVER_ADDR</LocationName>
+               <LoginURL>http://$SERVER_ADDR/cgi-bin/luci/splash?wispr=1</LoginURL>
+               <AbortLoginURL>http://$SERVER_ADDR/</AbortLoginURL>
+       </Redirect>
+</WISPAccessGatewayParam>
 EOT
 
index 285471773488f9715a1033cd2494e45e6ff6384a..e4980d968bbbf79d09489d2b89dead14f41b38e0 100755 (executable)
@@ -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
index b8b70145871ebcbc66b5a48441a249b9d92d2e4e..7738679f63afed0cfed24efd90c5219f05b42c2b 100755 (executable)
@@ -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()
index 299b167fe5d901c9a6be743e46569847d7b3c2a4..c9681425fffe4ae3f888412dbcfe7f78fa016c65 100755 (executable)
@@ -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
index 8e143d338e4fd273343a60afbf51bc047a320f1f..b28ccc93c70e93b0adcac9af93b52a7a66fdfd03 100755 (executable)
@@ -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 (executable)
index 0000000..d6b30e3
--- /dev/null
@@ -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
index 547f44afd10862f7a3b65cae254853e8a3ecf130..d6d7fb7cc410b3f139031a0fa597811611476e43 100755 (executable)
@@ -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
index cc54d4516bd9600c5adcae65e4deee707c6e532b..84d7ba5c66b4009e9c5700c41e527f65d3aff952 100644 (file)
@@ -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</code>\" 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
index 4fe10d0ed3bcd7602e0e07516a4f8616c7e79deb..f2e83401e00e9411d12f6cf9afaead606118a690 100644 (file)
@@ -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
index f6432ef6f922c4720005409d3e8c419e18854555..16cd32a2c11795598d16fcc53fef87b5ac316c85 100644 (file)
@@ -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';
index 4a9ab2efe1c4e664ce0ffd31d94ac77940b5442d..a8cf62e4be614b9a840892e26174a779131f9a9b 100644 (file)
@@ -40,8 +40,8 @@ if (ff.community.DefaultText or "") ~= "disabled" then
        ' '..
        luci.sys.hostname()..
        '. '..
-       translate("It is operated by ")..
-       '<a href="'..
+       translate("It is operated by")..
+       ' <a href="'..
        luci.dispatcher.build_url("freifunk", "index", "contact")..
        '">'..
        (ff.contact.nickname or translate("Please set your contact information"))..
index 99a53269ce5359c450c5c39c2ab72753025cf969..051dc4acf07897041a559df8f9ab5af96842c984 100644 (file)
@@ -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'
index 5b963bcbfe3a964cdd93a0f7250438eb9074d7f8..ca4143b91ed667dca4bb8d5a6d59ebdd2ebe4906 100644 (file)
@@ -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'
index 67c48cc81c9a464eaf24b6fa2c6f96786c494480..6185f0257a7353adf28d19ebe4520f9321d7bb89 100644 (file)
@@ -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'
index 1418f7aae56a614e1387946e09e8561e045b5811..24e20ce48cf47913d0539ead7a381261063358cc 100644 (file)
@@ -9,4 +9,5 @@ config 'community' 'profile'
        option 'longitude' '12.40297'
 
 
-
+config 'defaults' 'bssidscheme'
+       option '1' '02:CA:FF:EE:BA:BE'
index 273f83285600103d9ad25cb145c8ed4cf88fc410..f5248698a4eb30d66e2157d5068377fea87c4fdd 100755 (executable)
@@ -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 ) &
 }
index b0ec1a43ca20cd9a0f42359b971b19fcc58f6c84..6911922cbf14ed9bd11da8f341d62c088b380dd2 100644 (file)
@@ -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 <coatto87@gmail.com>\n"
 "Language-Team: LANGUAGE <LL@li.org>\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:"
index 0c6f09a4e4f886f85f40ee99dd185ed4686d9be9..baa7276a8409f3ea9f1e4f24713abaac039ee2da 100644 (file)
@@ -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 <gaus@pisem.net>\n"
+"PO-Revision-Date: 2011-07-01 12:49+0200\n"
+"Last-Translator: Jo-Philipp <xm@subsignal.org>\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 ""
index 8649b34ffd855b93ff6d7aeea59ddb4858247c41..e20ab69d3e7823cd7f032354cb1719095eadb0b9 100644 (file)
@@ -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;
 }