diff options
Diffstat (limited to 'applications')
45 files changed, 1346 insertions, 339 deletions
diff --git a/applications/luci-app-ddns/Makefile b/applications/luci-app-ddns/Makefile index a2d2ae9473..0e1e5df4c1 100644 --- a/applications/luci-app-ddns/Makefile +++ b/applications/luci-app-ddns/Makefile @@ -10,7 +10,7 @@ PKG_NAME:=luci-app-ddns # Version == major.minor.patch # increase on new functionality (minor) or patches (patch) -PKG_VERSION:=2.2.3 +PKG_VERSION:=2.2.4 # Release == build # increase on changes of translation files diff --git a/applications/luci-app-ddns/luasrc/tools/ddns.lua b/applications/luci-app-ddns/luasrc/tools/ddns.lua index 6d53931469..4466063cb3 100644 --- a/applications/luci-app-ddns/luasrc/tools/ddns.lua +++ b/applications/luci-app-ddns/luasrc/tools/ddns.lua @@ -98,8 +98,7 @@ end -- compare versions using "<=" "<" ">" ">=" "=" "<<" ">>" function ipkg_ver_compare(ver1, comp, ver2) - if not ver1 or not (#ver1 > 0) - or not ver2 or not (#ver2 > 0) + if not ver1 or not ver2 or not comp or not (#comp > 0) then return nil end -- correct compare string if comp == "<>" or comp == "><" or comp == "!=" or comp == "~=" then comp = "~=" @@ -116,33 +115,19 @@ function ipkg_ver_compare(ver1, comp, ver2) for i = 1, math.max(table.getn(av1),table.getn(av2)), 1 do local s1 = av1[i] or "" local s2 = av2[i] or "" - local n1 = tonumber(s1) - local n2 = tonumber(s2) - -- one numeric and other empty string then set other to 0 - if n1 and not n2 and (not s2 or #s2 == 0) then n2 = 0 end - if n2 and not n1 and (not s1 or #s1 == 0) then n1 = 0 end - - local nc = (n1 and n2) -- numeric compare - - if nc then - -- first "not equal" found return true - if comp == "~=" and (n1 ~= n2) then return true end - -- first "lower" found return true - if (comp == "<" or comp == "<=") and (n1 < n2) then return true end - -- first "greater" found return true - if (comp == ">" or comp == ">=") and (n1 > n2) then return true end - -- not equal then return false - if (n1 ~= n2) then return false end - else - if comp == "~=" and (s1 ~= s2) then return true end - if (comp == "<" or comp == "<=") and (s1 < s2) then return true end - if (comp == ">" or comp == ">=") and (s1 > s2) then return true end - if (s1 ~= s2) then return false end - end + -- first "not equal" found return true + if comp == "~=" and (s1 ~= s2) then return true end + -- first "lower" found return true + if (comp == "<" or comp == "<=") and (s1 < s2) then return true end + -- first "greater" found return true + if (comp == ">" or comp == ">=") and (s1 > s2) then return true end + -- not equal then return false + if (s1 ~= s2) then return false end end - -- all equal then true - return true + + -- all equal and not compare greater or lower then true + return not (comp == "<" or comp == ">") end -- read version information for given package if installed diff --git a/applications/luci-app-firewall/luasrc/model/cbi/firewall/zone-details.lua b/applications/luci-app-firewall/luasrc/model/cbi/firewall/zone-details.lua index 3eb95ebb57..46b3744403 100644 --- a/applications/luci-app-firewall/luasrc/model/cbi/firewall/zone-details.lua +++ b/applications/luci-app-firewall/luasrc/model/cbi/firewall/zone-details.lua @@ -76,6 +76,15 @@ function name.write(self, section, value) } end +function name.validate(self, value) + -- fw3 defines 14 as the maximum length of zone name + if #value > 14 then + return nil, translate("Zone name is too long") + else + return value + end +end + p = { s:taboption("general", ListValue, "input", translate("Input")), s:taboption("general", ListValue, "output", translate("Output")), diff --git a/applications/luci-app-fwknopd/luasrc/model/cbi/fwknopd.lua b/applications/luci-app-fwknopd/luasrc/model/cbi/fwknopd.lua index 84a1a23d86..096724f735 100644 --- a/applications/luci-app-fwknopd/luasrc/model/cbi/fwknopd.lua +++ b/applications/luci-app-fwknopd/luasrc/model/cbi/fwknopd.lua @@ -46,6 +46,8 @@ s = m:section(TypedSection, "config", translate("fwknopd.conf config options")) s.anonymous=true s.dynamic=true s:option(Value, "MAX_SPA_PACKET_AGE", "MAX_SPA_PACKET_AGE", translate("Maximum age in seconds that an SPA packet will be accepted. defaults to 120 seconds")) +s:option(Value, "PCAP_INTF", "PCAP_INTF", translate("Specify the ethernet interface on which fwknopd will sniff packets.")) +s:option(Value, "ENABLE_IPT_FORWARDING", "ENABLE_IPT_FORWARDING", translate("Allow SPA clients to request access to services through an iptables firewall instead of just to it.")) s:option(DummyValue, "note2", translate("Enter custom fwknopd.conf variables below:")) return m diff --git a/applications/luci-app-fwknopd/po/en/en.po b/applications/luci-app-fwknopd/po/en/fwknopd.po index 1abc6a8f95..d75c99d524 100644 --- a/applications/luci-app-fwknopd/po/en/en.po +++ b/applications/luci-app-fwknopd/po/en/fwknopd.po @@ -10,6 +10,13 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" +msgid "" +"Allow SPA clients to request access to services through an iptables firewall " +"instead of just to it." +msgstr "" +"Allow SPA clients to request access to services through an iptables firewall " +"instead of just to it." + msgid "Base 64 key" msgstr "Base 64 key" @@ -83,6 +90,9 @@ msgstr "" msgid "Normal Key" msgstr "Normal Key" +msgid "Specify the ethernet interface on which fwknopd will sniff packets." +msgstr "Specify the ethernet interface on which fwknopd will sniff packets." + msgid "The base64 hmac key" msgstr "The base64 hmac key" diff --git a/applications/luci-app-fwknopd/po/templates/fwknopd.pot b/applications/luci-app-fwknopd/po/templates/fwknopd.pot index ec15504627..4fb616f25e 100644 --- a/applications/luci-app-fwknopd/po/templates/fwknopd.pot +++ b/applications/luci-app-fwknopd/po/templates/fwknopd.pot @@ -1,6 +1,11 @@ msgid "" msgstr "Content-Type: text/plain; charset=UTF-8" +msgid "" +"Allow SPA clients to request access to services through an iptables firewall " +"instead of just to it." +msgstr "" + msgid "Base 64 key" msgstr "" @@ -57,6 +62,9 @@ msgstr "" msgid "Normal Key" msgstr "" +msgid "Specify the ethernet interface on which fwknopd will sniff packets." +msgstr "" + msgid "The base64 hmac key" msgstr "" diff --git a/applications/luci-app-fwknopd/root/etc/uci-defaults/luci-fwknopd b/applications/luci-app-fwknopd/root/etc/uci-defaults/luci-fwknopd index a7c433f2bc..01b85de25f 100644 --- a/applications/luci-app-fwknopd/root/etc/uci-defaults/luci-fwknopd +++ b/applications/luci-app-fwknopd/root/etc/uci-defaults/luci-fwknopd @@ -1,6 +1,7 @@ #!/bin/sh #-- Copyright 2015 Jonathan Bennett <jbennett@incomsystems.biz> #-- Licensed to the public under the GNU General Public License v2. +. /lib/functions/network.sh uci batch <<EOF add ucitrack fwknopd @@ -8,12 +9,14 @@ uci batch <<EOF commit ucitrack EOF -if [ -f /usr/bin/fwknop ]; then - uci set fwknopd.@access[0].keytype='Base 64 key' - uci set fwknopd.@access[0].hkeytype='Base 64 key' - uci set fwknopd.@access[0].KEY_BASE64=`fwknop --key-gen | awk '/^KEY/ {print $2;}'` - uci set fwknopd.@access[0].HMAC_KEY_BASE64=`fwknop --key-gen | awk '/^HMAC/ {print $2;}'` - uci commit fwknopd -fi +uci delete fwknopd.@access[0].KEY +uci delete fwknopd.@access[0].HMAC_KEY +uci set fwknopd.@access[0].keytype='Base 64 key' +uci set fwknopd.@access[0].hkeytype='Base 64 key' +uci set fwknopd.@access[0].KEY_BASE64=`fwknopd --key-gen | awk '/^KEY/ {print $2;}'` +uci set fwknopd.@access[0].HMAC_KEY_BASE64=`fwknopd --key-gen | awk '/^HMAC/ {print $2;}'` +uci set fwknopd.@config[0].ENABLE_IPT_FORWARDING='y' + +uci commit fwknopd rm -f /tmp/luci-indexcache exit 0 diff --git a/applications/luci-app-mjpg-streamer/luasrc/model/cbi/mjpg-streamer.lua b/applications/luci-app-mjpg-streamer/luasrc/model/cbi/mjpg-streamer.lua index 0e1c8bf9b6..d89ab27c29 100644 --- a/applications/luci-app-mjpg-streamer/luasrc/model/cbi/mjpg-streamer.lua +++ b/applications/luci-app-mjpg-streamer/luasrc/model/cbi/mjpg-streamer.lua @@ -5,19 +5,19 @@ m = Map("mjpg-streamer", "MJPG-streamer", translate("mjpg streamer is a streamin --- General settings --- -section_gen = m:section(TypedSection, "mjpg-streamer", "General") +section_gen = m:section(TypedSection, "mjpg-streamer", translate("General")) section_gen.addremove=false section_gen.anonymous=true -enabled = section_gen:option(Flag, "enabled", "Enabled", "Enable MJPG-streamer") +enabled = section_gen:option(Flag, "enabled", translate("Enabled"), translate("Enable MJPG-streamer")) -input = section_gen:option(ListValue, "input", "Input plugin") +input = section_gen:option(ListValue, "input", translate("Input plugin")) input:depends("enabled", "1") input:value("uvc", "UVC") ---input:value("file", "File") input.optional = false -output = section_gen:option(ListValue, "output", "Output plugin") +output = section_gen:option(ListValue, "output", translate("Output plugin")) output:depends("enabled", "1") output:value("http", "HTTP") output:value("file", "File") @@ -26,7 +26,7 @@ output = section_gen:option(ListValue, "output", "Output plugin") --- Plugin settings --- -s = m:section(TypedSection, "mjpg-streamer", "Plugin settings") +s = m:section(TypedSection, "mjpg-streamer", translate("Plugin settings")) s.addremove=false s.anonymous=true diff --git a/applications/luci-app-mjpg-streamer/po/zh-cn/mjpg-streamer.po b/applications/luci-app-mjpg-streamer/po/zh-cn/mjpg-streamer.po new file mode 100644 index 0000000000..3ad9a4a53b --- /dev/null +++ b/applications/luci-app-mjpg-streamer/po/zh-cn/mjpg-streamer.po @@ -0,0 +1,166 @@ +msgid "" +msgstr "" +"Project-Id-Version: luci-app-mjpg-streamer\n" +"POT-Creation-Date: 2015-06-11 21:11+0100\n" +"PO-Revision-Date: 2015-06-11 21:11+0100\n" +"Last-Translator: maz-1 <ohmygod19993 at gmail dotcom>\n" +"Language-Team: \n" +"Language: zh-cn\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: Poedit 1.5.4\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"X-Poedit-SourceCharset: UTF-8\n" + + +msgid "Enabled" +msgstr "启用" + +msgid "Enable MJPG-streamer" +msgstr "启用MJPG-streamer" + +msgid "General" +msgstr "一般设置" + +msgid "Plugin settings" +msgstr "插件设置" + +msgid "Input plugin" +msgstr "输入插件" + +msgid "Output plugin" +msgstr "输出插件" + +msgid "Allow ringbuffer to exceed limit by this amount" +msgstr "允许环形缓冲区最多超过这个数值" + +msgid "Ask for username and password on connect" +msgstr "连接时询问用户名和密码" + +msgid "Authentication required" +msgstr "需要验证" + +msgid "Auto" +msgstr "自动" + +msgid "Automatic disabling of MJPEG mode" +msgstr "自动禁用MJPEG模式" + +msgid "Blink" +msgstr "闪烁" + +msgid "Check to save the stream to an mjpeg file" +msgstr "勾选以保存视频流至一个mjpeg文件" + +msgid "Command to run" +msgstr "运行的命令" + +msgid "Device" +msgstr "设备" + +msgid "Do not initalize dynctrls of Linux-UVC driver" +msgstr "不要初始化Linux-UVC驱动的dynctrls" + +msgid "Don't initalize dynctrls" +msgstr "不要初始化dynctrls" + +msgid "Drop frames smaller then this limit" +msgstr "丢弃小于该尺寸限制的帧" + +msgid "Enable YUYV format" +msgstr "启用YUYV格式" + +msgid "Exceed" +msgstr "超出" + +msgid "" +"Execute command after saving picture. Mjpg-streamer parse the filename as " +"first parameter to your script." +msgstr "保存图片后执行命令。文件名将作为第一个参数传递给命令。" + +msgid "File input" +msgstr "文件输入" + +msgid "File output" +msgstr "文件输出" + +msgid "Folder" +msgstr "文件夹" + +msgid "Folder that contains webpages" +msgstr "保存网页的文件夹" + +msgid "Frames per second" +msgstr "帧每秒" + +msgid "HTTP output" +msgstr "HTTP输出" + +msgid "Interval between saving pictures" +msgstr "图片保存时间间隔" + +msgid "JPEG compression quality" +msgstr "JPEG压缩品质" + +msgid "Led control" +msgstr "LED控制" + +msgid "MJPG-streamer" +msgstr "MJPG-streamer" + +msgid "Max. number of pictures to hold" +msgstr "保存的图片数量上限" + +msgid "Mjpeg output" +msgstr "Mjpeg输出" + +msgid "Off" +msgstr "关" + +msgid "On" +msgstr "开" + +msgid "Password" +msgstr "密码" + +msgid "Port" +msgstr "端口" + +msgid "Resolution" +msgstr "分辨率" + +msgid "Ring buffer size" +msgstr "环形缓冲区大小" + +msgid "Set folder to save pictures" +msgstr "图片保存位置" + +msgid "Set the inteval in millisecond" +msgstr "设置时间间隔(毫秒)" + +msgid "" +"Set the minimum size if the webcam produces small-sized garbage frames. May " +"happen under low light conditions" +msgstr "设置无用帧的最小尺寸。当光照不足时可能出现无用帧。" + +msgid "" +"Set the quality in percent. This setting activates YUYV format, disables " +"MJPEG" +msgstr "设置品质(百分比)。此设置会开启YUYV格式输出,关闭MJPEG输出。" + +msgid "TCP port for this HTTP server" +msgstr "HTTP服务监听的TCP端口" + +msgid "UVC input" +msgstr "UVC输入" + +msgid "Username" +msgstr "用户名" + +msgid "WWW folder" +msgstr "WWW文件夹" + +msgid "" +"mjpg streamer is a streaming application for Linux-UVC compatible webcams" +msgstr "mjpg streamer是一个视频流程序,用于兼容Linux-UVC的摄像头。" diff --git a/applications/luci-app-multiwan/Makefile b/applications/luci-app-multiwan/Makefile index 20fba89b0d..c5b731abbe 100644 --- a/applications/luci-app-multiwan/Makefile +++ b/applications/luci-app-multiwan/Makefile @@ -6,8 +6,8 @@ include $(TOPDIR)/rules.mk -LUCI_TITLE:=LuCI Support for the OpenWrt MultiWAN agent -LUCI_DEPENDS:=+multiwan +LUCI_TITLE:=LuCI Support for the OpenWrt MultiWAN agent (obsoleted by mwan3) +LUCI_DEPENDS:=+multiwan @BROKEN include ../../luci.mk diff --git a/applications/luci-app-olsr/Makefile b/applications/luci-app-olsr/Makefile index f30c242d53..93815a55e2 100644 --- a/applications/luci-app-olsr/Makefile +++ b/applications/luci-app-olsr/Makefile @@ -7,7 +7,7 @@ include $(TOPDIR)/rules.mk LUCI_TITLE:=OLSR configuration and status module -LUCI_DEPENDS:=+olsrd +olsrd-mod-jsoninfo +luci-lib-luaneightbl +LUCI_DEPENDS:=+olsrd +olsrd-mod-jsoninfo +luci-lib-luaneightbl +luci-lib-json include ../../luci.mk diff --git a/applications/luci-app-olsr/luasrc/controller/olsr.lua b/applications/luci-app-olsr/luasrc/controller/olsr.lua index 74deb716c4..cfadd9b7c7 100644 --- a/applications/luci-app-olsr/luasrc/controller/olsr.lua +++ b/applications/luci-app-olsr/luasrc/controller/olsr.lua @@ -80,12 +80,15 @@ end function action_json() local http = require "luci.http" local utl = require "luci.util" - local uci = require "luci.model.uci".cursor_state() + local uci = require "luci.model.uci".cursor() local jsonreq4 local jsonreq6 - jsonreq4 = utl.exec("echo /status | nc 127.0.0.1 9090") - jsonreq6 = utl.exec("echo /status | nc ::1 9090") + local v4_port = uci:get("olsrd", "olsrd_jsoninfo", "port") or 9090 + local v6_port = uci:get("olsrd6", "olsrd_jsoninfo", "port") or 9090 + + jsonreq4 = utl.exec("(echo /status | nc 127.0.0.1 " .. v4_port .. ") 2>/dev/null" ) + jsonreq6 = utl.exec("(echo /status | nc ::1 " .. v6_port .. ") 2>/dev/null") http.prepare_content("application/json") if not jsonreq4 or jsonreq4 == "" then jsonreq4 = "{}" @@ -368,8 +371,11 @@ function fetch_jsoninfo(otable) local IpVersion = uci:get_first("olsrd", "olsrd","IpVersion") local jsonreq4 = "" local jsonreq6 = "" - jsonreq4 = utl.exec("echo /" .. otable .. " | nc 127.0.0.1 9090") - jsonreq6 = utl.exec("echo /" .. otable .. " | nc ::1 9090") + local v4_port = uci:get("olsrd", "olsrd_jsoninfo", "port") or 9090 + local v6_port = uci:get("olsrd6", "olsrd_jsoninfo", "port") or 9090 + + jsonreq4 = utl.exec("(echo /" .. otable .. " | nc 127.0.0.1 " .. v4_port .. ") 2>/dev/null") + jsonreq6 = utl.exec("(echo /" .. otable .. " | nc ::1 " .. v6_port .. ") 2>/dev/null") local jsondata4 = {} local jsondata6 = {} local data4 = {} diff --git a/applications/luci-app-olsr/luasrc/view/status-olsr/overview.htm b/applications/luci-app-olsr/luasrc/view/status-olsr/overview.htm index 0a81d17b46..fa32315280 100644 --- a/applications/luci-app-olsr/luasrc/view/status-olsr/overview.htm +++ b/applications/luci-app-olsr/luasrc/view/status-olsr/overview.htm @@ -6,7 +6,9 @@ -%> <% -local ipv = luci.model.uci.cursor():get_first("olsrd", "olsrd", "IpVersion", "4") + +has_ipv4_conf = luci.model.uci.cursor():get_first("olsrd", "olsrd", "IpVersion") +has_ipv6_conf = luci.model.uci.cursor():get_first("olsrd6", "olsrd", "IpVersion") function write_conf(conf, file) local fs = require "nixio.fs" @@ -19,23 +21,23 @@ end conf = luci.http.formvalue() -if conf.openwrt then +if conf.openwrt_v4 then write_conf("/etc/config/olsrd", "olsrd") return false end -if conf.conf_v4 then - write_conf("/var/etc/olsrd.conf.ipv4", "olsrd.conf.ipv4") +if conf.openwrt_v6 then + write_conf("/etc/config/olsrd6", "olsrd6") return false end -if conf.conf_v6 then - write_conf("/var/etc/olsrd.conf.ipv6", "olsrd.conf.ipv6") +if conf.conf_v4 then + write_conf("/var/etc/olsrd.conf", "olsrd.conf") return false end -if conf.conf then - write_conf("/var/etc/olsrd.conf", "olsrd.conf") +if conf.conf_v6 then + write_conf("/var/etc/olsrd6.conf", "olsrd6.conf") return false end @@ -200,13 +202,18 @@ XHR.poll(10, '<%=REQUEST_URI%>/json', { }, <span id="version">-<span> </td></tr> <tr><td width="33%"><%:Download Config%></td><td> - <a href="<%=REQUEST_URI%>?openwrt">OpenWrt</a>, - <% if ipv == "6and4" then %> - <a href="<%=REQUEST_URI%>?conf_v4">OLSRD IPv4</a>, - <a href="<%=REQUEST_URI%>?conf_v6">OLSRD IPv6</a> - <% else %> - <a href="<%=REQUEST_URI%>?conf">OLSRD</a> - <% end %> + <% if has_ipv4_conf then %> + <a href="<%=REQUEST_URI%>?openwrt_v4">OpenWrt (IPv4)</a>, + <% end %> + <% if has_ipv6_conf then %> + <a href="<%=REQUEST_URI%>?openwrt_v6">OpenWrt (IPv6)</a>, + <% end %> + <% if has_ipv4_conf then %> + <a href="<%=REQUEST_URI%>?conf_v4">OLSRD (IPv4)</a>, + <% end %> + <% if has_ipv6_conf then %> + <a href="<%=REQUEST_URI%>?conf_v6">OLSRD (IPv6)</a> + <% end %> </td></tr> </table> </fieldset> diff --git a/applications/luci-app-openvpn/luasrc/model/cbi/openvpn-advanced.lua b/applications/luci-app-openvpn/luasrc/model/cbi/openvpn-advanced.lua index 7e39dad2eb..fa1530026a 100644 --- a/applications/luci-app-openvpn/luasrc/model/cbi/openvpn-advanced.lua +++ b/applications/luci-app-openvpn/luasrc/model/cbi/openvpn-advanced.lua @@ -48,7 +48,7 @@ local knownParams = { { Flag, "client_disconnect", 0, translate("Run script cmd on client disconnection") }, { Value, "learn_address", "/usr/bin/ovpn-learnaddress", translate("Executed in server mode whenever an IPv4 address/route or MAC address is added to OpenVPN's internal routing table") }, { Value, "auth_user_pass_verify", "/usr/bin/ovpn-userpass via-env", translate("Executed in server mode on new client connections, when the client is still untrusted") }, - { ListValue, "script_security", { 0, 1, 2, 3 }, translate("Policy level over usage of external programs and scripts"), {mode="server" } }, + { ListValue, "script_security", { 0, 1, 2, 3 }, translate("Policy level over usage of external programs and scripts") }, } }, { "Networking", { diff --git a/applications/luci-app-privoxy/Makefile b/applications/luci-app-privoxy/Makefile index bc2c57ee93..e16eb4176e 100644 --- a/applications/luci-app-privoxy/Makefile +++ b/applications/luci-app-privoxy/Makefile @@ -10,11 +10,11 @@ PKG_NAME:=luci-app-privoxy # Version == major.minor.patch # increase "minor" on new functionality and "patch" on patches/optimization -PKG_VERSION:=1.0.3 +PKG_VERSION:=1.0.4 # Release == build # increase on changes of translation files -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_LICENSE:=Apache-2.0 PKG_MAINTAINER:=Christian Schoenebeck <christian.schoenebeck@gmail.com> diff --git a/applications/luci-app-privoxy/luasrc/controller/privoxy.lua b/applications/luci-app-privoxy/luasrc/controller/privoxy.lua index 9ffc404ce9..58ba80724c 100755..100644 --- a/applications/luci-app-privoxy/luasrc/controller/privoxy.lua +++ b/applications/luci-app-privoxy/luasrc/controller/privoxy.lua @@ -72,8 +72,7 @@ end -- compare versions using "<=" "<" ">" ">=" "=" "<<" ">>" function ipkg_ver_compare(ver1, comp, ver2) - if not ver1 or not (#ver1 > 0) - or not ver2 or not (#ver2 > 0) + if not ver1 or not ver2 or not comp or not (#comp > 0) then return nil end -- correct compare string if comp == "<>" or comp == "><" or comp == "!=" or comp == "~=" then comp = "~=" @@ -90,33 +89,19 @@ function ipkg_ver_compare(ver1, comp, ver2) for i = 1, math.max(table.getn(av1),table.getn(av2)), 1 do local s1 = av1[i] or "" local s2 = av2[i] or "" - local n1 = tonumber(s1) - local n2 = tonumber(s2) - - -- one numeric and other empty string then set other to 0 - if n1 and not n2 and (not s2 or #s2 == 0) then n2 = 0 end - if n2 and not n1 and (not s1 or #s1 == 0) then n1 = 0 end - - local nc = (n1 and n2) -- numeric compare - - if nc then - -- first "not equal" found return true - if comp == "~=" and (n1 ~= n2) then return true end - -- first "lower" found return true - if (comp == "<" or comp == "<=") and (n1 < n2) then return true end - -- first "greater" found return true - if (comp == ">" or comp == ">=") and (n1 > n2) then return true end - -- not equal then return false - if (n1 ~= n2) then return false end - else - if comp == "~=" and (s1 ~= s2) then return true end - if (comp == "<" or comp == "<=") and (s1 < s2) then return true end - if (comp == ">" or comp == ">=") and (s1 > s2) then return true end - if (s1 ~= s2) then return false end - end + + -- first "not equal" found return true + if comp == "~=" and (s1 ~= s2) then return true end + -- first "lower" found return true + if (comp == "<" or comp == "<=") and (s1 < s2) then return true end + -- first "greater" found return true + if (comp == ">" or comp == ">=") and (s1 > s2) then return true end + -- not equal then return false + if (s1 ~= s2) then return false end end - -- all equal then true - return true + + -- all equal and not compare greater or lower then true + return not (comp == "<" or comp == ">") end -- read version information for given package if installed diff --git a/applications/luci-app-privoxy/luasrc/model/cbi/privoxy.lua b/applications/luci-app-privoxy/luasrc/model/cbi/privoxy.lua index c009313e3a..c415f8e064 100755..100644 --- a/applications/luci-app-privoxy/luasrc/model/cbi/privoxy.lua +++ b/applications/luci-app-privoxy/luasrc/model/cbi/privoxy.lua @@ -39,6 +39,7 @@ if not nixio.fs.access("/etc/config/privoxy") or not VEROK then local f = SimpleForm("_no_config") f.title = TITLE f.description = DESC + f.embedded = true f.submit = false f.reset = false diff --git a/applications/luci-app-privoxy/luasrc/view/privoxy/detail_logview.htm b/applications/luci-app-privoxy/luasrc/view/privoxy/detail_logview.htm index 3e190709fb..3e190709fb 100755..100644 --- a/applications/luci-app-privoxy/luasrc/view/privoxy/detail_logview.htm +++ b/applications/luci-app-privoxy/luasrc/view/privoxy/detail_logview.htm diff --git a/applications/luci-app-privoxy/po/zh-cn/privoxy.po b/applications/luci-app-privoxy/po/zh-cn/privoxy.po new file mode 100644 index 0000000000..f69a8f9280 --- /dev/null +++ b/applications/luci-app-privoxy/po/zh-cn/privoxy.po @@ -0,0 +1,468 @@ +msgid ""
+msgstr ""
+"Project-Id-Version: luci-app-privoxy\n"
+"POT-Creation-Date: 2015-06-10 20:16+0100\n"
+"PO-Revision-Date: 2015-06-10 20:16+0100\n"
+"Last-Translator: maz-1 <ohmygod19993 at gmail dotcom>\n"
+"Language-Team: \n"
+"Language: zh-cn\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Generator: Poedit 1.5.4\n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+"X-Poedit-SourceCharset: UTF-8\n"
+
+msgid ""
+"A URL to be displayed in the error page that users will see if access to an "
+"untrusted page is denied."
+msgstr ""
+"当用户试图访问不受信任的页面时,错误页面所显示的URL。"
+
+
+msgid ""
+"A URL to documentation about the local Privoxy setup, configuration or "
+"policies."
+msgstr ""
+"指向Privoxy安装、设置和规则说明文档的URL"
+
+
+msgid "A directory where Privoxy can create temporary files."
+msgstr "Privoxy存放临时文件的目录。"
+
+msgid "Access Control"
+msgstr "访问控制"
+
+msgid "Actions that are applied to all sites and maybe overruled later on."
+msgstr ""
+"作用在所有站点上的规则,可能被后面的规则覆盖。"
+
+
+msgid "An alternative directory where the templates are loaded from."
+msgstr "可选的目录,放在里面的模板会被加载。"
+
+msgid "An email address to reach the Privoxy administrator."
+msgstr "用于联系privoxy管理员的邮箱地址。"
+
+msgid ""
+"Assumed server-side keep-alive timeout (in seconds) if not specified by the "
+"server."
+msgstr ""
+"当服务端没有指定超时时间时假定的超时时间(单位秒)。"
+
+msgid "CGI user interface"
+msgstr "CGI用户界面"
+
+msgid "Common Log Format"
+msgstr "通用日志格式"
+
+msgid ""
+"Configure here the routing of HTTP requests through a chain of multiple "
+"proxies. Note that parent proxies can severely decrease your privacy level. "
+"Also specified here are SOCKS proxies."
+msgstr ""
+"在这里设置http请求所经过的多重代理链。"
+"注意父级代理可能严重降低你的隐私安全度。"
+"在这里还可以设置SOCKS代理。"
+
+msgid "Debug GIF de-animation"
+msgstr "GIF动画日志"
+
+msgid "Debug force feature"
+msgstr "force feature日志"
+
+msgid "Debug redirects"
+msgstr "重定向日志"
+
+msgid "Debug regular expression filters"
+msgstr "正则表达式日志"
+
+msgid "Directory does not exist!"
+msgstr "目录不存在!"
+
+msgid "Disabled == Transparent Proxy Mode"
+msgstr "禁用 == 透明代理模式"
+
+msgid "Enable proxy authentication forwarding"
+msgstr "允许转发代理认证"
+
+msgid ""
+"Enable/Disable autostart of Privoxy on system startup and interface events"
+msgstr ""
+"开启/关闭Privoxy在系统启动或者设置界面更改时自动启动。"
+
+msgid "Enable/Disable filtering when Privoxy starts."
+msgstr "Privoxy启动时开启/关闭过滤。"
+
+msgid "Enabled"
+msgstr "已开启"
+
+msgid ""
+"Enabling this option is NOT recommended if there is no parent proxy that "
+"requires authentication!"
+msgstr ""
+"父级代理不需要认证时不推荐开启这个选项!"
+
+msgid "File '%s' not found inside Configuration Directory"
+msgstr "文件 '%s' 没有在设置目录中找到!"
+
+msgid "File not found or empty"
+msgstr "文件不存在或为空"
+
+msgid "Files and Directories"
+msgstr "文件和目录"
+
+msgid "For help use link at the relevant option"
+msgstr ""
+"在相应选项下的连接可获取帮助。"
+
+msgid "Forwarding"
+msgstr "转发"
+
+msgid ""
+"If enabled, Privoxy hides the 'go there anyway' link. The user obviously "
+"should not be able to bypass any blocks."
+msgstr ""
+"如果启用,Privoxy会隐藏'go there anyway'链接。用户显然不应能绕过屏蔽。"
+
+msgid ""
+"If you intend to operate Privoxy for more users than just yourself, it might "
+"be a good idea to let them know how to reach you, what you block and why you "
+"do that, your policies, etc."
+msgstr ""
+"如果除了你还有其他用户通过privoxy连接,让他们知道如何联系你、什么内容被屏蔽了、"
+"你为什么要这么做、你所制定的规范等等是一个好主意。"
+
+msgid "Invalid email address"
+msgstr "邮箱地址无效"
+
+msgid "It is NOT recommended for the casual user."
+msgstr "不推荐新手使用。"
+
+msgid "Local Set-up"
+msgstr "本地设置"
+
+msgid "Location of the Privoxy User Manual."
+msgstr "Privoxy用户手册位置"
+
+msgid "Log File Viewer"
+msgstr "日志查看器"
+
+msgid "Log all data read from the network"
+msgstr "记录所有从网络接收的数据"
+
+msgid "Log all data written to the network"
+msgstr "记录所有发送给网络的数据"
+
+msgid "Log the applying actions"
+msgstr "记录被应用的规则"
+
+msgid ""
+"Log the destination for each request Privoxy let through. See also 'Debug "
+"1024'."
+msgstr ""
+"记录Privoxy所允许的所有请求。另请参考'Debug 1024'。"
+
+msgid ""
+"Log the destination for requests Privoxy didn't let through, and the reason "
+"why."
+msgstr ""
+"记录被Privoxy拒绝的请求目标以及拒绝原因。"
+
+msgid "Logging"
+msgstr "日志"
+
+msgid "Main actions file"
+msgstr "主要规则文件"
+
+msgid "Mandatory Input: No Data given!"
+msgstr "必需选项: 没有设置数据!"
+
+msgid "Mandatory Input: No Directory given!"
+msgstr "必需选项: 没有设置目录!"
+
+msgid "Mandatory Input: No File given!"
+msgstr "必需选项: 没有设置文件!"
+
+msgid "Mandatory Input: No Port given!"
+msgstr "必需选项: 没有设置端口!"
+
+msgid "Mandatory Input: No files given!"
+msgstr "必需选项: 没有设置文件!"
+
+msgid "Mandatory Input: No valid IPv4 address or host given!"
+msgstr ""
+"必需选项: 没有设置有效的IPV4地址或者主机!"
+
+msgid "Mandatory Input: No valid IPv6 address given!"
+msgstr "必需选项: 没有设置有效的IPV6地址!"
+
+msgid "Mandatory Input: No valid Port given!"
+msgstr "必需选项: 没有设置有效的端口!"
+
+msgid "Maximum number of client connections that will be served."
+msgstr "客户端数量上限。"
+
+msgid "Maximum size (in KB) of the buffer for content filtering."
+msgstr "内容过滤的最大缓冲(单位KB)。"
+
+msgid "Miscellaneous"
+msgstr "杂项"
+
+msgid "No trailing '/', please."
+msgstr "路径结尾不要加'/' ."
+
+msgid "Non-fatal errors - *we highly recommended enabling this*"
+msgstr ""
+"非致命性错误 - * 建议开启 *"
+
+msgid ""
+"Number of seconds after which a socket times out if no data is received."
+msgstr ""
+"socket连接未收到数据的超时时间。"
+
+msgid ""
+"Number of seconds after which an open connection will no longer be reused."
+msgstr ""
+"一个开放的连接不再重复使用的超时时间。"
+
+msgid ""
+"Only when using 'external filters', Privoxy has to create temporary files."
+msgstr ""
+"只有使用外置规则时,privoxy才需要创建临时文件。"
+
+msgid "Please press [Read] button"
+msgstr "请点击[读取]按钮"
+
+msgid "Please read Privoxy manual for details!"
+msgstr "请阅读Privoxy手册以了解详情!"
+
+msgid "Please update to the current version!"
+msgstr "请升级到当前版本!"
+
+msgid "Privoxy WEB proxy"
+msgstr "Privoxy 网络代理"
+
+msgid ""
+"Privoxy can (and normally does) use a number of other files for additional "
+"configuration, help and logging. This section of the configuration file "
+"tells Privoxy where to find those other files."
+msgstr ""
+"Privoxy可以使用其他一些文件用于附加设置,帮助和日志。这个区域用来告诉Privoxy从哪里找到这些文件。"
+
+msgid ""
+"Privoxy is a non-caching web proxy with advanced filtering capabilities for "
+"enhancing privacy, modifying web page data and HTTP headers, controlling "
+"access, and removing ads and other obnoxious Internet junk."
+msgstr ""
+"Privoxy是一个无缓存的网络代理,具有高级过滤功能,能够修改网页数据和HTTP头,控制访问,移除广告等。"
+
+msgid "Read / Reread log file"
+msgstr "读取/刷新日志文件"
+
+msgid "Show I/O status"
+msgstr "显示 I/O 状态"
+
+msgid "Show each connection status"
+msgstr "显示每个连接的状态"
+
+msgid "Show header parsing"
+msgstr "Show header parsing"
+
+msgid "Software update required"
+msgstr "需要升级软件"
+
+msgid "Start"
+msgstr "启动"
+
+msgid "Start / Stop"
+msgstr "启动 / 停止"
+
+msgid "Start/Stop Privoxy WEB Proxy"
+msgstr "启动/停止 Privoxy 网络代理"
+
+msgid "Startup banner and warnings."
+msgstr "启动标语和警告。"
+
+msgid "Syntax:"
+msgstr "格式:"
+
+msgid "Syntax: Client header names delimited by spaces."
+msgstr "格式: Client header names delimited by spaces."
+
+msgid "Syntax: target_pattern http_parent[:port]"
+msgstr "格式: target_pattern http_parent[:port]"
+
+msgid "Syntax: target_pattern socks_proxy[:port] http_parent[:port]"
+msgstr "格式: target_pattern socks_proxy[:port] http_parent[:port]"
+
+msgid ""
+"The actions file(s) to use. Multiple actionsfile lines are permitted, and "
+"are in fact recommended!"
+msgstr ""
+"所使用的规则文件。允许并且推荐使用多个规则文件。"
+
+msgid ""
+"The address and TCP port on which Privoxy will listen for client requests."
+msgstr ""
+"Privoxy接收客户端请求时监听的地址和TCP端口。"
+
+msgid ""
+"The compression level that is passed to the zlib library when compressing "
+"buffered content."
+msgstr ""
+"使用zlib压缩缓冲内容时的压缩级别。"
+
+msgid ""
+"The currently installed 'privoxy' package is not supported by LuCI "
+"application."
+msgstr ""
+"目前安装的privoxy版本不被luci支持。"
+
+msgid ""
+"The directory where all logging takes place (i.e. where the logfile is "
+"located)."
+msgstr "所有日志所在的目录。"
+
+msgid "The directory where the other configuration files are located."
+msgstr "其他设置文件所在的目录。"
+
+msgid ""
+"The filter files contain content modification rules that use regular "
+"expressions."
+msgstr ""
+"过滤文件包含了使用正则表达式编写的内容修改规则"
+
+msgid "The hostname shown on the CGI pages."
+msgstr "CGI页面显示的主机名。"
+
+msgid "The log file to use. File name, relative to log directory."
+msgstr ""
+"日志文件名称,与日志路径相对。"
+
+msgid "The order in which client headers are sorted before forwarding them."
+msgstr ""
+"转发数据前,client headers的排序。"
+
+msgid ""
+"The status code Privoxy returns for pages blocked with +handle-as-empty-"
+"document."
+msgstr ""
+"当页面因为handle-as-empty-document规则被阻止时返回的状态码(选上为200 OK,不选上为403 Forbidden)"
+
+msgid ""
+"The trust mechanism is an experimental feature for building white-lists and "
+"should be used with care."
+msgstr ""
+"信任机制是一个实验性的白名单特性,使用时应小心。"
+
+msgid ""
+"The value of this option only matters if the experimental trust mechanism "
+"has been activated."
+msgstr ""
+"只有开启了信任机制时这个选项的值才有效"
+
+msgid ""
+"This option is only there for debugging purposes. It will drastically reduce "
+"performance."
+msgstr ""
+"这个选项仅用于调试,开启后会极大地降低性能。"
+
+msgid ""
+"This option will be removed in future releases as it has been obsoleted by "
+"the more general header taggers."
+msgstr "这个选项在以后的版本中将被移除,因为它被header taggers所取代了。"
+
+msgid ""
+"This tab controls the security-relevant aspects of Privoxy's configuration."
+msgstr ""
+"这个标签用于设置与安全相关的Privoxy选项。"
+
+msgid ""
+"Through which SOCKS proxy (and optionally to which parent HTTP proxy) "
+"specific requests should be routed."
+msgstr ""
+"指定的请求应该通过哪一个SOCKS代理(并且通过哪一个HTTP父代理,可选)"
+
+msgid "To which parent HTTP proxy specific requests should be routed."
+msgstr ""
+"请求应转发至哪一个父级HTTP代理。"
+
+msgid "User customizations"
+msgstr "用户自定义"
+
+msgid "Value is not a number"
+msgstr "输入值不是数字"
+
+msgid "Value not between 0 and 9"
+msgstr "输入值不在0和9之间。"
+
+msgid "Value not between 1 and 4096"
+msgstr "输入值不在1和4096之间"
+
+msgid "Value not greater 0 or empty"
+msgstr "输入值为空或者不是大于零。"
+
+msgid "Value range 1 to 4096, no entry defaults to 4096"
+msgstr "输入值为1到4096,默认为4096"
+
+msgid "Version"
+msgstr "版本"
+
+msgid "Version Information"
+msgstr "版本信息"
+
+msgid "Whether intercepted requests should be treated as valid."
+msgstr "被拦截的请求是否应被当作有效的。"
+
+msgid ""
+"Whether or not Privoxy recognizes special HTTP headers to change toggle "
+"state."
+msgstr ""
+"Privoxy是否识别特殊的HTTP头以切换状态。"
+
+msgid "Whether or not buffered content is compressed before delivery."
+msgstr ""
+"缓冲内容在传递之前是否压缩。"
+
+msgid ""
+"Whether or not outgoing connections that have been kept alive should be "
+"shared between different incoming connections."
+msgstr ""
+"持久出站连接是否应在不同的入站连接之间共享。"
+
+msgid "Whether or not pipelined requests should be served."
+msgstr "是否处理管道化的请求。"
+
+msgid "Whether or not proxy authentication through Privoxy should work."
+msgstr "是否可以通过Privoxy进行代理验证。"
+
+msgid "Whether or not the web-based actions file editor may be used."
+msgstr "是否使用基于网页的规则编辑器。"
+
+msgid "Whether or not the web-based toggle feature may be used."
+msgstr "是否启用基于网页的切换功能。"
+
+msgid "Whether requests to Privoxy's CGI pages can be blocked or redirected."
+msgstr "访问Privoxy CGI页面的请求是否可以被拦截或重定向。"
+
+
+msgid ""
+"Whether the CGI interface should stay compatible with broken HTTP clients."
+msgstr ""
+"CGI界面是否应兼容过时的HTTP客户端。"
+
+msgid "Whether to run only one server thread."
+msgstr "是否只运行一个服务线程。"
+
+msgid "Who can access what."
+msgstr "谁可以访问什么。"
+
+msgid "installed"
+msgstr "已安装"
+
+msgid "or higher"
+msgstr "或更高"
+
+msgid "required"
+msgstr "需要"
diff --git a/applications/luci-app-qos/luasrc/model/cbi/qos/qos.lua b/applications/luci-app-qos/luasrc/model/cbi/qos/qos.lua index 99a884f865..a8ea57e311 100644 --- a/applications/luci-app-qos/luasrc/model/cbi/qos/qos.lua +++ b/applications/luci-app-qos/luasrc/model/cbi/qos/qos.lua @@ -53,25 +53,6 @@ dsth.rmempty = true dsth:value("", translate("all")) wa.cbi_add_knownips(dsth) -l7 = s:option(ListValue, "layer7", translate("Service")) -l7.rmempty = true -l7:value("", translate("all")) - -local pats = io.popen("find /etc/l7-protocols/ -type f -name '*.pat'") -if pats then - local l - while true do - l = pats:read("*l") - if not l then break end - - l = l:match("([^/]+)%.pat$") - if l then - l7:value(l) - end - end - pats:close() -end - p = s:option(Value, "proto", translate("Protocol")) p:value("", translate("all")) p:value("tcp", "TCP") diff --git a/applications/luci-app-radicale/Makefile b/applications/luci-app-radicale/Makefile index 07998aee58..960618dbac 100644 --- a/applications/luci-app-radicale/Makefile +++ b/applications/luci-app-radicale/Makefile @@ -10,7 +10,7 @@ PKG_NAME:=luci-app-radicale # Version == major.minor.patch # increase "minor" on new functionality and "patch" on patches/optimization -PKG_VERSION:=1.0.0 +PKG_VERSION:=1.0.1 # Release == build # increase on changes of translation files diff --git a/applications/luci-app-radicale/luasrc/controller/radicale.lua b/applications/luci-app-radicale/luasrc/controller/radicale.lua index 662c60d5a6..d384b00d9e 100755..100644 --- a/applications/luci-app-radicale/luasrc/controller/radicale.lua +++ b/applications/luci-app-radicale/luasrc/controller/radicale.lua @@ -122,8 +122,7 @@ end -- compare versions using "<=" "<" ">" ">=" "=" "<<" ">>" function ipkg_ver_compare(ver1, comp, ver2) - if not ver1 or not (#ver1 > 0) - or not ver2 or not (#ver2 > 0) + if not ver1 or not ver2 or not comp or not (#comp > 0) then return nil end -- correct compare string if comp == "<>" or comp == "><" or comp == "!=" or comp == "~=" then comp = "~=" @@ -140,33 +139,19 @@ function ipkg_ver_compare(ver1, comp, ver2) for i = 1, math.max(table.getn(av1),table.getn(av2)), 1 do local s1 = av1[i] or "" local s2 = av2[i] or "" - local n1 = tonumber(s1) - local n2 = tonumber(s2) - - -- one numeric and other empty string then set other to 0 - if n1 and not n2 and (not s2 or #s2 == 0) then n2 = 0 end - if n2 and not n1 and (not s1 or #s1 == 0) then n1 = 0 end - - local nc = (n1 and n2) -- numeric compare - - if nc then - -- first "not equal" found return true - if comp == "~=" and (n1 ~= n2) then return true end - -- first "lower" found return true - if (comp == "<" or comp == "<=") and (n1 < n2) then return true end - -- first "greater" found return true - if (comp == ">" or comp == ">=") and (n1 > n2) then return true end - -- not equal then return false - if (n1 ~= n2) then return false end - else - if comp == "~=" and (s1 ~= s2) then return true end - if (comp == "<" or comp == "<=") and (s1 < s2) then return true end - if (comp == ">" or comp == ">=") and (s1 > s2) then return true end - if (s1 ~= s2) then return false end - end + + -- first "not equal" found return true + if comp == "~=" and (s1 ~= s2) then return true end + -- first "lower" found return true + if (comp == "<" or comp == "<=") and (s1 < s2) then return true end + -- first "greater" found return true + if (comp == ">" or comp == ">=") and (s1 > s2) then return true end + -- not equal then return false + if (s1 ~= s2) then return false end end - -- all equal then true - return true + + -- all equal and not compare greater or lower then true + return not (comp == "<" or comp == ">") end -- read version information for given package if installed diff --git a/applications/luci-app-radicale/luasrc/model/cbi/radicale.lua b/applications/luci-app-radicale/luasrc/model/cbi/radicale.lua index 8abb68869d..8abb68869d 100755..100644 --- a/applications/luci-app-radicale/luasrc/model/cbi/radicale.lua +++ b/applications/luci-app-radicale/luasrc/model/cbi/radicale.lua diff --git a/applications/luci-app-shadowsocks-libev/Makefile b/applications/luci-app-shadowsocks-libev/Makefile new file mode 100644 index 0000000000..848a5c8317 --- /dev/null +++ b/applications/luci-app-shadowsocks-libev/Makefile @@ -0,0 +1,14 @@ +# +# Copyright (C) 2008-2014 The LuCI Team <luci@lists.subsignal.org> +# +# This is free software, licensed under the Apache License, Version 2.0 . +# + +include $(TOPDIR)/rules.mk + +LUCI_TITLE:=LuCI Support for Shadowsocks-libev +LUCI_DEPENDS:= + +include ../../luci.mk + +# call BuildPackage - OpenWrt buildroot signature diff --git a/applications/luci-app-shadowsocks-libev/luasrc/controller/shadowsocks-libev.lua b/applications/luci-app-shadowsocks-libev/luasrc/controller/shadowsocks-libev.lua new file mode 100644 index 0000000000..ae968168f1 --- /dev/null +++ b/applications/luci-app-shadowsocks-libev/luasrc/controller/shadowsocks-libev.lua @@ -0,0 +1,12 @@ +-- Copyright 2015 Jian Chang <aa65535@live.com> +-- Licensed to the public under the Apache License 2.0. + +module("luci.controller.shadowsocks-libev", package.seeall) + +function index() + if not nixio.fs.access("/etc/config/shadowsocks-libev") then + return + end + + entry({"admin", "services", "shadowsocks-libev"}, cbi("shadowsocks-libev"), _("ShadowSocks-libev"), 74).dependent = true +end diff --git a/applications/luci-app-shadowsocks-libev/luasrc/model/cbi/shadowsocks-libev.lua b/applications/luci-app-shadowsocks-libev/luasrc/model/cbi/shadowsocks-libev.lua new file mode 100644 index 0000000000..76435e2f14 --- /dev/null +++ b/applications/luci-app-shadowsocks-libev/luasrc/model/cbi/shadowsocks-libev.lua @@ -0,0 +1,156 @@ +-- Copyright 2015 Jian Chang <aa65535@live.com> +-- Licensed to the public under the Apache License 2.0. + +local m, s, o, e, a + +if luci.sys.call("pidof ss-redir >/dev/null") == 0 then + m = Map("shadowsocks-libev", translate("ShadowSocks-libev"), translate("ShadowSocks-libev is running")) +else + m = Map("shadowsocks-libev", translate("ShadowSocks-libev"), translate("ShadowSocks-libev is not running")) +end + +e = { + "table", + "rc4", + "rc4-md5", + "aes-128-cfb", + "aes-192-cfb", + "aes-256-cfb", + "bf-cfb", + "camellia-128-cfb", + "camellia-192-cfb", + "camellia-256-cfb", + "cast5-cfb", + "des-cfb", + "idea-cfb", + "rc2-cfb", + "seed-cfb", + "salsa20", + "chacha20", +} + +-- Global Setting +s = m:section(TypedSection, "shadowsocks-libev", translate("Global Setting")) +s.anonymous = true + +o = s:option(Flag, "enable", translate("Enable")) +o.default = 1 +o.rmempty = false + +o = s:option(Value, "server", translate("Server Address")) +o.datatype = "ipaddr" +o.rmempty = false + +o = s:option(Value, "server_port", translate("Server Port")) +o.datatype = "port" +o.rmempty = false + +o = s:option(Value, "local_port", translate("Local Port")) +o.datatype = "port" +o.default = 1080 +o.rmempty = false + +o = s:option(Value, "timeout", translate("Connection Timeout")) +o.datatype = "uinteger" +o.default = 60 +o.rmempty = false + +o = s:option(Value, "password", translate("Password")) +o.password = true +o.rmempty = false + +o = s:option(ListValue, "encrypt_method", translate("Encrypt Method")) +for i,v in ipairs(e) do + o:value(v) +end +o.rmempty = false + +o = s:option(Value, "ignore_list", translate("Ignore List")) +o:value("/dev/null", translate("Disabled")) +o.default = "/dev/null" +o.rmempty = false + +-- UDP Relay +s = m:section(TypedSection, "shadowsocks-libev", translate("UDP Relay")) +s.anonymous = true + +o = s:option(ListValue, "udp_mode", translate("Relay Mode")) +o:value("0", translate("Disabled")) +o:value("1", translate("Enabled")) +o:value("2", translate("Custom")) +o.default = 0 +o.rmempty = false + +o = s:option(Value, "udp_server", translate("Server Address")) +o.datatype = "ipaddr" +o:depends("udp_mode", 2) + +o = s:option(Value, "udp_server_port", translate("Server Port")) +o.datatype = "port" +o:depends("udp_mode", 2) + +o = s:option(Value, "udp_local_port", translate("Local Port")) +o.datatype = "port" +o.default = 1081 +o:depends("udp_mode", 2) + +o = s:option(Value, "udp_timeout", translate("Connection Timeout")) +o.datatype = "uinteger" +o.default = 60 +o:depends("udp_mode", 2) + +o = s:option(Value, "udp_password", translate("Password")) +o.password = true +o:depends("udp_mode", 2) + +o = s:option(ListValue, "udp_encrypt_method", translate("Encrypt Method")) +for i,v in ipairs(e) do + o:value(v) +end +o:depends("udp_mode", 2) + +-- UDP Forward +s = m:section(TypedSection, "shadowsocks-libev", translate("UDP Forward")) +s.anonymous = true + +o = s:option(Flag, "tunnel_enable", translate("Enable")) +o.default = 1 +o.rmempty = false + +o = s:option(Value, "tunnel_port", translate("UDP Local Port")) +o.datatype = "port" +o.default = 5300 + +o = s:option(Value, "tunnel_forward", translate("Forwarding Tunnel")) +o.default = "8.8.4.4:53" + +-- Access Control +s = m:section(TypedSection, "shadowsocks-libev", translate("Access Control")) +s.anonymous = true + +s:tab("lan_ac", translate("LAN")) + +o = s:taboption("lan_ac", ListValue, "lan_ac_mode", translate("Access Control")) +o:value("0", translate("Disabled")) +o:value("1", translate("Allow listed only")) +o:value("2", translate("Allow all except listed")) +o.default = 0 +o.rmempty = false + +a = luci.sys.net.arptable() or {} + +o = s:taboption("lan_ac", DynamicList, "lan_ac_ip", translate("LAN IP List")) +o.datatype = "ipaddr" +for i,v in ipairs(a) do + o:value(v["IP address"]) +end + +s:tab("wan_ac", translate("WAN")) + +o = s:taboption("wan_ac", DynamicList, "wan_bp_ip", translate("Bypassed IP")) +o.datatype = "ip4addr" + +o = s:taboption("wan_ac", DynamicList, "wan_fw_ip", translate("Forwarded IP")) +o.datatype = "ip4addr" + +return m diff --git a/applications/luci-app-shadowsocks-libev/po/templates/shadowsocks-libev.pot b/applications/luci-app-shadowsocks-libev/po/templates/shadowsocks-libev.pot new file mode 100644 index 0000000000..c2bde961e0 --- /dev/null +++ b/applications/luci-app-shadowsocks-libev/po/templates/shadowsocks-libev.pot @@ -0,0 +1,80 @@ +msgid "" +msgstr "Content-Type: text/plain; charset=UTF-8" + +msgid "ShadowSocks-libev" +msgstr "" + +msgid "ShadowSocks-libev is running" +msgstr "" + +msgid "ShadowSocks-libev is not running" +msgstr "" + +msgid "Global Setting" +msgstr "" + +msgid "Enable" +msgstr "" + +msgid "Enabled" +msgstr "" + +msgid "Disabled" +msgstr "" + +msgid "Custom" +msgstr "" + +msgid "Server Address" +msgstr "" + +msgid "Server Port" +msgstr "" + +msgid "Local Port" +msgstr "" + +msgid "Connection Timeout" +msgstr "" + +msgid "Password" +msgstr "" + +msgid "Encrypt Method" +msgstr "" + +msgid "Ignore List" +msgstr "" + +msgid "UDP Relay" +msgstr "" + +msgid "Relay Mode" +msgstr "" + +msgid "UDP Forward" +msgstr "" + +msgid "UDP Local Port" +msgstr "" + +msgid "Forwarding Tunnel" +msgstr "" + +msgid "Access Control" +msgstr "" + +msgid "Allow listed only" +msgstr "" + +msgid "Allow all except listed" +msgstr "" + +msgid "LAN IP List" +msgstr "" + +msgid "Bypassed IP" +msgstr "" + +msgid "Forwarded IP" +msgstr "" diff --git a/applications/luci-app-shadowsocks-libev/po/zh-cn/shadowsocks-libev.po b/applications/luci-app-shadowsocks-libev/po/zh-cn/shadowsocks-libev.po new file mode 100644 index 0000000000..90a0eff996 --- /dev/null +++ b/applications/luci-app-shadowsocks-libev/po/zh-cn/shadowsocks-libev.po @@ -0,0 +1,91 @@ +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2014-11-12 14:12+0800\n" +"PO-Revision-Date: 2015-07-02 14:26+0800\n" +"Last-Translator: Jian Chang <aa65535@live.com>\n" +"Language: zh_CN\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=1; plural=0;\n" +"X-Generator: Pootle 2.0.6\n" + +msgid "ShadowSocks-libev" +msgstr "ShadowSocks-libev" + +msgid "ShadowSocks-libev is running" +msgstr "ShadowSocks-libev 运行中" + +msgid "ShadowSocks-libev is not running" +msgstr "ShadowSocks-libev 未运行" + +msgid "Global Setting" +msgstr "全局设置" + +msgid "Enable" +msgstr "启用" + +msgid "Enabled" +msgstr "已启用" + +msgid "Disabled" +msgstr "已禁用" + +msgid "Custom" +msgstr "自定义" + +msgid "Server Address" +msgstr "服务器地址" + +msgid "Server Port" +msgstr "服务器端口" + +msgid "Local Port" +msgstr "本地端口" + +msgid "Connection Timeout" +msgstr "连接超时" + +msgid "Password" +msgstr "密码" + +msgid "Encrypt Method" +msgstr "加密方式" + +msgid "Ignore List" +msgstr "忽略列表" + +msgid "UDP Relay" +msgstr "UDP中继" + +msgid "Relay Mode" +msgstr "中继模式" + +msgid "UDP Forward" +msgstr "UDP转发" + +msgid "UDP Local Port" +msgstr "UDP本地端口" + +msgid "Forwarding Tunnel" +msgstr "UDP转发地址" + +msgid "Access Control" +msgstr "访问控制" + +msgid "Allow listed only" +msgstr "仅允许列表内" + +msgid "Allow all except listed" +msgstr "仅允许列表外" + +msgid "LAN IP List" +msgstr "内网IP列表" + +msgid "Bypassed IP" +msgstr "被忽略的IP" + +msgid "Forwarded IP" +msgstr "走代理的IP" diff --git a/applications/luci-app-shadowsocks-libev/root/etc/uci-defaults/luci-shadowsocks-libev b/applications/luci-app-shadowsocks-libev/root/etc/uci-defaults/luci-shadowsocks-libev new file mode 100644 index 0000000000..6f30fa77b7 --- /dev/null +++ b/applications/luci-app-shadowsocks-libev/root/etc/uci-defaults/luci-shadowsocks-libev @@ -0,0 +1,11 @@ +#!/bin/sh + +uci -q batch <<-EOF >/dev/null + delete ucitrack.@shadowsocks-libev[-1] + add ucitrack shadowsocks-libev + set ucitrack.@shadowsocks-libev[-1].init=shadowsocks-libev + commit ucitrack +EOF + +rm -f /tmp/luci-indexcache +exit 0 diff --git a/applications/luci-app-splash/htdocs/cgi-bin/splash/splash.sh b/applications/luci-app-splash/htdocs/cgi-bin/splash/splash.sh index 76f6d4d3e4..da8370dafa 100755 --- a/applications/luci-app-splash/htdocs/cgi-bin/splash/splash.sh +++ b/applications/luci-app-splash/htdocs/cgi-bin/splash/splash.sh @@ -1,13 +1,11 @@ #!/bin/sh $(uci -q get luci_splash.general.redirect_url) || { - set -x touch /var/state/luci_splash_locations touch /etc/config/luci_splash_locations MAC=$(grep "$REMOTE_HOST" /proc/net/arp | awk '{print $4}') uci -P /var/state set luci_splash_locations.${MAC//:/}=redirect uci -P /var/state set luci_splash_locations.${MAC//:/}.location="http://${HTTP_HOST}${REQUEST_URI}" - set +x } echo -en "Cache-Control: no-cache, max-age=0, no-store, must-revalidate\r\n" diff --git a/applications/luci-app-statistics/luasrc/controller/luci_statistics/luci_statistics.lua b/applications/luci-app-statistics/luasrc/controller/luci_statistics/luci_statistics.lua index c532b4a6d3..49eab5acd4 100644 --- a/applications/luci-app-statistics/luasrc/controller/luci_statistics/luci_statistics.lua +++ b/applications/luci-app-statistics/luasrc/controller/luci_statistics/luci_statistics.lua @@ -30,6 +30,7 @@ function index() disk = _("Disk Usage"), dns = _("DNS"), email = _("Email"), + entropy = _("Entropy"), exec = _("Exec"), interface = _("Interfaces"), iptables = _("Firewall"), @@ -53,7 +54,7 @@ function index() -- our collectd menu local collectd_menu = { output = { "csv", "network", "rrdtool", "unixsock" }, - system = { "cpu", "df", "disk", "email", "exec", "irq", "load", "memory", "nut", "processes", "uptime" }, + system = { "cpu", "df", "disk", "email", "entropy", "exec", "irq", "load", "memory", "nut", "processes", "uptime" }, network = { "conntrack", "dns", "interface", "iptables", "netlink", "olsrd", "ping", "splash_leases", "tcpconns", "iwinfo" } } diff --git a/applications/luci-app-statistics/luasrc/model/cbi/luci_statistics/entropy.lua b/applications/luci-app-statistics/luasrc/model/cbi/luci_statistics/entropy.lua new file mode 100644 index 0000000000..d18bf910f9 --- /dev/null +++ b/applications/luci-app-statistics/luasrc/model/cbi/luci_statistics/entropy.lua @@ -0,0 +1,14 @@ +-- Copyright 2015 Hannu Nyman <hannu.nyman@iki.fi> +-- Licensed to the public under the Apache License 2.0. + +m = Map("luci_statistics", + translate("Entropy Plugin Configuration"), + translate("The entropy plugin collects statistics about the available entropy.")) + +s = m:section( NamedSection, "collectd_entropy", "luci_statistics" ) + +enable = s:option( Flag, "enable", translate("Enable this plugin") ) +enable.default = 0 + +return m + diff --git a/applications/luci-app-statistics/luasrc/statistics/rrdtool.lua b/applications/luci-app-statistics/luasrc/statistics/rrdtool.lua index 1f8f4ff88b..d8317a8177 100644 --- a/applications/luci-app-statistics/luasrc/statistics/rrdtool.lua +++ b/applications/luci-app-statistics/luasrc/statistics/rrdtool.lua @@ -457,6 +457,12 @@ function Graph._generic( self, opts, plugin, plugin_instance, dtype, index ) _ti ( _args, "-X" ) _ti ( _args, opts.units_exponent ) end + if opts.alt_autoscale then + _ti ( _args, "-A" ) + end + if opts.alt_autoscale_max then + _ti ( _args, "-M" ) + end -- store additional rrd options if opts.rrdopts then diff --git a/applications/luci-app-statistics/luasrc/statistics/rrdtool/definitions/conntrack.lua b/applications/luci-app-statistics/luasrc/statistics/rrdtool/definitions/conntrack.lua index ee3d68fe16..fbc47731ef 100644 --- a/applications/luci-app-statistics/luasrc/statistics/rrdtool/definitions/conntrack.lua +++ b/applications/luci-app-statistics/luasrc/statistics/rrdtool/definitions/conntrack.lua @@ -9,6 +9,10 @@ function rrdargs( graph, plugin, plugin_instance, dtype ) vlabel = "Count", number_format = "%5.0lf", data = { + -- collectd 5.5+: specify "" to exclude "max" instance + instances = { + conntrack = { "" } + }, sources = { conntrack = { "value" } }, diff --git a/applications/luci-app-statistics/luasrc/statistics/rrdtool/definitions/cpu.lua b/applications/luci-app-statistics/luasrc/statistics/rrdtool/definitions/cpu.lua index 1ca8a23ee9..ae0c0ce778 100644 --- a/applications/luci-app-statistics/luasrc/statistics/rrdtool/definitions/cpu.lua +++ b/applications/luci-app-statistics/luasrc/statistics/rrdtool/definitions/cpu.lua @@ -8,22 +8,23 @@ function rrdargs( graph, plugin, plugin_instance, dtype ) return { title = "%H: Processor usage on core #%pi", y_min = "0", + alt_autoscale_max = true, vlabel = "Percent", number_format = "%5.1lf%%", data = { instances = { - cpu = { "idle", "user", "system", "nice" } + cpu = { "user", "nice", "system", "softirq", "interrupt" } }, options = { - cpu_idle = { color = "ffffff" }, - cpu_nice = { color = "00e000" }, - cpu_user = { color = "0000ff" }, - cpu_wait = { color = "ffb000" }, - cpu_system = { color = "ff0000" }, - cpu_softirq = { color = "ff00ff" }, - cpu_interrupt = { color = "a000a0" }, - cpu_steal = { color = "000000" } + cpu_idle = { color = "ffffff", title = "Idle" }, + cpu_nice = { color = "00e000", title = "Nice" }, + cpu_user = { color = "0000ff", title = "User" }, + cpu_wait = { color = "ffb000", title = "Wait" }, + cpu_system = { color = "ff0000", title = "System" }, + cpu_softirq = { color = "ff00ff", title = "Softirq" }, + cpu_interrupt = { color = "a000a0", title = "Interrupt" }, + cpu_steal = { color = "000000", title = "Steal" } } } } diff --git a/applications/luci-app-statistics/luasrc/statistics/rrdtool/definitions/entropy.lua b/applications/luci-app-statistics/luasrc/statistics/rrdtool/definitions/entropy.lua new file mode 100644 index 0000000000..3d30a70afb --- /dev/null +++ b/applications/luci-app-statistics/luasrc/statistics/rrdtool/definitions/entropy.lua @@ -0,0 +1,19 @@ +-- Copyright 2015 Hannu Nyman <hannu.nyman@iki.fi> +-- Licensed to the public under the Apache License 2.0. + +module("luci.statistics.rrdtool.definitions.entropy", package.seeall) + +function rrdargs( graph, plugin, plugin_instance, dtype ) + + return { + title = "%H: Available entropy", + vlabel = "bits", + number_format = "%4.0lf", + data = { + types = { "entropy" }, + options = { entropy = { title = "Entropy %di" } } + } + } + +end + diff --git a/applications/luci-app-statistics/luasrc/statistics/rrdtool/definitions/memory.lua b/applications/luci-app-statistics/luasrc/statistics/rrdtool/definitions/memory.lua index a1c65f56d7..53d559c599 100644 --- a/applications/luci-app-statistics/luasrc/statistics/rrdtool/definitions/memory.lua +++ b/applications/luci-app-statistics/luasrc/statistics/rrdtool/definitions/memory.lua @@ -17,6 +17,8 @@ function rrdargs( graph, plugin, plugin_instance, dtype ) title = "%H: Memory usage", vlabel = "MB", number_format = "%5.1lf%s", + y_min = "0", + alt_autoscale_max = true, data = { instances = { memory = { "free", "buffered", "cached", "used" } diff --git a/applications/luci-app-statistics/luasrc/statistics/rrdtool/definitions/ping.lua b/applications/luci-app-statistics/luasrc/statistics/rrdtool/definitions/ping.lua index 1a72caf227..347d756f7c 100644 --- a/applications/luci-app-statistics/luasrc/statistics/rrdtool/definitions/ping.lua +++ b/applications/luci-app-statistics/luasrc/statistics/rrdtool/definitions/ping.lua @@ -9,7 +9,7 @@ function rrdargs( graph, plugin, plugin_instance, dtype ) { title = "%H: ICMP Round Trip Time", vlabel = "ms", number_format = "%5.1lf ms", data = { sources = { ping = { "value" } }, - options = { ping__ping = { noarea = true, title = "%di" } } + options = { ping__value = { noarea = true, title = "%di" } } } }, -- Ping droprate diff --git a/applications/luci-app-statistics/luasrc/view/admin_statistics/index.htm b/applications/luci-app-statistics/luasrc/view/admin_statistics/index.htm index 0000c1961e..0fb3d56375 100644 --- a/applications/luci-app-statistics/luasrc/view/admin_statistics/index.htm +++ b/applications/luci-app-statistics/luasrc/view/admin_statistics/index.htm @@ -8,7 +8,10 @@ <h2><a id="content" name="content"><%:Statistics%></a></h2> -<p><%_The statistics package is based on <a href="http://collectd.org/index.shtml">Collectd</a> -and uses <a href="http://oss.oetiker.ch/rrdtool/">RRD Tool</a> to render diagram images from collected data.%></p> +<p><%_The statistics package uses <a href="https://collectd.org/">Collectd</a> +to gather data and <a href="http://oss.oetiker.ch/rrdtool/">RRDtool</a> to +render diagram images.%></p> + +<p><%_You can install additional collectd-mod-* plugins to enable more statistics.%></p> <%+footer%> diff --git a/applications/luci-app-statistics/root/etc/config/luci_statistics b/applications/luci-app-statistics/root/etc/config/luci_statistics index e39db3513a..abcee3e938 100644 --- a/applications/luci-app-statistics/root/etc/config/luci_statistics +++ b/applications/luci-app-statistics/root/etc/config/luci_statistics @@ -1,143 +1,153 @@ -config 'statistics' 'rrdtool' - option 'default_timespan' '1hour' - option 'image_width' '600' - option 'image_path' '/tmp/rrdimg' - -config 'statistics' 'collectd' - option 'BaseDir' '/var/run/collectd' - option 'Include' '/etc/collectd/conf.d' - option 'PIDFile' '/var/run/collectd.pid' - option 'PluginDir' '/usr/lib/collectd' - option 'TypesDB' '/usr/share/collectd/types.db' - option 'Interval' '30' - option 'ReadThreads' '2' - -config 'statistics' 'collectd_ping' - option 'enable' '0' - option 'TTL' '127' - option 'Interval' '30' - option 'Hosts' '127.0.0.1' - -config 'statistics' 'collectd_csv' - option 'enable' '0' - option 'StoreRates' '0' - option 'DataDir' '/tmp' - -config 'statistics' 'collectd_df' - option 'enable' '0' - option 'Devices' '/dev/mtdblock/4' - option 'MountPoints' '/jffs' - option 'FSTypes' 'tmpfs' - option 'IgnoreSelected' '0' - -config 'statistics' 'collectd_disk' - option 'enable' '0' - option 'Disks' 'hda1 hdb' - option 'IgnoreSelected' '0' - -config 'statistics' 'collectd_dns' - option 'enable' '0' - option 'Interfaces' 'ffdhcp ff br-lan' - option 'IgnoreSources' '127.0.0.1' - -config 'statistics' 'collectd_email' - option 'enable' '0' - option 'SocketFile' '/var/run/collectd/email.sock' - option 'SocketGroup' 'nogroup' - -config 'statistics' 'collectd_exec' - option 'enable' '0' - -config 'statistics' 'collectd_interface' - option 'enable' '1' - option 'Interfaces' 'br-lan br-ff' - option 'IgnoreSelected' '0' - -config 'statistics' 'collectd_iptables' - option 'enable' '1' - -config 'collectd_iptables_match' - option 'table' 'nat' - option 'chain' 'luci_fw_postrouting' - option 'target' 'MASQUERADE' - option 'source' '192.168.1.0/24' - option 'outputif' 'br-ff' - option 'name' 'Verkehr LAN-Clients' - -config 'collectd_iptables_match' - option 'chain' 'luci_fw_postrouting' - option 'table' 'nat' - option 'target' 'MASQUERADE' - option 'source' '10.61.230.0/24' - option 'outputif' 'br-ff' - option 'name' 'Verkehr WLAN-Clients' - -config 'statistics' 'collectd_irq' - option 'enable' '0' - option 'Irqs' '2 3 4 7' - -config 'statistics' 'collectd_load' - option 'enable' '1' - -config 'statistics' 'collectd_logfile' - option 'enable' '0' - option 'LogLevel' 'notice' - option 'File' '/var/log/collectd.log' - option 'Timestamp' '1' - -config 'statistics' 'collectd_netlink' - option 'enable' '0' - option 'IgnoreSelected' '0' - option 'VerboseInterfaces' 'br-lan br-ff' - option 'QDiscs' 'br-lan br-ff' - -config 'statistics' 'collectd_network' - option 'enable' '0' - -config 'statistics' 'collectd_processes' - option 'enable' '1' - option 'Processes' 'uhttpd dnsmasq dropbear' - -config statistics 'collectd_splash_leases' - option enable '1' - -config 'statistics' 'collectd_tcpconns' - option 'enable' '1' - option 'ListeningPorts' '0' - option 'LocalPorts' '22 80' - -config 'statistics' 'collectd_unixsock' - option 'enable' '0' - option 'SocketFile' '/var/run/collectd/query.sock' - option 'SocketGroup' 'nogroup' - -config 'statistics' 'collectd_cpu' - option 'enable' '1' - -config 'statistics' 'collectd_rrdtool' - option 'enable' '1' - option 'DataDir' '/tmp/rrd' - option 'RRARows' '100' - option 'RRASingle' '1' - option 'RRATimespans' '1hour 1day 1week 1month 1year' - -config 'statistics' 'collectd_memory' - option 'enable' '1' - -config 'statistics' 'collectd_conntrack' - option 'enable' '1' - -config 'statistics' 'collectd_olsrd' - option 'enable' '1' - option 'Port' '2006' - option 'Host' '127.0.0.1' - -config 'statistics' 'collectd_iwinfo' - option 'enable' '1' - -config 'statistics' 'collectd_nut' - option 'enable' '0' - option 'UPS' 'myupsname' - -config 'statistics' 'collectd_uptime' - option 'enable' '1' +# general settings + +config statistics 'collectd' + option BaseDir '/var/run/collectd' + option Include '/etc/collectd/conf.d' + option PIDFile '/var/run/collectd.pid' + option PluginDir '/usr/lib/collectd' + option TypesDB '/usr/share/collectd/types.db' + option Interval '30' + option ReadThreads '2' + +config statistics 'rrdtool' + option default_timespan '1hour' + option image_width '600' + option image_path '/tmp/rrdimg' + +# output plugins + +config statistics 'collectd_rrdtool' + option enable '1' + option DataDir '/tmp/rrd' + option RRARows '100' + option RRASingle '1' + option RRATimespans '1hour 1day 1week 1month 1year' + +config statistics 'collectd_csv' + option enable '0' + option StoreRates '0' + option DataDir '/tmp' + +config statistics 'collectd_email' + option enable '0' + option SocketFile '/var/run/collectd/email.sock' + option SocketGroup 'nogroup' + +config statistics 'collectd_logfile' + option enable '0' + option LogLevel 'notice' + option File '/var/log/collectd.log' + option Timestamp '1' + +config statistics 'collectd_network' + option enable '0' + +config statistics 'collectd_unixsock' + option enable '0' + option SocketFile '/var/run/collectd/query.sock' + option SocketGroup 'nogroup' + +# input plugins + +config statistics 'collectd_conntrack' + option enable '0' + +config statistics 'collectd_cpu' + option enable '0' + +config statistics 'collectd_df' + option enable '0' + option Devices '/dev/mtdblock/4' + option MountPoints '/jffs' + option FSTypes 'tmpfs' + option IgnoreSelected '0' + +config statistics 'collectd_disk' + option enable '0' + option Disks 'hda1 hdb' + option IgnoreSelected '0' + +config statistics 'collectd_dns' + option enable '0' + option Interfaces 'br-lan' + option IgnoreSources '127.0.0.1' + +config statistics 'collectd_entropy' + option enable '0' + +config statistics 'collectd_exec' + option enable '0' + +config statistics 'collectd_interface' + option enable '1' + option Interfaces 'br-lan' + option IgnoreSelected '0' + +config statistics 'collectd_iptables' + option enable '0' + +config collectd_iptables_match + option table 'nat' + option chain 'luci_fw_postrouting' + option target 'MASQUERADE' + option source '192.168.1.0/24' + option outputif 'br-ff' + option name 'LAN-Clients traffic' + +config collectd_iptables_match + option chain 'luci_fw_postrouting' + option table 'nat' + option target 'MASQUERADE' + option source '10.61.230.0/24' + option outputif 'br-ff' + option name 'WLAN-Clients traffic' + +config statistics 'collectd_irq' + option enable '0' + option Irqs '2 3 4 7' + +config statistics 'collectd_iwinfo' + option enable '1' + +config statistics 'collectd_load' + option enable '1' + +config statistics 'collectd_memory' + option enable '0' + +config statistics 'collectd_netlink' + option enable '0' + option IgnoreSelected '0' + option VerboseInterfaces 'br-lan' + option QDiscs 'br-lan' + +config statistics 'collectd_nut' + option enable '0' + option UPS 'myupsname' + +config statistics 'collectd_olsrd' + option enable '0' + option Port '2006' + option Host '127.0.0.1' + +config statistics 'collectd_ping' + option enable '0' + option TTL '127' + option Interval '30' + option Hosts '127.0.0.1' + +config statistics 'collectd_processes' + option enable '0' + option Processes 'uhttpd dnsmasq dropbear' + +config statistics 'collectd_splash_leases' + option enable '0' + +config statistics 'collectd_tcpconns' + option enable '0' + option ListeningPorts '0' + option LocalPorts '22 80' + +config statistics 'collectd_uptime' + option enable '0' + diff --git a/applications/luci-app-statistics/root/etc/init.d/luci_statistics b/applications/luci-app-statistics/root/etc/init.d/luci_statistics index 936f3a63c3..ab75b69df0 100755 --- a/applications/luci-app-statistics/root/etc/init.d/luci_statistics +++ b/applications/luci-app-statistics/root/etc/init.d/luci_statistics @@ -3,23 +3,15 @@ START=79 start() { ### replace shipped config with symlink + mkdir -p /var/etc if [ ! -L /etc/collectd.conf ]; then test -f /etc/collectd.conf && mv /etc/collectd.conf /etc/collectd.conf.bak ln -s /var/etc/collectd.conf /etc/collectd.conf fi ### create config - mkdir -p /var/etc /usr/bin/stat-genconfig > /var/etc/collectd.conf - ### prepare rrdimg directory - if [ -f /etc/config/lucid ] && [ -x /etc/init.d/lucid ] && /etc/init.d/lucid enabled && \ - [ "$(uci get luci_statistics.rrdtool.image_path 2>/dev/null)" != "$(uci get lucid.statistics.physical 2>/dev/null)" ]; then - uci set lucid.statistics.physical=$(uci get luci_statistics.rrdtool.image_path) - uci commit lucid - /etc/init.d/lucid restart - fi - ### workaround broken permissions on /tmp chmod 1777 /tmp } diff --git a/applications/luci-app-statistics/root/etc/uci-defaults/luci-statistics b/applications/luci-app-statistics/root/etc/uci-defaults/luci-statistics index e94a8637c8..28e35298a2 100755 --- a/applications/luci-app-statistics/root/etc/uci-defaults/luci-statistics +++ b/applications/luci-app-statistics/root/etc/uci-defaults/luci-statistics @@ -8,29 +8,9 @@ uci -q batch <<-EOF >/dev/null commit ucitrack EOF -# register LuCId virtual path handler -[ -f /etc/config/lucid ] && \ -uci -q batch <<-EOF >/dev/null - delete lucid.statistics - - set lucid.statistics=DirectoryPublisher - set lucid.statistics.name='RRDTool Image Cache' - set lucid.statistics.physical=/tmp/rrdimg - set lucid.statistics.virtual=/rrdimg - set lucid.statistics.domain='' - - add_list lucid.http.publisher=statistics - add_list lucid.https.publisher=statistics - - commit lucid -EOF - # symlink for busybox httpd [ -x /usr/sbin/httpd ] && [ ! -h /www/rrdimg ] && \ ln -s /tmp/rrdimg /www/rrdimg -# restart LuCId service -[ -x /etc/init.d/lucid ] && /etc/init.d/lucid enabled && /etc/init.d/lucid restart - rm -f /tmp/luci-indexcache exit 0 diff --git a/applications/luci-app-statistics/root/usr/bin/stat-genconfig b/applications/luci-app-statistics/root/usr/bin/stat-genconfig index cb94e28118..8acae46c61 100755 --- a/applications/luci-app-statistics/root/usr/bin/stat-genconfig +++ b/applications/luci-app-statistics/root/usr/bin/stat-genconfig @@ -303,6 +303,12 @@ plugins = { { } }, + entropy = { + { }, + { }, + { } + }, + exec = config_exec, interface = { diff --git a/applications/luci-app-upnp/root/etc/uci-defaults/luci-upnp b/applications/luci-app-upnp/root/etc/uci-defaults/luci-upnp deleted file mode 100755 index fe22a3e3c1..0000000000 --- a/applications/luci-app-upnp/root/etc/uci-defaults/luci-upnp +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/sh - -/etc/init.d/miniupnpd enabled && { - /etc/init.d/miniupnpd stop - /etc/init.d/miniupnpd disable -} - -rm -f /tmp/luci-indexcache -exit 0 diff --git a/applications/luci-app-vnstat/luasrc/view/vnstat.htm b/applications/luci-app-vnstat/luasrc/view/vnstat.htm index cfa1a5de51..2b502559b8 100644 --- a/applications/luci-app-vnstat/luasrc/view/vnstat.htm +++ b/applications/luci-app-vnstat/luasrc/view/vnstat.htm @@ -22,7 +22,7 @@ style = (style and #style > 0) and style or "s" -- if iface then style = style:gsub("[^%w]", "") - iface = iface:gsub("[^%w%.%-]", "") + iface = iface:gsub("[^%w%.%-%_]", "") luci.http.prepare_content("image/png") |