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

Collapse All | Expand All

(-)b/security/crowdsec/Makefile (-22 / +21 lines)
Lines 1-6 Link Here
1
PORTNAME=	crowdsec
1
PORTNAME=	crowdsec
2
PORTVERSION=	1.2.3	# NOTE: change BUILD_VERSION and BUILD_TAG as well
2
PORTVERSION=	1.3.2	# NOTE: change BUILD_VERSION and BUILD_TAG as well
3
PORTREVISION=	1
4
DISTVERSIONPREFIX=	v
3
DISTVERSIONPREFIX=	v
5
CATEGORIES=	security
4
CATEGORIES=	security
6
5
Lines 15-37 BUILD_DEPENDS= git:devel/git@lite \ Link Here
15
		jq:textproc/jq
14
		jq:textproc/jq
16
15
17
USES=		gmake
16
USES=		gmake
17
ALL_TARGET=	build
18
18
19
USE_GITHUB=	yes
19
USE_GITHUB=	yes
20
GH_ACCOUNT=	crowdsecurity
20
GH_ACCOUNT=	crowdsecurity
21
GH_PROJECT=	crowdsec
21
GH_PROJECT=	crowdsec
22
GH_TAGNAME=	v1.2.3-freebsd
22
GH_TAGNAME=	v1.3.2-freebsd-wip
23
#GH_TAGNAME is automatically set from DISTVERSION
23
#GH_TAGNAME is automatically set from DISTVERSION
24
24
25
OPTIONS_DEFINE=	FIREWALL_BOUNCER
26
OPTIONS_DEFAULT=
27
28
FIREWALL_BOUNCER_DESC=	Depend on security/crowdsec-firewall-bouncer
29
FIREWALL_BOUNCER_RUN_DEPENDS=	crowdsec-firewall-bouncer>=0.0.23.r2:security/crowdsec-firewall-bouncer
30
25
USE_RC_SUBR=	crowdsec
31
USE_RC_SUBR=	crowdsec
26
32
27
SUB_FILES=	pkg-message \
33
SUB_FILES=	pkg-deinstall pkg-install pkg-message
28
		pkg-install \
29
		pkg-deinstall
30
34
31
# BUILD_VERSION=$(git describe --tags $(git rev-list --tags --max-count=1))
35
MAKE_ENV=	BUILD_VERSION="v1.3.2" \
32
# BUILD_TAG=$(git rev-parse HEAD)
36
		BUILD_TAG="716251323da59f1ce04fb1fc38af0a72629b5d78" \
33
MAKE_ENV=	BUILD_VERSION="v1.2.3" \
37
		DEFAULT_CONFIGDIR="/usr/local/etc/crowdsec" \
34
		BUILD_TAG="fc4be1e0ffc5888f2824358464cb2426cd4472e1"
38
		DEFAULT_DATADIR="/var/db/crowdsec/data"
35
39
36
PLUGIN_DIR=	${PREFIX}/lib/crowdsec/plugins
40
PLUGIN_DIR=	${PREFIX}/lib/crowdsec/plugins
37
STAGE_PLUGINS=	${STAGEDIR}${PLUGIN_DIR}
41
STAGE_PLUGINS=	${STAGEDIR}${PLUGIN_DIR}
Lines 39-55 STAGE_BIN= ${STAGEDIR}${PREFIX}/bin Link Here
39
43
40
post-patch:
44
post-patch:
41
	@${REINPLACE_CMD} 's,/etc/crowdsec/,${ETCDIR}/,g' \
45
	@${REINPLACE_CMD} 's,/etc/crowdsec/,${ETCDIR}/,g' \
42
		${WRKSRC}/pkg/csconfig/config.go \
43
		${WRKSRC}/pkg/cstest/hubtest_item.go \
44
		${WRKSRC}/cmd/crowdsec-cli/machines.go \
45
		${WRKSRC}/cmd/crowdsec-cli/main.go \
46
		${WRKSRC}/cmd/crowdsec/main.go \
47
		${WRKSRC}/config/config.yaml \
46
		${WRKSRC}/config/config.yaml \
48
		${WRKSRC}/config/profiles.yaml
47
		${WRKSRC}/config/profiles.yaml
49
48
50
	@${REINPLACE_CMD} 's,/var/lib/,/var/db/,g' \
49
	@${REINPLACE_CMD} 's,/var/lib/,/var/db/,g' \
51
		${WRKSRC}/pkg/csconfig/config.go \
52
		${WRKSRC}/pkg/metabase/database.go \
53
		${WRKSRC}/config/config.yaml \
50
		${WRKSRC}/config/config.yaml \
54
		${WRKSRC}/config/profiles.yaml
51
		${WRKSRC}/config/profiles.yaml
55
52
Lines 81-86 do-install: Link Here
81
	@${MV} ${STAGEDIR}${ETCDIR}/config.yaml \
78
	@${MV} ${STAGEDIR}${ETCDIR}/config.yaml \
82
		${STAGEDIR}${ETCDIR}/config.yaml.sample
79
		${STAGEDIR}${ETCDIR}/config.yaml.sample
83
80
81
	@${MV} ${STAGEDIR}${ETCDIR}/console.yaml \
82
		${STAGEDIR}${ETCDIR}/console.yaml.sample
83
84
	@${MV} ${STAGEDIR}${ETCDIR}/profiles.yaml \
84
	@${MV} ${STAGEDIR}${ETCDIR}/profiles.yaml \
85
		${STAGEDIR}${ETCDIR}/profiles.yaml.sample
85
		${STAGEDIR}${ETCDIR}/profiles.yaml.sample
86
86
Lines 96-114 do-install: Link Here
96
96
97
	@${MKDIR} ${STAGEDIR}${ETCDIR}/notifications/email
97
	@${MKDIR} ${STAGEDIR}${ETCDIR}/notifications/email
98
	@${MV} ${WRKSRC}/plugins/notifications/email/email.yaml \
98
	@${MV} ${WRKSRC}/plugins/notifications/email/email.yaml \
99
		${STAGEDIR}${ETCDIR}/notifications/email/email.yaml.sample
99
		${STAGEDIR}${ETCDIR}/notifications/email.yaml.sample
100
100
101
	@${MKDIR} ${STAGEDIR}${ETCDIR}/notifications/http
101
	@${MKDIR} ${STAGEDIR}${ETCDIR}/notifications/http
102
	@${MV} ${WRKSRC}/plugins/notifications/http/http.yaml \
102
	@${MV} ${WRKSRC}/plugins/notifications/http/http.yaml \
103
		${STAGEDIR}${ETCDIR}/notifications/http/http.yaml.sample
103
		${STAGEDIR}${ETCDIR}/notifications/http.yaml.sample
104
104
105
	@${MKDIR} ${STAGEDIR}${ETCDIR}/notifications/slack
105
	@${MKDIR} ${STAGEDIR}${ETCDIR}/notifications/slack
106
	@${MV} ${WRKSRC}/plugins/notifications/slack/slack.yaml \
106
	@${MV} ${WRKSRC}/plugins/notifications/slack/slack.yaml \
107
		${STAGEDIR}${ETCDIR}/notifications/slack/slack.yaml.sample
107
		${STAGEDIR}${ETCDIR}/notifications/slack.yaml.sample
108
108
109
	@${MKDIR} ${STAGEDIR}${ETCDIR}/notifications/splunk
109
	@${MKDIR} ${STAGEDIR}${ETCDIR}/notifications/splunk
110
	@${MV} ${WRKSRC}/plugins/notifications/splunk/splunk.yaml \
110
	@${MV} ${WRKSRC}/plugins/notifications/splunk/splunk.yaml \
111
		${STAGEDIR}${ETCDIR}/notifications/splunk/splunk.yaml.sample
111
		${STAGEDIR}${ETCDIR}/notifications/splunk.yaml.sample
112
112
113
	# updated by "cscli machines" at first service start
113
	# updated by "cscli machines" at first service start
114
	@${MV} ${STAGEDIR}${ETCDIR}/local_api_credentials.yaml \
114
	@${MV} ${STAGEDIR}${ETCDIR}/local_api_credentials.yaml \
Lines 130-135 do-install: Link Here
130
	#
130
	#
131
131
132
	@${MKDIR} ${STAGEDIR}${EXAMPLESDIR}
132
	@${MKDIR} ${STAGEDIR}${EXAMPLESDIR}
133
	${INSTALL_DATA} ${FILESDIR}/crowdsec.conf-newsyslog ${STAGEDIR}${PREFIX}/etc/newsyslog.conf.d/crowdsec.conf.sample
134
	
133
	
135
.include <bsd.port.mk>
134
.include <bsd.port.mk>
(-)b/security/crowdsec/distinfo (-3 / +3 lines)
Lines 1-3 Link Here
1
TIMESTAMP = 1642022158
1
TIMESTAMP = 1646686224
2
SHA256 (crowdsecurity-crowdsec-v1.2.3-v1.2.3-freebsd_GH0.tar.gz) = 9b3dd5fcc7b67cf89a1a661009a215b9a7f7a0efeb598456480e57fbd6e9bb4b
2
SHA256 (crowdsecurity-crowdsec-v1.3.2-v1.3.2-freebsd-wip_GH0.tar.gz) = e805f8e60213fd49fa2e0fa182d6d91591dc26f378733139bd5609b5b914d5b3
3
SIZE (crowdsecurity-crowdsec-v1.2.3-v1.2.3-freebsd_GH0.tar.gz) = 19122216
3
SIZE (crowdsecurity-crowdsec-v1.3.2-v1.3.2-freebsd-wip_GH0.tar.gz) = 20005916
(-)a/security/crowdsec/files/crowdsec.conf-newsyslog (-3 lines)
Removed Link Here
1
# logfilename			[owner:group]	mode	count	size(kb)	when	flags	[/pid_file]				[sig_num]
2
/var/log/crowdsec.log		root:wheel	644  	10	20480		*	JC	/var/run/crowdsec.pid
3
/var/log/crowdsec_api.log	root:wheel	644  	10	20480		*	JC	/var/run/crowdsec.pid
(-)b/security/crowdsec/files/crowdsec.in (+1 lines)
Lines 1-6 Link Here
1
#!/bin/sh
1
#!/bin/sh
2
2
3
# PROVIDE: crowdsec
3
# PROVIDE: crowdsec
4
# BEFORE: crowdsec_firewall
4
# REQUIRE: LOGIN DAEMON NETWORKING
5
# REQUIRE: LOGIN DAEMON NETWORKING
5
# KEYWORD: shutdown
6
# KEYWORD: shutdown
6
#
7
#
(-)b/security/crowdsec/files/patch-Makefile (-23 / +9 lines)
Lines 1-26 Link Here
1
--- Makefile.orig	2021-12-21 21:18:22 UTC
1
--- Makefile.orig	2022-02-10 09:11:04 UTC
2
+++ Makefile
2
+++ Makefile
3
@@ -44,14 +44,14 @@ BUILD_CODENAME=$(shell cat RELEASE.json | jq -r .CodeN
3
@@ -58,8 +58,8 @@ LD_OPTS_VARS= \
4
 BUILD_TIMESTAMP=$(shell date +%F"_"%T)
4
 -X github.com/crowdsecurity/crowdsec/pkg/csconfig.defaultConfigDir=$(DEFAULT_CONFIGDIR) \
5
 BUILD_TAG?="$(shell git rev-parse HEAD)"
5
 -X github.com/crowdsecurity/crowdsec/pkg/csconfig.defaultDataDir=$(DEFAULT_DATADIR)
6
 
6
 
7
-export LD_OPTS=-ldflags "-s -w -X github.com/crowdsecurity/crowdsec/pkg/cwversion.Version=$(BUILD_VERSION) \
7
-export LD_OPTS=-ldflags "-s -w $(LD_OPTS_VARS)"
8
+export LD_OPTS=-mod vendor -modcacherw -ldflags "-s -w -X github.com/crowdsecurity/crowdsec/pkg/cwversion.Version=$(BUILD_VERSION) \
8
-export LD_OPTS_STATIC=-ldflags "-s -w $(LD_OPTS_VARS) -extldflags '-static'"
9
 -X github.com/crowdsecurity/crowdsec/pkg/cwversion.System=$(SYSTEM) \
9
+export LD_OPTS=-mod vendor -modcacherw -ldflags "-s -w $(LD_OPTS_VARS)"
10
 -X github.com/crowdsecurity/crowdsec/pkg/cwversion.BuildDate=$(BUILD_TIMESTAMP) \
10
+export LD_OPTS_STATIC=-mod vendor -modcacherw -ldflags "-s -w $(LD_OPTS_VARS) -extldflags '-static'"
11
 -X github.com/crowdsecurity/crowdsec/pkg/cwversion.Codename=$(BUILD_CODENAME)  \
12
 -X github.com/crowdsecurity/crowdsec/pkg/cwversion.Tag=$(BUILD_TAG) \
13
 -X github.com/crowdsecurity/crowdsec/pkg/cwversion.GoVersion=$(BUILD_GOVERSION)"
14
 
11
 
15
-export LD_OPTS_STATIC=-ldflags "-s -w -X github.com/crowdsecurity/crowdsec/pkg/cwversion.Version=$(BUILD_VERSION) \
12
 RELDIR = crowdsec-$(BUILD_VERSION)
16
+export LD_OPTS_STATIC=-mod vendor -modcacherw -ldflags "-s -w -X github.com/crowdsecurity/crowdsec/pkg/cwversion.Version=$(BUILD_VERSION) \
17
 -X github.com/crowdsecurity/crowdsec/pkg/cwversion.BuildDate=$(BUILD_TIMESTAMP) \
18
 -X github.com/crowdsecurity/crowdsec/pkg/cwversion.Codename=$(BUILD_CODENAME)  \
19
 -X github.com/crowdsecurity/crowdsec/pkg/cwversion.Tag=$(BUILD_TAG) \
20
@@ -176,4 +176,4 @@ check_release:
21
 release: check_release build package
22
 
23
 .PHONY:
24
-release_static: check_release static package_static
25
\ No newline at end of file
26
+release_static: check_release static package_static
(-)b/security/crowdsec/pkg-plist (-7 / +5 lines)
Lines 8-19 bin/crowdsec-cli Link Here
8
@mode 0644
8
@mode 0644
9
@sample %%ETCDIR%%/acquis.yaml.sample
9
@sample %%ETCDIR%%/acquis.yaml.sample
10
@sample %%ETCDIR%%/config.yaml.sample
10
@sample %%ETCDIR%%/config.yaml.sample
11
@sample %%ETCDIR%%/console.yaml.sample
11
@sample %%ETCDIR%%/profiles.yaml.sample
12
@sample %%ETCDIR%%/profiles.yaml.sample
12
@sample %%ETCDIR%%/simulation.yaml.sample
13
@sample %%ETCDIR%%/simulation.yaml.sample
13
@sample %%ETCDIR%%/notifications/email/email.yaml.sample
14
@sample %%ETCDIR%%/notifications/email.yaml.sample
14
@sample %%ETCDIR%%/notifications/http/http.yaml.sample
15
@sample %%ETCDIR%%/notifications/http.yaml.sample
15
@sample %%ETCDIR%%/notifications/slack/slack.yaml.sample
16
@sample %%ETCDIR%%/notifications/slack.yaml.sample
16
@sample %%ETCDIR%%/notifications/splunk/splunk.yaml.sample
17
@sample %%ETCDIR%%/notifications/splunk.yaml.sample
17
%%ETCDIR%%/patterns/aws
18
%%ETCDIR%%/patterns/aws
18
%%ETCDIR%%/patterns/bacula
19
%%ETCDIR%%/patterns/bacula
19
%%ETCDIR%%/patterns/bro
20
%%ETCDIR%%/patterns/bro
Lines 38-44 bin/crowdsec-cli Link Here
38
%%ETCDIR%%/patterns/smb
39
%%ETCDIR%%/patterns/smb
39
%%ETCDIR%%/patterns/ssh
40
%%ETCDIR%%/patterns/ssh
40
%%ETCDIR%%/patterns/tcpdump
41
%%ETCDIR%%/patterns/tcpdump
41
@sample etc/newsyslog.conf.d/crowdsec.conf.sample
42
@mode 0755
42
@mode 0755
43
lib/crowdsec/plugins/notification-email
43
lib/crowdsec/plugins/notification-email
44
lib/crowdsec/plugins/notification-http
44
lib/crowdsec/plugins/notification-http
Lines 47-50 lib/crowdsec/plugins/notification-splunk Link Here
47
@dir %%ETCDIR%%/hub
47
@dir %%ETCDIR%%/hub
48
@dir /var/db/crowdsec/data
48
@dir /var/db/crowdsec/data
49
@dir /var/db/crowdsec
49
@dir /var/db/crowdsec
50
@dir etc/newsyslog.conf.d
51
- 

Return to bug 262426