luci-0.10: merge r7249 - r7265

This commit is contained in:
Jo-Philipp Wich 2011-07-12 20:46:24 +00:00
parent f1958c0b84
commit a66f8c395d
20 changed files with 106 additions and 79 deletions

View file

@ -4,3 +4,5 @@ set ucitrack.meshwizard="meshwizard"
set ucitrack.meshwizard.exec="/etc/init.d/wizard boot" set ucitrack.meshwizard.exec="/etc/init.d/wizard boot"
commit ucitrack commit ucitrack
EOF EOF
rm -f /tmp/luci-indexcache

View file

@ -2,24 +2,22 @@
echo -en "Cache-Control: no-cache, max-age=0, no-store, must-revalidate\r\n" echo -en "Cache-Control: no-cache, max-age=0, no-store, must-revalidate\r\n"
echo -en "Pragma: no-cache\r\n" echo -en "Pragma: no-cache\r\n"
echo -en "Expires: -1\r\n" echo -en "Expires: -1\r\n"
echo -en "Status: 403 Forbidden\r\n" echo -en "Status: 307 Temporary Redirect\r\n"
echo -en "Content-Type: text/html\r\n\r\n" echo -en "Location: http://$SERVER_ADDR/cgi-bin/luci/splash\r\n"
#echo -en "Status: 307 Temporary Redirect\r\n" echo -en "\r\n"
#echo -en "Location: http://$SERVER_ADDR/cgi-bin/luci/splash\r\n\r\n"
cat <<EOT cat <<EOT
<html> <?xml version="1.0" encoding="UTF-8"?>
<head> <WISPAccessGatewayParam xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://www.wballiance.net/wispr_2_0.xsd">
<title>Splash</title> <Redirect>
<meta http-equiv="refresh" content="0; url=http://$SERVER_ADDR/cgi-bin/luci/splash" /> <MessageType>100</MessageType>
</head> <ResponseCode>0</ResponseCode>
<body style="font-family:sans-serif"> <AccessProcedure>1.0</AccessProcedure>
<h1>Splash on $(cat /proc/sys/kernel/hostname)</h1> <AccessLocation>12</AccessLocation>
<p> <LocationName>$SERVER_ADDR</LocationName>
Redirecting to authentication for $REMOTE_ADDR on $SERVER_ADDR.<br /><br /> <LoginURL>http://$SERVER_ADDR/cgi-bin/luci/splash?wispr=1</LoginURL>
[<a href="http://$SERVER_ADDR/cgi-bin/luci/splash">Click here to continue...</a>] <AbortLoginURL>http://$SERVER_ADDR/</AbortLoginURL>
</p> </Redirect>
</body> </WISPAccessGatewayParam>
</html>
EOT EOT

View file

@ -161,7 +161,7 @@ EOF
} }
start() { start() {
lock -w $LOCK && lock $LOCK lock $LOCK
include /lib/network include /lib/network
scan_interfaces scan_interfaces
@ -238,7 +238,7 @@ start() {
} }
stop() { stop() {
lock -w $LOCK && lock $LOCK lock $LOCK
include /lib/network include /lib/network
scan_interfaces scan_interfaces

View file

@ -14,7 +14,7 @@ local limit_up = 0
local limit_down = 0 local limit_down = 0
function lock() 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 end
function unlock() function unlock()

View file

@ -12,6 +12,15 @@ config_load firewall
type="$(uci -q get wireless.$net.type)" type="$(uci -q get wireless.$net.type)"
vap="$(uci -q get meshwizard.netconfig.$net\_vap)" 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 # Delete old firewall zone for freifunk
handle_fwzone() { handle_fwzone() {
config_get name "$1" name config_get name "$1" name

View file

@ -23,10 +23,13 @@ config_foreach handle_splash iface
uci batch << EOF uci batch << EOF
set luci_splash.${netrenamed}dhcp="iface" 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" set luci_splash.${netrenamed}dhcp.zone="freifunk"
EOF EOF
echo " network: ${netrenamed}dhcp" echo " network: ${netrenamed}dhcp"
uci commit uci commit
/etc/init.d/luci_splash enable

View file

@ -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

View file

@ -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 [ -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 Community=$community
Network(s)=$networks" Network(s)=$networks"
@ -49,6 +49,9 @@ done < /tmp/meshwizard.tmp
echo "++++ dnsmasq config" echo "++++ dnsmasq config"
$dir/helpers/setup_dnsmasq.sh $dir/helpers/setup_dnsmasq.sh
# system
$dir/helpers/setup_system.sh
# Configure found networks # Configure found networks
for net in $networks; do for net in $networks; do
@ -87,12 +90,6 @@ for net in $networks; do
echo " Configuration of $net finished." echo " Configuration of $net finished."
done done
##### Restart services ##### Reboot the router (because simply restarting services gave errors)
#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 reboot

View file

@ -663,8 +663,7 @@ end
if has_dnsmasq and net:proto() == "static" then if has_dnsmasq and net:proto() == "static" then
m2 = Map("dhcp", "", "") m2 = Map("dhcp", "", "")
local section_id = "-" local section_id
function m2.on_parse() function m2.on_parse()
m2.uci:foreach("dhcp", "dhcp", function(s) m2.uci:foreach("dhcp", "dhcp", function(s)
if s.interface == arg[1] then if s.interface == arg[1] then
@ -672,6 +671,15 @@ if has_dnsmasq and net:proto() == "static" then
return false return false
end end
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 end
s = m2:section(TypedSection, "dhcp", translate("DHCP Server")) s = m2:section(TypedSection, "dhcp", translate("DHCP Server"))
@ -690,17 +698,16 @@ if has_dnsmasq and net:proto() == "static" then
"this interface.")) "this interface."))
ignore.rmempty = false ignore.rmempty = false
ignore.default = ignore.enabled
function ignore.cfgvalue(self, section)
return (section == "-") and self.enabled or Flag.cfgvalue(self, section)
end
function ignore.write(self, section, value) function ignore.write(self, section, value)
section_id = m2.uci:section("dhcp", "dhcp", nil, { if m2.uci:get("dhcp", section) ~= "dhcp" then
ignore = value, m2.uci:section("dhcp", "dhcp", section, {
interface = arg[1] interface = arg[1]
}) })
end end
m2.uci:set("dhcp", section, "ignore", (value == "1") and "1" or "0")
end
local start = s:taboption("general", Value, "start", translate("Start"), 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.")) "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 for i, n in ipairs(s.children) do
if n ~= ignore then if n ~= ignore then
n:depends("ignore", "") n:depends("ignore", "")
n.write = write_opt
n.remove = remove_opt
end end
end end
end end

View file

@ -123,14 +123,14 @@ o.placeholder = 514
o.datatype = "port" o.datatype = "port"
o = s:taboption("logging", ListValue, "conloglevel", translate("Log output level")) o = s:taboption("logging", ListValue, "conloglevel", translate("Log output level"))
o:value(7, translate("Debug")) o:value(8, translate("Debug"))
o:value(6, translate("Info")) o:value(7, translate("Info"))
o:value(5, translate("Notice")) o:value(6, translate("Notice"))
o:value(4, translate("Warning")) o:value(5, translate("Warning"))
o:value(3, translate("Error")) o:value(4, translate("Error"))
o:value(2, translate("Critical")) o:value(3, translate("Critical"))
o:value(1, translate("Alert")) o:value(2, translate("Alert"))
o:value(0, translate("Emergency")) o:value(1, translate("Emergency"))
o = s:taboption("logging", ListValue, "cronloglevel", translate("Cron Log Level")) o = s:taboption("logging", ListValue, "cronloglevel", translate("Cron Log Level"))
o.default = 8 o.default = 8

View file

@ -409,7 +409,7 @@ $Id$
tr.insertCell(-1).innerHTML = String.format('%d dBm', assoclist[i].noise); 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); var tr = ac.rows[0].parentNode.insertRow(-1);
tr.className = 'cbi-section-table-row'; tr.className = 'cbi-section-table-row';

View file

@ -40,8 +40,8 @@ if (ff.community.DefaultText or "") ~= "disabled" then
' '.. ' '..
luci.sys.hostname().. luci.sys.hostname()..
'. '.. '. '..
translate("It is operated by ").. translate("It is operated by")..
'<a href="'.. ' <a href="'..
luci.dispatcher.build_url("freifunk", "index", "contact").. luci.dispatcher.build_url("freifunk", "index", "contact")..
'">'.. '">'..
(ff.contact.nickname or translate("Please set your contact information")).. (ff.contact.nickname or translate("Please set your contact information"))..

View file

@ -85,6 +85,10 @@ config 'fw_forwarding' 'fffwd'
option 'src' 'freifunk' option 'src' 'freifunk'
option 'dest' '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' config 'defaults' 'wifi_device'
option 'channel' '1' option 'channel' '1'
option 'diversity' '1' option 'diversity' '1'

View file

@ -11,4 +11,5 @@ config 'community' 'profile'
config 'defaults' 'interface' config 'defaults' 'interface'
option 'netmask' '255.0.0.0' option 'netmask' '255.0.0.0'
config 'defaults' 'bssidscheme'
option '1' '02:CA:FF:EE:BA:BE'

View file

@ -7,3 +7,6 @@ config 'community' 'profile'
option 'splash_prefix' '27' option 'splash_prefix' '27'
option 'latitude' '52.26337' option 'latitude' '52.26337'
option 'longitude' '10.52103' option 'longitude' '10.52103'
config 'defaults' 'bssidscheme'
option '1' '02:CA:FF:EE:BA:BE'

View file

@ -9,4 +9,5 @@ config 'community' 'profile'
option 'longitude' '12.40297' option 'longitude' '12.40297'
config 'defaults' 'bssidscheme'
option '1' '02:CA:FF:EE:BA:BE'

View file

@ -33,5 +33,5 @@ boot() {
done done
} }
( /usr/sbin/ff_rdate; /etc/init.d/cron restart ) & ( sleep 40; /usr/sbin/ff_rdate; /etc/init.d/cron restart ) &
} }

View file

@ -3,13 +3,13 @@ msgstr ""
"Project-Id-Version: PACKAGE VERSION\n" "Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2009-06-10 03:40+0200\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" "Last-Translator: Massimo <coatto87@gmail.com>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"
"Language: it\n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n" "Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
"Language: it\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n"
"X-Generator: Pootle 2.0.4\n" "X-Generator: Pootle 2.0.4\n"
@ -41,10 +41,10 @@ msgid "15 Minute Load:"
msgstr "15 minuti carico::" msgstr "15 minuti carico::"
msgid "40MHz 2nd channel above" msgid "40MHz 2nd channel above"
msgstr "40MHz secondo canale insieme" msgstr "40MHz superiore"
msgid "40MHz 2nd channel below" msgid "40MHz 2nd channel below"
msgstr "40MHz per il secondo canale " msgstr "40MHz inferiore"
msgid "5 Minute Load:" msgid "5 Minute Load:"
msgstr "5 minuti carico:" msgstr "5 minuti carico:"

View file

@ -1,8 +1,8 @@
msgid "" msgid ""
msgstr "" msgstr ""
"Project-Id-Version: PACKAGE VERSION\n" "Project-Id-Version: PACKAGE VERSION\n"
"PO-Revision-Date: 2011-06-20 14:49+0200\n" "PO-Revision-Date: 2011-07-01 12:49+0200\n"
"Last-Translator: Alex <gaus@pisem.net>\n" "Last-Translator: Jo-Philipp <xm@subsignal.org>\n"
"Language-Team: none\n" "Language-Team: none\n"
"Language: ru\n" "Language: ru\n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
@ -40,10 +40,10 @@ msgid "Age"
msgstr "" msgstr ""
msgid "Announced DNS servers" msgid "Announced DNS servers"
msgstr "" msgstr "Объявленные DNS сервера"
msgid "Announced NTP servers" msgid "Announced NTP servers"
msgstr "" msgstr "Объявленные NTP сервера "
msgid "Announced prefixes" msgid "Announced prefixes"
msgstr "" msgstr ""
@ -52,7 +52,7 @@ msgid "Collecting data..."
msgstr "Сбор данных.." msgstr "Сбор данных.."
msgid "Forwarder" msgid "Forwarder"
msgstr "" msgstr "Средство передачи"
msgid "General Setup" msgid "General Setup"
msgstr "" msgstr ""

View file

@ -86,7 +86,7 @@
} }
#maincontent{ #maincontent{
font-size:35px!important; font-size:25px!important;
line-height:40px; line-height:40px;
} }
@ -98,7 +98,7 @@ input[type=submit],
float:none !important; float:none !important;
padding:10px 30px !important; padding:10px 30px !important;
margin: 0px 10px !important; margin: 0px 10px !important;
font-size:45px !important; font-size:25px !important;
font-family: impact, sans-serif !important; font-family: impact, sans-serif !important;
background:#ff8800 none !important; background:#ff8800 none !important;
border-color:#000000 !important; border-color:#000000 !important;
@ -109,13 +109,13 @@ input[type=submit],
.cbi-input-user, .cbi-input-user,
.cbi-input-password{ .cbi-input-password{
display:block !important; display:block !important;
font-size:35px !important; font-size:25px !important;
margin: 0 !important; margin: 0 !important;
padding:0 !important; padding:0 !important;
} }
.cbi-value-field{ .cbi-value-field{
font-size:35px; font-size:25px;
margin:0 !important; margin:0 !important;
margin-bottom: 1em !important; margin-bottom: 1em !important;
width:100% !important; width:100% !important;
@ -129,7 +129,7 @@ input[type=submit],
} }
.cbi-value-title{ .cbi-value-title{
font-size:35px; font-size:25px;
font-weight:bold; font-weight:bold;
float:none !important; float:none !important;
} }