banip: update nginx matching 17137/head
authorOskari Rauta <oskari.rauta@gmail.com>
Mon, 15 Nov 2021 23:15:05 +0000 (01:15 +0200)
committerOskari Rauta <oskari.rauta@gmail.com>
Fri, 3 Dec 2021 03:15:00 +0000 (05:15 +0200)
Currently banip matches nginx log entries starting with
nginx[number]:...

I am running a containerized nginx with alpine as base, which
ends up adding log entries without [number] part..
like this:
nginx:...

This patch updates regex for nginx log entry search to include
both versions.

Signed-off-by: Oskari Rauta <oskari.rauta@gmail.com>
net/banip/Makefile
net/banip/files/banip.sh

index ca159c3ed018511a7c735fbc571aa3fc168a3cab..c210c96a53ce4b6b3c41f9c28002f8d3338b5213 100644 (file)
@@ -7,7 +7,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=banip
 PKG_VERSION:=0.7.10
-PKG_RELEASE:=3
+PKG_RELEASE:=4
 PKG_LICENSE:=GPL-3.0-or-later
 PKG_MAINTAINER:=Dirk Brenken <dev@brenken.org>
 
index 34ebe5e46bf8891a226368dc548d0c1445878221..8672ead225e0fed7062e201bca28bfa7772b8ab1 100755 (executable)
@@ -813,7 +813,7 @@ f_bgsrv() {
                        ban_search="${ban_search}luci: failed login|"
                fi
                if printf "%s\n" "${ban_logterms}" | grep -q "nginx"; then
-                       ban_search="${ban_search}nginx\[[0-9]+\]:.*\[error\].*open().*client: [[:alnum:].:]+|"
+                       ban_search="${ban_search}nginx(\[[0-9]+\])?:.*\[error\].*open().*client: [[:alnum:].:]+|"
                fi
                (
                        "${ban_logservice}" "${ban_search%?}" &