git: 858c9f19409a - main - security/crowdsec: update to 1.6.3

From: Alexander Leidinger <netchild_at_FreeBSD.org>
Date: Wed, 18 Sep 2024 16:58:04 UTC
The branch main has been updated by netchild:

URL: https://cgit.FreeBSD.org/ports/commit/?id=858c9f19409af3496757ff8c02f46635744caa8a

commit 858c9f19409af3496757ff8c02f46635744caa8a
Author:     marco <marco@crowdsec.net>
AuthorDate: 2024-09-18 16:57:25 +0000
Commit:     Alexander Leidinger <netchild@FreeBSD.org>
CommitDate: 2024-09-18 16:58:01 +0000

    security/crowdsec: update to 1.6.3
    
    PR:             281454
---
 security/crowdsec/Makefile          |  7 ++-----
 security/crowdsec/distinfo          | 10 +++++-----
 security/crowdsec/files/crowdsec.in | 14 +++++++++++---
 3 files changed, 18 insertions(+), 13 deletions(-)

diff --git a/security/crowdsec/Makefile b/security/crowdsec/Makefile
index e9a2217fd982..538e98c54a04 100644
--- a/security/crowdsec/Makefile
+++ b/security/crowdsec/Makefile
@@ -1,9 +1,6 @@
 PORTNAME=	crowdsec
 DISTVERSIONPREFIX=	v
-DISTVERSION=	1.6.2
-# the remote tag was moved for 1.6.2, so we force another tag to avoid the version on proxy.golang.org
-DISTVERSIONSUFFIX=     -final
-PORTREVISION=	4
+DISTVERSION=	1.6.3
 CATEGORIES=	security
 
 MAINTAINER=	marco@crowdsec.net
@@ -17,7 +14,7 @@ LIB_DEPENDS=	libabsl_base.so:devel/abseil \
 		libre2.so:devel/re2
 
 USES=		go:1.22,modules pkgconfig
-_COMMIT=	16bfab86
+_COMMIT=	4851945a
 _BUILD_DATE=	$$(date -u "+%F_%T")
 USE_RC_SUBR=	crowdsec
 
diff --git a/security/crowdsec/distinfo b/security/crowdsec/distinfo
index fc31557d4e7f..4477491deabe 100644
--- a/security/crowdsec/distinfo
+++ b/security/crowdsec/distinfo
@@ -1,5 +1,5 @@
-TIMESTAMP = 1717420493
-SHA256 (go/security_crowdsec/crowdsec-v1.6.2-final/v1.6.2-final.mod) = 0cd8f4a237f0901164c8d80fa76c6bc7354054e867c7719c9691f4e5ae4b4a31
-SIZE (go/security_crowdsec/crowdsec-v1.6.2-final/v1.6.2-final.mod) = 10156
-SHA256 (go/security_crowdsec/crowdsec-v1.6.2-final/v1.6.2-final.zip) = e07898b78bd6ff09a1913b7cb8f69b6c3dd3c2add5b4554cc5b8084c91eb96ff
-SIZE (go/security_crowdsec/crowdsec-v1.6.2-final/v1.6.2-final.zip) = 1505724
+TIMESTAMP = 1725967354
+SHA256 (go/security_crowdsec/crowdsec-v1.6.3/v1.6.3.mod) = d47b370bc889d0484778cfbfc610b4254d6724455fb57f1fc6b3cb080d2343cd
+SIZE (go/security_crowdsec/crowdsec-v1.6.3/v1.6.3.mod) = 10157
+SHA256 (go/security_crowdsec/crowdsec-v1.6.3/v1.6.3.zip) = 9be326fa2feb5efc612a23c7309e4b6e3ca697876dbde1555c7e578f099c3eac
+SIZE (go/security_crowdsec/crowdsec-v1.6.3/v1.6.3.zip) = 1581062
diff --git a/security/crowdsec/files/crowdsec.in b/security/crowdsec/files/crowdsec.in
index ba0a40a19250..42abf1d829eb 100644
--- a/security/crowdsec/files/crowdsec.in
+++ b/security/crowdsec/files/crowdsec.in
@@ -42,6 +42,10 @@ stop_precmd="${name}_stop_precmd"
 stop_postcmd="${name}_stop_postcmd"
 extra_commands="configtest reload"
 
+# If the crowdsec process was not started or is in a fail loop due to misconfiguration,
+# the TERM signal is not enough to terminate /usr/sbin/daemon.
+sig_stop="INT"
+
 crowdsec_stop_precmd() {
     # take note of the pid, because sbin/daemon will remove the file
     # without waiting for crowdsec to exit
@@ -84,9 +88,13 @@ crowdsec_precmd() {
         fi
     fi
 
-    # install the collection for the first time, or if it has been removed
-    cs_cli collections inspect crowdsecurity/freebsd --no-metrics 2>/dev/null | grep ^installed | grep -q true || \
-        cs_cli collections install crowdsecurity/freebsd || :
+    # If the hub is empty, install the freebsd collection and the private ip whitelist.
+    # We don't ship the whitelist in the collection because
+    # there are legitimate use cases for banning private ip ranges.
+    if [ "$(cscli hub list -o raw | wc -l)" -le 1 ]; then
+        cs_cli parsers install crowdsecurity/whitelists --error || :
+        cs_cli collections install crowdsecurity/freebsd --error || :
+    fi
 }
 
 crowdsec_configtest() {