diff options
Diffstat (limited to 'applications')
-rw-r--r-- | applications/luci-app-ddns/Makefile | 2 | ||||
-rw-r--r-- | applications/luci-app-ddns/luasrc/tools/ddns.lua | 39 | ||||
-rw-r--r-- | applications/luci-app-fwknopd/root/etc/uci-defaults/luci-fwknopd | 12 | ||||
-rw-r--r-- | applications/luci-app-olsr/luasrc/controller/olsr.lua | 16 | ||||
-rw-r--r-- | applications/luci-app-olsr/luasrc/view/status-olsr/overview.htm | 37 | ||||
-rw-r--r-- | applications/luci-app-privoxy/Makefile | 2 | ||||
-rw-r--r--[-rwxr-xr-x] | applications/luci-app-privoxy/luasrc/controller/privoxy.lua | 41 | ||||
-rw-r--r--[-rwxr-xr-x] | applications/luci-app-privoxy/luasrc/model/cbi/privoxy.lua | 1 | ||||
-rw-r--r--[-rwxr-xr-x] | applications/luci-app-privoxy/luasrc/view/privoxy/detail_logview.htm | 0 | ||||
-rw-r--r-- | applications/luci-app-qos/luasrc/model/cbi/qos/qos.lua | 19 | ||||
-rw-r--r-- | applications/luci-app-radicale/Makefile | 2 | ||||
-rw-r--r--[-rwxr-xr-x] | applications/luci-app-radicale/luasrc/controller/radicale.lua | 41 | ||||
-rw-r--r--[-rwxr-xr-x] | applications/luci-app-radicale/luasrc/model/cbi/radicale.lua | 0 | ||||
-rwxr-xr-x | applications/luci-app-splash/htdocs/cgi-bin/splash/splash.sh | 2 |
14 files changed, 80 insertions, 134 deletions
diff --git a/applications/luci-app-ddns/Makefile b/applications/luci-app-ddns/Makefile index a2d2ae947..0e1e5df4c 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 6d5393146..4466063cb 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-fwknopd/root/etc/uci-defaults/luci-fwknopd b/applications/luci-app-fwknopd/root/etc/uci-defaults/luci-fwknopd index a7c433f2b..689bedcd1 100644 --- a/applications/luci-app-fwknopd/root/etc/uci-defaults/luci-fwknopd +++ b/applications/luci-app-fwknopd/root/etc/uci-defaults/luci-fwknopd @@ -8,12 +8,10 @@ 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 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 commit fwknopd rm -f /tmp/luci-indexcache exit 0 diff --git a/applications/luci-app-olsr/luasrc/controller/olsr.lua b/applications/luci-app-olsr/luasrc/controller/olsr.lua index 74deb716c..cfadd9b7c 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 0a81d17b4..fa3231528 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-privoxy/Makefile b/applications/luci-app-privoxy/Makefile index bc2c57ee9..3d87a417f 100644 --- a/applications/luci-app-privoxy/Makefile +++ b/applications/luci-app-privoxy/Makefile @@ -10,7 +10,7 @@ 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 diff --git a/applications/luci-app-privoxy/luasrc/controller/privoxy.lua b/applications/luci-app-privoxy/luasrc/controller/privoxy.lua index 9ffc404ce..58ba80724 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 c009313e3..c415f8e06 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 3e190709f..3e190709f 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-qos/luasrc/model/cbi/qos/qos.lua b/applications/luci-app-qos/luasrc/model/cbi/qos/qos.lua index 99a884f86..a8ea57e31 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 07998aee5..960618dba 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 662c60d5a..d384b00d9 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 8abb68869..8abb68869 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-splash/htdocs/cgi-bin/splash/splash.sh b/applications/luci-app-splash/htdocs/cgi-bin/splash/splash.sh index 76f6d4d3e..da8370daf 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" |