From 8d2b0ad9eb5270486f029ee1c416cfaf47a5ff52 Mon Sep 17 00:00:00 2001 From: Dirk Brenken Date: Fri, 4 Oct 2019 09:21:11 +0200 Subject: [PATCH] luci-app-banip: sync with banIP 0.3.0 * see package PR for details Signed-off-by: Dirk Brenken (cherry picked from commit 8343e58d7fb94bddb3fa5fb5308b1344021710c0) --- .../luasrc/model/cbi/banip/overview_tab.lua | 52 +++++++++++-------- .../luasrc/view/banip/runtime.htm | 4 +- 2 files changed, 31 insertions(+), 25 deletions(-) diff --git a/applications/luci-app-banip/luasrc/model/cbi/banip/overview_tab.lua b/applications/luci-app-banip/luasrc/model/cbi/banip/overview_tab.lua index 9ce6703a4..4302f8606 100644 --- a/applications/luci-app-banip/luasrc/model/cbi/banip/overview_tab.lua +++ b/applications/luci-app-banip/luasrc/model/cbi/banip/overview_tab.lua @@ -25,8 +25,8 @@ o2 = s:option(Flag, "ban_automatic", translate("Automatic WAN Interface Detectio o2.default = o2.enabled o2.rmempty = false -o3 = s:option(MultiValue, "ban_iface", translate("Interface Selection"), - translate("Disable the automatic WAN detection and select your preferred interface(s) manually.")) +o3 = s:option(MultiValue, "ban_iface", translate("Manual WAN Interface Selection"), + translate("Select your preferred interface(s) manually.")) if dump then local i, v for i, v in ipairs(dump.interface) do @@ -36,18 +36,16 @@ if dump then end end end +o3:depends("ban_automatic", 0) o3.widget = "checkbox" -o3.rmempty = false - -o4 = s:option(ListValue, "ban_fetchutil", translate("Download Utility"), - translate("List of supported and fully pre-configured download utilities.")) -o4:value("uclient-fetch") -o4:value("wget") -o4:value("curl") -o4:value("aria2c") -o4.default = "uclient-fetch" +o3.rmempty = true + +o4 = s:option(Flag, "ban_realtime", translate("SSH/LuCI RT Monitor"), + translate("Starts a small log/banIP monitor in the background to block SSH/LuCI brute force attacks in realtime.")) +o4.enabled = "true" +o4.default = o4.disabled o4.rmempty = false - + -- Runtime Information ds = s:option(DummyValue, "_dummy") @@ -125,23 +123,31 @@ e7.rmempty = true -- Optional Extra Options -e20 = e:option(Value, "ban_triggerdelay", translate("Trigger Delay"), - translate("Additional trigger delay in seconds before banIP processing begins.")) -e20.default = 2 -e20.datatype = "range(1,60)" +e20 = e:option(ListValue, "ban_fetchutil", translate("Download Utility"), + translate("Select your preferred download utility.")) +e20:value("uclient-fetch") +e20:value("wget") +e20:value("curl") +e20:value("aria2c") e20.optional = true -e21 = e:option(ListValue, "ban_starttype", translate("Start Type"), - translate("Select the used start type during boot.")) -e21:value("start") -e21:value("reload") -e21.default = "start" +e21 = e:option(Value, "ban_fetchparm", translate("Download Options"), + translate("Special options for the selected download utility, e.g. '--timeout=20 -O'.")) e21.optional = true -e22 = e:option(Value, "ban_fetchparm", translate("Download Options"), - translate("Special options for the selected download utility, e.g. '--timeout=20 --no-check-certificate -O'.")) +e22 = e:option(Value, "ban_triggerdelay", translate("Trigger Delay"), + translate("Additional trigger delay in seconds before banIP processing begins.")) +e22.default = 2 +e22.datatype = "range(1,60)" e22.optional = true +e23 = e:option(ListValue, "ban_starttype", translate("Start Type"), + translate("Select the used start type during boot.")) +e23:value("start") +e23:value("reload") +e23.default = "start" +e23.optional = true + e30 = e:option(Value, "ban_wan_input_chain", translate("WAN Input Chain IPv4")) e30.default = "input_wan_rule" e30.datatype = "uciname" diff --git a/applications/luci-app-banip/luasrc/view/banip/runtime.htm b/applications/luci-app-banip/luasrc/view/banip/runtime.htm index 44682206b..f96b23dc8 100644 --- a/applications/luci-app-banip/luasrc/view/banip/runtime.htm +++ b/applications/luci-app-banip/luasrc/view/banip/runtime.htm @@ -32,7 +32,7 @@ This is free software, licensed under the Apache License, Version 2.0 input = json.data.version; view.innerHTML = input || "-"; view = document.getElementById("value_3"); - input = json.data.fetch_info; + input = json.data.util_info; view.innerHTML = input || "-"; view = document.getElementById("value_4"); input = json.data.ipset_info; @@ -123,7 +123,7 @@ function btn_action(action)
- +
-
-- 2.25.1