security/crowdsec: Update 1.6.4 => 1.6.5

Changelog:
https://github.com/crowdsecurity/crowdsec/releases/tag/v1.6.5

PR:	284730
MFH:	2025Q1
This commit is contained in:
Marco 2025-02-11 16:56:16 +03:00 committed by Vladimir Druzenko
parent 3fc159574d
commit 2c8fd6f3ca
5 changed files with 48 additions and 13 deletions

View File

@ -1,7 +1,6 @@
PORTNAME= crowdsec
DISTVERSIONPREFIX= v
DISTVERSION= 1.6.4
PORTREVISION= 1
DISTVERSION= 1.6.5
CATEGORIES= security
MAINTAINER= marco@crowdsec.net
@ -15,7 +14,7 @@ LIB_DEPENDS= libabsl_base.so:devel/abseil \
libre2.so:devel/re2
USES= go:1.23,modules pkgconfig
_COMMIT= 523164f6
_COMMIT= d8dcdc91
_BUILD_DATE= $$(date -u "+%F_%T")
USE_RC_SUBR= crowdsec
@ -30,7 +29,7 @@ GO_TARGET= ./cmd/crowdsec \
GO_BUILDFLAGS= -v -trimpath -tags netgo,osusergo,sqlite_omit_load_extension,re2_cgo \
-ldflags="\
-a -s -w \
-a -s \
-X github.com/crowdsecurity/go-cs-lib/version.Version=${DISTVERSIONPREFIX}${PKGVERSION} \
-X github.com/crowdsecurity/go-cs-lib/version.BuildDate=${_BUILD_DATE} \
-X github.com/crowdsecurity/go-cs-lib/version.Tag=${_COMMIT} \

View File

@ -1,5 +1,5 @@
TIMESTAMP = 1732708457
SHA256 (go/security_crowdsec/crowdsec-v1.6.4/v1.6.4.mod) = 8494881f2c033d1becdbdc2be4230740874f0dca703f26a60f1e2108ca7419a1
SIZE (go/security_crowdsec/crowdsec-v1.6.4/v1.6.4.mod) = 10240
SHA256 (go/security_crowdsec/crowdsec-v1.6.4/v1.6.4.zip) = 075555e9ebb93d45dcfd144069fcbdfb791935965be265034880f4d335292755
SIZE (go/security_crowdsec/crowdsec-v1.6.4/v1.6.4.zip) = 1570635
TIMESTAMP = 1738941832
SHA256 (go/security_crowdsec/crowdsec-v1.6.5/v1.6.5.mod) = f288295700dd0a49cd69d520167cd00826d974877450cc627f8f839850c0d617
SIZE (go/security_crowdsec/crowdsec-v1.6.5/v1.6.5.mod) = 10932
SHA256 (go/security_crowdsec/crowdsec-v1.6.5/v1.6.5.zip) = 1d9642ab9b6cdbc9dd8f1a1331d9d72da06f0b876b2970499e3f27443889cad5
SIZE (go/security_crowdsec/crowdsec-v1.6.5/v1.6.5.zip) = 1669439

View File

@ -59,14 +59,24 @@ crowdsec_stop_precmd() {
}
crowdsec_stop_postcmd() {
# don't trust sbin/daemon to send the signal
kill -TERM "$_CROWDSECPID" 2>/dev/null
# wait for process to exit before restarting, or it will find the http port in use
if [ -n "$_CROWDSECPID" ]; then
wait_for_pids "$_CROWDSECPID"
# don't trust sbin/daemon to send the signal
kill -TERM "$_CROWDSECPID" 2>/dev/null
fi
if [ -n "$_CROWDSEC_CHILDREN" ]; then
kill -TERM $_CROWDSEC_CHILDREN 2>/dev/null
fi
sleep 5
if [ -n "$_CROWDSECPID" ]; then
# in case a datasource didn't respond
kill -KILL "$_CROWDSECPID" 2>/dev/null
# ensure the process is not running before restart, or it will find the http port in use
wait_for_pids "$_CROWDSECPID"
fi
if [ -n "$_CROWDSEC_CHILDREN" ]; then
kill -KILL $_CROWDSEC_CHILDREN 2>/dev/null
wait_for_pids $_CROWDSEC_CHILDREN
fi
}

View File

@ -0,0 +1,13 @@
--- pkg/cwhub/hub.go.orig 2025-02-10 13:37:25 UTC
+++ pkg/cwhub/hub.go
@@ -165,7 +165,9 @@ func (h *Hub) Update(ctx context.Context, indexProvide
}
if !downloaded {
- fmt.Println("Nothing to do, the hub index is up to date.")
+ // use logger and the message will be silenced in the cron job
+ // (no mail if nothing happened)
+ h.logger.Info("Nothing to do, the hub index is up to date.")
}
return nil

View File

@ -0,0 +1,13 @@
--- pkg/hubops/download.go.orig 2025-02-10 13:37:39 UTC
+++ pkg/hubops/download.go
@@ -114,6 +114,10 @@ func downloadDataSet(ctx context.Context, dataFolder s
}
for _, dataS := range data.Data {
+ if dataS.SourceURL == "" {
+ continue
+ }
+
// XXX: check context cancellation
destPath, err := cwhub.SafePath(dataFolder, dataS.DestPath)
if err != nil {