From owner-dev-commits-ports-all@freebsd.org Wed Jul 14 14:20:13 2021 Return-Path: Delivered-To: dev-commits-ports-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EB38164CE3B; Wed, 14 Jul 2021 14:20:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GQ05T6KK5z3lB7; Wed, 14 Jul 2021 14:20:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C122C17927; Wed, 14 Jul 2021 14:20:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 16EEKD6c049748; Wed, 14 Jul 2021 14:20:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16EEKDTX049742; Wed, 14 Jul 2021 14:20:13 GMT (envelope-from git) Date: Wed, 14 Jul 2021 14:20:13 GMT Message-Id: <202107141420.16EEKDTX049742@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Sofian Brabez Subject: git: 337d0e23c1fa - main - security/crowdsec: update to 1.1.1 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: sbz X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 337d0e23c1fac63b3d235bd3171c4d00ce8c810c Auto-Submitted: auto-generated X-BeenThere: dev-commits-ports-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the ports repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Jul 2021 14:20:14 -0000 The branch main has been updated by sbz: URL: https://cgit.FreeBSD.org/ports/commit/?id=337d0e23c1fac63b3d235bd3171c4d00ce8c810c commit 337d0e23c1fac63b3d235bd3171c4d00ce8c810c Author: Sofian Brabez AuthorDate: 2021-07-14 14:07:31 +0000 Commit: Sofian Brabez CommitDate: 2021-07-14 14:09:23 +0000 security/crowdsec: update to 1.1.1 --- security/crowdsec/Makefile | 29 +++++++++++++++++++++------ security/crowdsec/distinfo | 10 +++++----- security/crowdsec/files/crowdsec.in | 14 +++++++++++++ security/crowdsec/files/pkg-message.in | 13 ++++++++++++ security/crowdsec/pkg-plist | 36 ++++++++++++++++++++++++++++++++++ 5 files changed, 91 insertions(+), 11 deletions(-) diff --git a/security/crowdsec/Makefile b/security/crowdsec/Makefile index df0fb1ec1e06..9a6aa7ada379 100644 --- a/security/crowdsec/Makefile +++ b/security/crowdsec/Makefile @@ -1,5 +1,5 @@ PORTNAME= crowdsec -PORTVERSION= 1.0.13 +PORTVERSION= 1.1.1 DISTVERSIONPREFIX= v CATEGORIES= security @@ -11,18 +11,35 @@ LICENSE_FILE= ${WRKSRC}/LICENSE USES= go:modules +USE_RC_SUBR= crowdsec + GO_MODULE= github.com/crowdsecurity/crowdsec GO_BUILDFLAGS= -ldflags "-s -w \ - -X github.com/crowdsecurity/crowdsec/pkg/cwversion.Version=v${PORTVERSION}\ - -X github.com/crowdsecurity/crowdsec/pkg/cwversion.System=freebsd" + -X github.com/crowdsecurity/crowdsec/pkg/cwversion.Version=v${PORTVERSION} \ + -X github.com/crowdsecurity/crowdsec/pkg/cwversion.System=freebsd \ + -X github.com/crowdsecurity/crowdsec/pkg/cwversion.BuildDate=`date -u '+%Y-%m-%d_%I:%M:%S%p'`" GO_TARGET= ./cmd/crowdsec \ ./cmd/crowdsec-cli -USE_RC_SUBR= crowdsec +SUB_FILES= pkg-message + +post-patch: + @${REINPLACE_CMD} 's,/etc/crowdsec/,${ETCDIR}/,g' \ + ${WRKSRC}/pkg/csconfig/config.go \ + ${WRKSRC}/cmd/crowdsec-cli/machines.go \ + ${WRKSRC}/cmd/crowdsec-cli/main.go \ + ${WRKSRC}/cmd/crowdsec/main.go + +do-install: + @${MKDIR} ${STAGEDIR}${ETCDIR} + @(cd ${WRKSRC}/config && ${COPYTREE_SHARE} . ${STAGEDIR}${ETCDIR}) + + @${MV} ${STAGEDIR}${ETCDIR}/config.yaml \ + ${STAGEDIR}${ETCDIR}/config.yaml.sample -PLIST_FILES= bin/crowdsec \ - bin/crowdsec-cli + ${INSTALL_PROGRAM} ${WRKDIR}/bin/crowdsec ${STAGEDIR}${PREFIX}/bin + ${INSTALL_PROGRAM} ${WRKDIR}/bin/crowdsec-cli ${STAGEDIR}${PREFIX}/bin .include diff --git a/security/crowdsec/distinfo b/security/crowdsec/distinfo index aa4793d1a6c3..2d309c313933 100644 --- a/security/crowdsec/distinfo +++ b/security/crowdsec/distinfo @@ -1,5 +1,5 @@ -TIMESTAMP = 1620115762 -SHA256 (go/security_crowdsec/crowdsec-v1.0.13/v1.0.13.mod) = e751afda0503bcfe8589775002b1fc1bd7271d603d56aa47d18ed5b3187e15c6 -SIZE (go/security_crowdsec/crowdsec-v1.0.13/v1.0.13.mod) = 3203 -SHA256 (go/security_crowdsec/crowdsec-v1.0.13/v1.0.13.zip) = 6f94f690ef87d7cfd3befe28129fd3a3014b50d81f78259d364f2ede8605a25a -SIZE (go/security_crowdsec/crowdsec-v1.0.13/v1.0.13.zip) = 41998630 +TIMESTAMP = 1626257804 +SHA256 (go/security_crowdsec/crowdsec-v1.1.1/v1.1.1.mod) = f764f7d850f1e2306f6764e534ace7261f7dc99f3b4884c2b0f617cb791b35de +SIZE (go/security_crowdsec/crowdsec-v1.1.1/v1.1.1.mod) = 3295 +SHA256 (go/security_crowdsec/crowdsec-v1.1.1/v1.1.1.zip) = f7e63641a67392d57412ab1ff86a26ae4deeb9fc8460542f6258f7c9f56238e9 +SIZE (go/security_crowdsec/crowdsec-v1.1.1/v1.1.1.zip) = 640252 diff --git a/security/crowdsec/files/crowdsec.in b/security/crowdsec/files/crowdsec.in index 9efe8305857b..59219b42aa19 100644 --- a/security/crowdsec/files/crowdsec.in +++ b/security/crowdsec/files/crowdsec.in @@ -27,11 +27,25 @@ load_rc_config $name : ${crowdsec_flags:=""} pidfile=/var/run/${name}.pid +required_files="$crowdsec_config" command="%%PREFIX%%/bin/${name}" start_cmd="${name}_start" +start_precmd="${name}_precmd" configtest_cmd="${name}_configtest" extra_commands="configtest reload" +crowdsec_precmd() { + if [ ! -d %%PREFIX%%/etc/crowdsec/hub ]; then + %%PREFIX%%/bin/crowdsec-cli hub update || : + fi + if [ -z "`%%PREFIX%%/bin/crowdsec-cli machines list -o raw`" ]; then + %%PREFIX%%/bin/crowdsec-cli machines add --auto || : + fi + if [ ! -s %%PREFIX%%/etc/crowdsec/online_api_credentials.yaml ]; then + %%PREFIX%%/bin/crowdsec-cli capi register || : + fi +} + crowdsec_start() { /usr/sbin/daemon -f -p ${pidfile} -t "${desc}" \ diff --git a/security/crowdsec/files/pkg-message.in b/security/crowdsec/files/pkg-message.in new file mode 100644 index 000000000000..93da4e2c4dae --- /dev/null +++ b/security/crowdsec/files/pkg-message.in @@ -0,0 +1,13 @@ +[ +{ type: install + message: <