Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 24 Mar 2021 15:45:19 +0000 (UTC)
From:      Sofian Brabez <sbz@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r569135 - in head/security/crowdsec: . files
Message-ID:  <202103241545.12OFjJvO092197@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: sbz
Date: Wed Mar 24 15:45:18 2021
New Revision: 569135
URL: https://svnweb.freebsd.org/changeset/ports/569135

Log:
  - Update to 1.0.9
  - Add rc.d script

Added:
  head/security/crowdsec/files/
  head/security/crowdsec/files/crowdsec.in   (contents, props changed)
Modified:
  head/security/crowdsec/Makefile
  head/security/crowdsec/distinfo   (contents, props changed)

Modified: head/security/crowdsec/Makefile
==============================================================================
--- head/security/crowdsec/Makefile	Wed Mar 24 15:25:44 2021	(r569134)
+++ head/security/crowdsec/Makefile	Wed Mar 24 15:45:18 2021	(r569135)
@@ -1,7 +1,7 @@
 # $FreeBSD$
 
 PORTNAME=	crowdsec
-PORTVERSION=	1.0.7
+PORTVERSION=	1.0.9
 DISTVERSIONPREFIX=	v
 CATEGORIES=	security
 
@@ -20,6 +20,8 @@ GO_BUILDFLAGS=	-ldflags "-s -w \
 
 GO_TARGET=	./cmd/crowdsec \
 		./cmd/crowdsec-cli
+
+USE_RC_SUBR=	crowdsec
 
 PLIST_FILES=	bin/crowdsec \
 		bin/crowdsec-cli

Modified: head/security/crowdsec/distinfo
==============================================================================
--- head/security/crowdsec/distinfo	Wed Mar 24 15:25:44 2021	(r569134)
+++ head/security/crowdsec/distinfo	Wed Mar 24 15:45:18 2021	(r569135)
@@ -1,5 +1,5 @@
-TIMESTAMP = 1615033328
-SHA256 (go/security_crowdsec/crowdsec-v1.0.7/v1.0.7.mod) = 810ca243ce2951dd7ab23d955efc8f50410c94feb8babc47a783146a4c06c798
-SIZE (go/security_crowdsec/crowdsec-v1.0.7/v1.0.7.mod) = 3310
-SHA256 (go/security_crowdsec/crowdsec-v1.0.7/v1.0.7.zip) = 1d7f5956826096405b24684db3c924476ffb7fa02f5859af5a6a2c00d8b1d753
-SIZE (go/security_crowdsec/crowdsec-v1.0.7/v1.0.7.zip) = 29305256
+TIMESTAMP = 1616585825
+SHA256 (go/security_crowdsec/crowdsec-v1.0.9/v1.0.9.mod) = b95c6a35287b10ff019c2c3391bad1d0759415cf53cb7c0bfe7b154e479f6531
+SIZE (go/security_crowdsec/crowdsec-v1.0.9/v1.0.9.mod) = 3322
+SHA256 (go/security_crowdsec/crowdsec-v1.0.9/v1.0.9.zip) = 0b61f7e5ed162796d14636243ffcc8c8e336a3a3ee7891115141447c7626e8f7
+SIZE (go/security_crowdsec/crowdsec-v1.0.9/v1.0.9.zip) = 29314582

Added: head/security/crowdsec/files/crowdsec.in
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/security/crowdsec/files/crowdsec.in	Wed Mar 24 15:45:18 2021	(r569135)
@@ -0,0 +1,49 @@
+#!/bin/sh
+
+# $FreeBSD$
+#
+# PROVIDE: crowdsec
+# REQUIRE: LOGIN DAEMON NETWORKING
+# KEYWORD: shutdown
+#
+# Add the following lines to /etc/rc.conf.local or /etc/rc.conf
+# to enable this service:
+#
+# crowdsec_enable (bool):	Set it to YES to enable crowdsec agent.
+#				Default is "NO".
+# crowdsec_config (str):	Set the agent config path.
+#				Default is "%%PREFIX%%/etc/crowdsec/config.yaml".
+# crowdsec_flags (str):	Set the extra flags to run agent.
+#				Default is ""
+
+. /etc/rc.subr
+
+name=crowdsec
+desc="Crowdsec Agent"
+rcvar=crowdsec_enable
+
+load_rc_config $name
+
+: ${crowdsec_enable:="NO"}
+: ${crowdsec_config:="%%PREFIX%%/etc/crowdsec/config.yaml"}
+: ${crowdsec_flags:=""}
+
+pidfile=/var/run/${name}.pid
+command="%%PREFIX%%/bin/${name}"
+start_cmd="${name}_start"
+configtest_cmd="${name}_configtest"
+extra_commands="configtest reload"
+
+crowdsec_start()
+{
+	/usr/sbin/daemon -f -p ${pidfile} -t "${desc}" \
+		${command} -c ${crowdsec_config} ${crowdsec_flags}
+}
+
+crowdsec_configtest()
+{
+	echo "Performing sanity check on ${name} configuration."
+	eval ${command} -c ${crowdsec_config} -t
+}
+
+run_rc_command "$1"



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202103241545.12OFjJvO092197>