mirror of
https://github.com/openwrt/luci.git
synced 2026-04-15 10:51:51 +00:00
luci-app-banip: release 1.8.5-1
* sync with base package Signed-off-by: Dirk Brenken <dev@brenken.org>
This commit is contained in:
@@ -6,8 +6,8 @@ include $(TOPDIR)/rules.mk
|
|||||||
LUCI_TITLE:=LuCI support for banIP
|
LUCI_TITLE:=LuCI support for banIP
|
||||||
LUCI_DEPENDS:=+luci-base +banip
|
LUCI_DEPENDS:=+luci-base +banip
|
||||||
|
|
||||||
PKG_VERSION:=1.8.1
|
PKG_VERSION:=1.8.5
|
||||||
PKG_RELEASE:=3
|
PKG_RELEASE:=1
|
||||||
PKG_LICENSE:=Apache-2.0
|
PKG_LICENSE:=Apache-2.0
|
||||||
PKG_MAINTAINER:=Dirk Brenken <dev@brenken.org>
|
PKG_MAINTAINER:=Dirk Brenken <dev@brenken.org>
|
||||||
|
|
||||||
|
|||||||
@@ -232,7 +232,7 @@ return view.extend({
|
|||||||
|
|
||||||
o = s.option(form.Value, 'rule', _('Rule'));
|
o = s.option(form.Value, 'rule', _('Rule'));
|
||||||
o.value('feed 1', _('<IP-Address>'));
|
o.value('feed 1', _('<IP-Address>'));
|
||||||
o.value('feed 1 ,', _('<IP-Address><CSV-Seperator>'));
|
o.value('feed 1 ,', _('<IP-Address><CSV-Separator>'));
|
||||||
o.value('feed 13', _('<IP-Address><Space><Netmask>'));
|
o.value('feed 13', _('<IP-Address><Space><Netmask>'));
|
||||||
o.value('suricata 1', _('<Suricata Syntax>'));
|
o.value('suricata 1', _('<Suricata Syntax>'));
|
||||||
o.optional = true;
|
o.optional = true;
|
||||||
|
|||||||
@@ -62,11 +62,16 @@ return view.extend({
|
|||||||
*/
|
*/
|
||||||
let parseErrCount = 0;
|
let parseErrCount = 0;
|
||||||
poll.add(function () {
|
poll.add(function () {
|
||||||
return L.resolveDefault(fs.stat('/var/run/banip_runtime.json'), null).then(function (stat) {
|
return L.resolveDefault(fs.stat('/var/run/banIP/banIP_runtime.json'), null).then(function (stat) {
|
||||||
if (!stat) {
|
if (!stat) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
return L.resolveDefault(fs.read_direct('/var/run/banip_runtime.json'), 'null').then(function (res) {
|
return Promise.all([
|
||||||
|
L.resolveDefault(fs.read_direct('/var/run/banIP/banIP_runtime.json'), 'null'),
|
||||||
|
L.resolveDefault(fs.exec_direct('/etc/init.d/banip', ['actual']), '')
|
||||||
|
]).then(function (results) {
|
||||||
|
const res = results[0];
|
||||||
|
const actual = results[1]?.trim() || '';
|
||||||
const status = document.getElementById('status');
|
const status = document.getElementById('status');
|
||||||
const buttons = document.querySelectorAll('.cbi-page-actions button');
|
const buttons = document.querySelectorAll('.cbi-page-actions button');
|
||||||
let info = null;
|
let info = null;
|
||||||
@@ -90,7 +95,12 @@ return view.extend({
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (status && info) {
|
if (status && info) {
|
||||||
status.textContent = `${info.status || '-'} (frontend: ${info.frontend_ver || '-'} / backend: ${info.backend_ver || '-'})`;
|
let statusText = info.status || '-';
|
||||||
|
if (actual) {
|
||||||
|
statusText += `: ${actual}`;
|
||||||
|
}
|
||||||
|
statusText += ` (frontend: ${info.frontend_ver || '-'} / backend: ${info.backend_ver || '-'})`;
|
||||||
|
status.textContent = statusText;
|
||||||
if (info.status === "processing") {
|
if (info.status === "processing") {
|
||||||
buttons.forEach(function (btn) {
|
buttons.forEach(function (btn) {
|
||||||
btn.disabled = true;
|
btn.disabled = true;
|
||||||
@@ -597,9 +607,9 @@ return view.extend({
|
|||||||
o.value('error: maximum authentication attempts exceeded', _('sshd failed login'));
|
o.value('error: maximum authentication attempts exceeded', _('sshd failed login'));
|
||||||
o.value('sshd.*Connection closed by.*\\[preauth\\]', _('sshd closed connection'));
|
o.value('sshd.*Connection closed by.*\\[preauth\\]', _('sshd closed connection'));
|
||||||
o.value('SecurityEvent=\\"InvalidAccountID\\".*RemoteAddress=', _('asterisk invalid account'));
|
o.value('SecurityEvent=\\"InvalidAccountID\\".*RemoteAddress=', _('asterisk invalid account'));
|
||||||
o.value('received a suspicious remote IP .*', _('nginx suspicious IP'));
|
|
||||||
o.value('TLS Error: could not determine wrapping from \\[AF_INET\\]', _('openvpn TLS error'));
|
o.value('TLS Error: could not determine wrapping from \\[AF_INET\\]', _('openvpn TLS error'));
|
||||||
o.value('AdGuardHome.*\\[error\\].*/control/login: from ip', _('AdGuardHome login error'));
|
o.value('AdGuardHome.*\\[error\\].*/control/login: from ip', _('AdGuardHome login error'));
|
||||||
|
o.value('received a suspicious remote IP', _('Remote logging Event'));
|
||||||
o.placeholder = _('-- Please choose (optional) --');
|
o.placeholder = _('-- Please choose (optional) --');
|
||||||
o.optional = true;
|
o.optional = true;
|
||||||
o.rmempty = true;
|
o.rmempty = true;
|
||||||
|
|||||||
@@ -53,12 +53,12 @@ function handleAction(report, ev) {
|
|||||||
clearInterval(window._banipPoller);
|
clearInterval(window._banipPoller);
|
||||||
window._banipPoller = null;
|
window._banipPoller = null;
|
||||||
}
|
}
|
||||||
L.resolveDefault(fs.write('/var/run/banIP.search', ''), '').then(function () {
|
L.resolveDefault(fs.write('/var/run/banIP/banIP.search', ''), '').then(function () {
|
||||||
L.resolveDefault(fs.exec_direct('/etc/init.d/banip', ['search', ip]), '').then(function () {
|
L.resolveDefault(fs.exec_direct('/etc/init.d/banip', ['search', ip]), '').then(function () {
|
||||||
let attempts = 0;
|
let attempts = 0;
|
||||||
window._banipPoller = setInterval(function () {
|
window._banipPoller = setInterval(function () {
|
||||||
attempts++;
|
attempts++;
|
||||||
L.resolveDefault(fs.read('/var/run/banIP.search'), '').then(function (res) {
|
L.resolveDefault(fs.read('/var/run/banIP/banIP.search'), '').then(function (res) {
|
||||||
if (res && res.trim()) {
|
if (res && res.trim()) {
|
||||||
clearInterval(window._banipPoller);
|
clearInterval(window._banipPoller);
|
||||||
window._banipPoller = null;
|
window._banipPoller = null;
|
||||||
@@ -359,12 +359,12 @@ return view.extend({
|
|||||||
});
|
});
|
||||||
btn.blur();
|
btn.blur();
|
||||||
btn.classList.add('spinning');
|
btn.classList.add('spinning');
|
||||||
L.resolveDefault(fs.write('/var/run/banIP.report', ''), '').then(function () {
|
L.resolveDefault(fs.write('/var/run/banIP/banIP.report', ''), '').then(function () {
|
||||||
L.resolveDefault(fs.exec_direct('/etc/init.d/banip', ['report', 'gen']), '');
|
L.resolveDefault(fs.exec_direct('/etc/init.d/banip', ['report', 'gen']), '');
|
||||||
let attempts = 0;
|
let attempts = 0;
|
||||||
let poller = setInterval(function () {
|
let poller = setInterval(function () {
|
||||||
attempts++;
|
attempts++;
|
||||||
L.resolveDefault(fs.read('/var/run/banIP.report'), '').then(function (res) {
|
L.resolveDefault(fs.read('/var/run/banIP/banIP.report'), '').then(function (res) {
|
||||||
if (res && res.trim()) {
|
if (res && res.trim()) {
|
||||||
clearInterval(poller);
|
clearInterval(poller);
|
||||||
location.reload();
|
location.reload();
|
||||||
|
|||||||
@@ -21,11 +21,11 @@
|
|||||||
"read",
|
"read",
|
||||||
"write"
|
"write"
|
||||||
],
|
],
|
||||||
"/var/run/banIP.search": [
|
"/var/run/banIP/banIP.search": [
|
||||||
"read",
|
"read",
|
||||||
"write"
|
"write"
|
||||||
],
|
],
|
||||||
"/var/run/banIP.report": [
|
"/var/run/banIP/banIP.report": [
|
||||||
"read",
|
"read",
|
||||||
"write"
|
"write"
|
||||||
]
|
]
|
||||||
@@ -36,10 +36,10 @@
|
|||||||
"exec"
|
"exec"
|
||||||
],
|
],
|
||||||
"file": {
|
"file": {
|
||||||
"/var/run/banip.lock": [
|
"/var/run/banIP/banIP.lock": [
|
||||||
"read"
|
"read"
|
||||||
],
|
],
|
||||||
"/var/run/banip_runtime.json": [
|
"/var/run/banIP/banIP_runtime.json": [
|
||||||
"read"
|
"read"
|
||||||
],
|
],
|
||||||
"/usr/sbin/nft -tj list sets": [
|
"/usr/sbin/nft -tj list sets": [
|
||||||
@@ -54,6 +54,9 @@
|
|||||||
"/etc/init.d/banip restart": [
|
"/etc/init.d/banip restart": [
|
||||||
"exec"
|
"exec"
|
||||||
],
|
],
|
||||||
|
"/etc/init.d/banip actual": [
|
||||||
|
"exec"
|
||||||
|
],
|
||||||
"/etc/init.d/banip report json": [
|
"/etc/init.d/banip report json": [
|
||||||
"exec"
|
"exec"
|
||||||
],
|
],
|
||||||
|
|||||||
Reference in New Issue
Block a user