View | Details | Raw Unified | Return to bug 267808 | Differences between
and this patch

Collapse All | Expand All

(-)b/security/crowdsec/Makefile (-9 / +23 lines)
Lines 1-7 Link Here
1
PORTNAME=	crowdsec
1
PORTNAME=	crowdsec
2
DISTVERSIONPREFIX=	v
2
DISTVERSIONPREFIX=	v
3
DISTVERSION=	1.4.1
3
DISTVERSION=	1.4.3
4
PORTREVISION=	2
5
CATEGORIES=	security
4
CATEGORIES=	security
6
5
7
MAINTAINER=	marco@crowdsec.net
6
MAINTAINER=	marco@crowdsec.net
Lines 13-34 LICENSE_FILE= ${WRKSRC}/LICENSE Link Here
13
12
14
BUILD_DEPENDS=	git:devel/git@lite
13
BUILD_DEPENDS=	git:devel/git@lite
15
14
16
USES=		gmake go:no_targets
15
USES=		gmake go:1.19,no_targets
17
16
18
USE_GITHUB=	yes
17
USE_GITHUB=	yes
19
GH_ACCOUNT=	crowdsecurity
18
GH_ACCOUNT=	crowdsecurity
20
GH_PROJECT=	crowdsec
19
GH_PROJECT=	crowdsec
21
GH_TAGNAME=	${DISTVERSIONFULL}-freebsd
20
GH_TAGNAME=	${DISTVERSIONFULL}-freebsd
22
_BUILD_TAG=	527995f
21
_BUILD_TAG=	8a738f5b
23
USE_RC_SUBR=	crowdsec
22
USE_RC_SUBR=	crowdsec
24
23
25
MAKE_ENV=	BUILD_VERSION="${DISTVERSIONFULL}" \
24
MAKE_ARGS=	BUILD_VERSION="${DISTVERSIONFULL}" \
26
		BUILD_TAG="${_BUILD_TAG}" \
25
		BUILD_TAG="${_BUILD_TAG}" \
26
		BUILD_VENDOR_FLAGS="-mod=vendor -modcacherw" \
27
		DEFAULT_CONFIGDIR="${PREFIX}/etc/crowdsec" \
27
		DEFAULT_CONFIGDIR="${PREFIX}/etc/crowdsec" \
28
		DEFAULT_DATADIR="/var/db/crowdsec/data"
28
		DEFAULT_DATADIR="/var/db/crowdsec/data"
29
29
ALL_TARGET=	build
30
ALL_TARGET=	build
30
31
31
SUB_FILES=	pkg-deinstall pkg-install pkg-message
32
SUB_FILES=	pkg-deinstall pkg-install pkg-message crowdsec.cron upgrade-hub
32
33
33
OPTIONS_DEFINE=	FIREWALL_BOUNCER
34
OPTIONS_DEFINE=	FIREWALL_BOUNCER
34
OPTIONS_DEFAULT=
35
OPTIONS_DEFAULT=
Lines 49-54 post-patch: Link Here
49
		${WRKSRC}/config/config.yaml \
50
		${WRKSRC}/config/config.yaml \
50
		${WRKSRC}/config/profiles.yaml
51
		${WRKSRC}/config/profiles.yaml
51
52
53
post-install:
54
	@${MKDIR} ${STAGEDIR}${PREFIX}/etc/cron.d
55
	@${INSTALL_DATA} ${WRKDIR}/crowdsec.cron ${STAGEDIR}${PREFIX}/etc/cron.d/crowdsec
56
52
do-install:
57
do-install:
53
	#
58
	#
54
	# Binaries
59
	# Binaries
Lines 124-139 do-install: Link Here
124
	@${MKDIR} ${STAGEDIR}${ETCDIR}/hub
129
	@${MKDIR} ${STAGEDIR}${ETCDIR}/hub
125
	@${MKDIR} ${STAGEDIR}/var/db/crowdsec/data
130
	@${MKDIR} ${STAGEDIR}/var/db/crowdsec/data
126
131
132
	#
133
	# Cron
134
	#
135
136
	@${MKDIR} ${STAGEDIR}${PREFIX}/libexec/crowdsec
137
	${INSTALL_DATA} ${WRKDIR}/upgrade-hub \
138
		${STAGEDIR}${PREFIX}/libexec/crowdsec/upgrade-hub
139
127
	#
140
	#
128
	# Cleanup
141
	# Cleanup
129
	#
142
	#
130
143
144
	@${RM} ${STAGEDIR}${ETCDIR}/acquis_win.yaml
145
	@${RM} ${STAGEDIR}${ETCDIR}/config_win_no_lapi.yaml
146
	@${RM} ${STAGEDIR}${ETCDIR}/config_win.yaml
147
	@${RM} ${STAGEDIR}${ETCDIR}/crowdsec.cron.daily
131
	@${RM} ${STAGEDIR}${ETCDIR}/crowdsec.service
148
	@${RM} ${STAGEDIR}${ETCDIR}/crowdsec.service
132
	@${RM} ${STAGEDIR}${ETCDIR}/dev.yaml
149
	@${RM} ${STAGEDIR}${ETCDIR}/dev.yaml
133
	@${RM} ${STAGEDIR}${ETCDIR}/user.yaml
150
	@${RM} ${STAGEDIR}${ETCDIR}/user.yaml
134
	@${RM} ${STAGEDIR}${ETCDIR}/acquis_win.yaml
135
	@${RM} ${STAGEDIR}${ETCDIR}/config_win.yaml
136
	@${RM} ${STAGEDIR}${ETCDIR}/config_win_no_lapi.yaml
137
	@${RMDIR} ${STAGEDIR}${ETCDIR}/notifications/email
151
	@${RMDIR} ${STAGEDIR}${ETCDIR}/notifications/email
138
	@${RMDIR} ${STAGEDIR}${ETCDIR}/notifications/http
152
	@${RMDIR} ${STAGEDIR}${ETCDIR}/notifications/http
139
	@${RMDIR} ${STAGEDIR}${ETCDIR}/notifications/slack
153
	@${RMDIR} ${STAGEDIR}${ETCDIR}/notifications/slack
(-)b/security/crowdsec/distinfo (-3 / +3 lines)
Lines 1-3 Link Here
1
TIMESTAMP = 1658844897
1
TIMESTAMP = 1669821186
2
SHA256 (crowdsecurity-crowdsec-v1.4.1-v1.4.1-freebsd_GH0.tar.gz) = a05e75838f4c4e87906ab6df846cc73b4701f6460834e35e5b64b7774e16bb63
2
SHA256 (crowdsecurity-crowdsec-v1.4.3-v1.4.3-freebsd_GH0.tar.gz) = b7341939db304a21c0920bc9b8e89d589dfff5da83ea4c54b3d1fc46b9eea2c3
3
SIZE (crowdsecurity-crowdsec-v1.4.1-v1.4.1-freebsd_GH0.tar.gz) = 20805956
3
SIZE (crowdsecurity-crowdsec-v1.4.3-v1.4.3-freebsd_GH0.tar.gz) = 21310998
(-)b/security/crowdsec/files/crowdsec.cron.in (+2 lines)
Added Link Here
1
#minute	hour	mday	month	wday	who	command
2
0       3       *       *       *       root    %%PREFIX%%/libexec/crowdsec/upgrade-hub
(-)a/security/crowdsec/files/patch-Makefile (-12 lines)
Removed Link Here
1
--- Makefile.orig	2022-02-10 09:11:04 UTC
2
+++ Makefile
3
@@ -58,8 +58,8 @@ LD_OPTS_VARS= \
4
 -X github.com/crowdsecurity/crowdsec/pkg/csconfig.defaultConfigDir=$(DEFAULT_CONFIGDIR) \
5
 -X github.com/crowdsecurity/crowdsec/pkg/csconfig.defaultDataDir=$(DEFAULT_DATADIR)
6
 
7
-export LD_OPTS=-ldflags "-s -w $(LD_OPTS_VARS)"
8
-export LD_OPTS_STATIC=-ldflags "-s -w $(LD_OPTS_VARS) -extldflags '-static'"
9
+export LD_OPTS=-mod vendor -modcacherw -ldflags "-s -w $(LD_OPTS_VARS)"
10
+export LD_OPTS_STATIC=-mod vendor -modcacherw -ldflags "-s -w $(LD_OPTS_VARS) -extldflags '-static'"
11
 
12
 RELDIR = crowdsec-$(BUILD_VERSION)
(-)b/security/crowdsec/files/pkg-deinstall.in (-2 / +2 lines)
Lines 2-9 Link Here
2
2
3
case $2 in
3
case $2 in
4
       "DEINSTALL")
4
       "DEINSTALL")
5
               service crowdsec status && touch /var/run/crowdsec.running
5
               service crowdsec status 2>/dev/null && touch /var/run/crowdsec.running
6
               service crowdsec stop || :
6
               service crowdsec stop 2>/dev/null || :
7
               ;;
7
               ;;
8
esac
8
esac
9
9
(-)b/security/crowdsec/files/pkg-message.in (-1 / +1 lines)
Lines 7-13 crowdsec is installed. Link Here
7
You need to check/edit the following files in %%ETCDIR%% as described in https://doc.crowdsec.net/docs/configuration/crowdsec_configuration
7
You need to check/edit the following files in %%ETCDIR%% as described in https://doc.crowdsec.net/docs/configuration/crowdsec_configuration
8
8
9
 - config.yaml: main configuration
9
 - config.yaml: main configuration
10
 - acquis.yaml: where to find logs to parse (this port does not include automatic discovery of the running services)
10
 - acquis.yaml, acquis.d: datasource configuration (this port does not include automatic discovery of the running services)
11
 - profiles.yaml: remediation policies (ban, duration, etc)
11
 - profiles.yaml: remediation policies (ban, duration, etc)
12
12
13
Then you can enable the daemon via sysrc and run it.
13
Then you can enable the daemon via sysrc and run it.
(-)b/security/crowdsec/files/upgrade-hub.in (+17 lines)
Added Link Here
1
#!/bin/sh
2
3
test -x /usr/local/bin/cscli || exit 0
4
5
# favor the opnsense plugin's cron if it's there
6
test -e /usr/local/etc/cron.d/oscrowdsec.cron && exit 0
7
8
/usr/local/bin/cscli --error hub update
9
10
upgraded=$(/usr/local/bin/cscli --error hub upgrade)
11
if [ -n "$upgraded" ]; then
12
    # splay initial metrics push
13
    sleep $(jot -r 1 1 60)
14
    service crowdsec reload
15
fi
16
17
exit 0
(-)b/security/crowdsec/pkg-plist (-6 / +7 lines)
Lines 2-20 Link Here
2
bin/crowdsec
2
bin/crowdsec
3
bin/cscli
3
bin/cscli
4
bin/crowdsec-cli
4
bin/crowdsec-cli
5
libexec/crowdsec/upgrade-hub
5
@mode 0600
6
@mode 0600
7
@sample %%ETCDIR%%/config.yaml.sample
6
@sample %%ETCDIR%%/local_api_credentials.yaml.sample
8
@sample %%ETCDIR%%/local_api_credentials.yaml.sample
7
@sample %%ETCDIR%%/online_api_credentials.yaml.sample
9
@sample %%ETCDIR%%/online_api_credentials.yaml.sample
10
@sample %%ETCDIR%%/notifications/email.yaml.sample
11
@sample %%ETCDIR%%/notifications/http.yaml.sample
12
@sample %%ETCDIR%%/notifications/slack.yaml.sample
13
@sample %%ETCDIR%%/notifications/splunk.yaml.sample
8
@mode 0644
14
@mode 0644
9
@sample %%ETCDIR%%/acquis.yaml.sample
15
@sample %%ETCDIR%%/acquis.yaml.sample
10
@sample %%ETCDIR%%/config.yaml.sample
11
@sample %%ETCDIR%%/console.yaml.sample
16
@sample %%ETCDIR%%/console.yaml.sample
12
@sample %%ETCDIR%%/profiles.yaml.sample
17
@sample %%ETCDIR%%/profiles.yaml.sample
13
@sample %%ETCDIR%%/simulation.yaml.sample
18
@sample %%ETCDIR%%/simulation.yaml.sample
14
@sample %%ETCDIR%%/notifications/email.yaml.sample
15
@sample %%ETCDIR%%/notifications/http.yaml.sample
16
@sample %%ETCDIR%%/notifications/slack.yaml.sample
17
@sample %%ETCDIR%%/notifications/splunk.yaml.sample
18
%%ETCDIR%%/patterns/aws
19
%%ETCDIR%%/patterns/aws
19
%%ETCDIR%%/patterns/bacula
20
%%ETCDIR%%/patterns/bacula
20
%%ETCDIR%%/patterns/bro
21
%%ETCDIR%%/patterns/bro
Lines 39-44 bin/crowdsec-cli Link Here
39
%%ETCDIR%%/patterns/smb
40
%%ETCDIR%%/patterns/smb
40
%%ETCDIR%%/patterns/ssh
41
%%ETCDIR%%/patterns/ssh
41
%%ETCDIR%%/patterns/tcpdump
42
%%ETCDIR%%/patterns/tcpdump
43
etc/cron.d/crowdsec
42
@mode 0755
44
@mode 0755
43
lib/crowdsec/plugins/notification-email
45
lib/crowdsec/plugins/notification-email
44
lib/crowdsec/plugins/notification-http
46
lib/crowdsec/plugins/notification-http
45
- 

Return to bug 267808