Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 24 Mar 2021 16:56:31 +0100
From:      Baptiste Daroussin <bapt@FreeBSD.org>
To:        Sofian Brabez <sbz@FreeBSD.org>
Cc:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   Re: svn commit: r569135 - in head/security/crowdsec: . files
Message-ID:  <20210324155631.zvtmepz7ropprvwm@aniel.nours.eu>
In-Reply-To: <202103241545.12OFjJvO092197@repo.freebsd.org>
References:  <202103241545.12OFjJvO092197@repo.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help

--wynov4vaetobvsf2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Wed, Mar 24, 2021 at 03:45:19PM +0000, Sofian Brabez wrote:
> Author: sbz
> Date: Wed Mar 24 15:45:18 2021
> New Revision: 569135
> URL: https://svnweb.freebsd.org/changeset/ports/569135
>=20
> Log:
>   - Update to 1.0.9
>   - Add rc.d script
>=20
> 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)
>=20
> Modified: head/security/crowdsec/Makefile
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D
> --- 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$
> =20
>  PORTNAME=3D	crowdsec
> -PORTVERSION=3D	1.0.7
> +PORTVERSION=3D	1.0.9
>  DISTVERSIONPREFIX=3D	v
>  CATEGORIES=3D	security
> =20
> @@ -20,6 +20,8 @@ GO_BUILDFLAGS=3D	-ldflags "-s -w \
> =20
>  GO_TARGET=3D	./cmd/crowdsec \
>  		./cmd/crowdsec-cli
> +
> +USE_RC_SUBR=3D	crowdsec
> =20
>  PLIST_FILES=3D	bin/crowdsec \
>  		bin/crowdsec-cli
>=20
> Modified: head/security/crowdsec/distinfo
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D
> --- 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 =3D 1615033328
> -SHA256 (go/security_crowdsec/crowdsec-v1.0.7/v1.0.7.mod) =3D 810ca243ce2=
951dd7ab23d955efc8f50410c94feb8babc47a783146a4c06c798
> -SIZE (go/security_crowdsec/crowdsec-v1.0.7/v1.0.7.mod) =3D 3310
> -SHA256 (go/security_crowdsec/crowdsec-v1.0.7/v1.0.7.zip) =3D 1d7f5956826=
096405b24684db3c924476ffb7fa02f5859af5a6a2c00d8b1d753
> -SIZE (go/security_crowdsec/crowdsec-v1.0.7/v1.0.7.zip) =3D 29305256
> +TIMESTAMP =3D 1616585825
> +SHA256 (go/security_crowdsec/crowdsec-v1.0.9/v1.0.9.mod) =3D b95c6a35287=
b10ff019c2c3391bad1d0759415cf53cb7c0bfe7b154e479f6531
> +SIZE (go/security_crowdsec/crowdsec-v1.0.9/v1.0.9.mod) =3D 3322
> +SHA256 (go/security_crowdsec/crowdsec-v1.0.9/v1.0.9.zip) =3D 0b61f7e5ed1=
62796d14636243ffcc8c8e336a3a3ee7891115141447c7626e8f7
> +SIZE (go/security_crowdsec/crowdsec-v1.0.9/v1.0.9.zip) =3D 29314582
>=20
> Added: head/security/crowdsec/files/crowdsec.in
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D
> --- /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	(r5=
69135)
> @@ -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=3Dcrowdsec
> +desc=3D"Crowdsec Agent"
> +rcvar=3Dcrowdsec_enable
> +
> +load_rc_config $name
> +
> +: ${crowdsec_enable:=3D"NO"}
> +: ${crowdsec_config:=3D"%%PREFIX%%/etc/crowdsec/config.yaml"}
> +: ${crowdsec_flags:=3D""}
> +
> +pidfile=3D/var/run/${name}.pid
> +command=3D"%%PREFIX%%/bin/${name}"
procname=3D"%%PREFIX%%/bin/${NAME}
command=3D"/usr/sbin/daemon"
commandargs=3D"-f -T ${name} -p ${pidfile} -- ${procname} -c ${crowdsec_con=
fig} ${crowdsec_flags}"

And you don't need the _start() function

> +start_cmd=3D"${name}_start"
> +configtest_cmd=3D"${name}_configtest"
> +extra_commands=3D"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"

--wynov4vaetobvsf2
Content-Type: application/pgp-signature; name="signature.asc"

-----BEGIN PGP SIGNATURE-----

iQIzBAABCAAdFiEEgOTj3suS2urGXVU3Y4mL3PG3PloFAmBbYSwACgkQY4mL3PG3
PlrZ0RAAldIazcpSuqi/dM5sqOX6M5aGkN1ITavK5orEp+H5KNWivvuo2YQO5p5P
/QQy8iGyVyMCI1OEAxfEFpQHFyjCV3yKKUszZtZoWjWeXzr3wSgtwVMFigcOq8jh
diw2LBaTrkw/eaEmu+CHCu/o+UkFYiizAMDhrAphJZPbcjmdGOi7hlh0UMP46/gf
hmL+Z6qEA2LJG+IUvt4tI7pKwIHDVFdq2Sqpv9j7yqRlyiYrFYAuc+AC8P+cUG85
ercWgGkNiAEYzU9gadf2r4ScGjRVzU04kwaJ1ejDFW3tr8SMeVEAjybCQD7zxWzH
JrtBQ+1wslZCT9lVOrR685I2NaHbgyjYj9VHlklmck5pG3FFgc1nRa/Xe5nXd0Lv
HcVXT4xcI6H/ynbPC5Ao9h0hxgYjp4UF10uuIqUT0b9oCgAwkEwk0NHNK6CrPX7h
rfzFPp/+Lz6oDBXmi/vbo8D+9MQQ97NK5e3N7QvgEno9tIYlRfRTMIzYiwsRpjgJ
G++d2czAmKbiK+sO+SMmiu0j4r4bH2lmrJtgmju7OfrYX8VJ0IZKQnkHvO5GjWyU
wpDUihSKNAZC0OqMbT6kZTMtvks35BMpqRCuRirfLYQLk4w6OZfRwhmWsrgx4XrZ
1gSlLbaCVPWnc3iouXlQppqPNSVoOkNyjHPQ2L1atcHJwIzpIFE=
=Bckt
-----END PGP SIGNATURE-----

--wynov4vaetobvsf2--



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