git: e7efe5be3fb2 - main - security/crowdsec-firewall-bouncer: include configuration patch

From: Robert Clausecker <fuz_at_FreeBSD.org>
Date: Thu, 19 Oct 2023 07:08:28 UTC
The branch main has been updated by fuz:

URL: https://cgit.FreeBSD.org/ports/commit/?id=e7efe5be3fb2d0b3c3bf4738b82f5963e00bc94d

commit e7efe5be3fb2d0b3c3bf4738b82f5963e00bc94d
Author:     Marco Mariani <marco@crowdsec.net>
AuthorDate: 2023-10-17 07:05:20 +0000
Commit:     Robert Clausecker <fuz@FreeBSD.org>
CommitDate: 2023-10-19 07:07:30 +0000

    security/crowdsec-firewall-bouncer: include configuration patch
    
    The update to 0.0.28 from PR 274213  did not include a file that sets
    backend mode in new installations. If the backend is not set, the
    application does not start.
    
    This version includes the missing patch file, and also sets the
    $BACKEND environment variable as a fallback. The application will
    substitute it at runtime if required.
    
    PR:             274213, 274529
    Fixes:          714e7fb44f516d31f08b657b2eb9a66ae1fbf9c7
---
 security/crowdsec-firewall-bouncer/Makefile                      | 1 +
 security/crowdsec-firewall-bouncer/files/crowdsec_firewall.in    | 2 ++
 .../files/patch-config_crowdsec-firewall-bouncer.yaml            | 9 +++++++++
 3 files changed, 12 insertions(+)

diff --git a/security/crowdsec-firewall-bouncer/Makefile b/security/crowdsec-firewall-bouncer/Makefile
index f4488f4953aa..2fe61b09bca2 100644
--- a/security/crowdsec-firewall-bouncer/Makefile
+++ b/security/crowdsec-firewall-bouncer/Makefile
@@ -1,4 +1,5 @@
 PORTNAME=	crowdsec-firewall-bouncer
+PORTREVISION=	1
 DISTVERSIONPREFIX=	v
 DISTVERSION=	0.0.28
 CATEGORIES=	security
diff --git a/security/crowdsec-firewall-bouncer/files/crowdsec_firewall.in b/security/crowdsec-firewall-bouncer/files/crowdsec_firewall.in
index dd2e10d6f918..78fed46c27f2 100644
--- a/security/crowdsec-firewall-bouncer/files/crowdsec_firewall.in
+++ b/security/crowdsec-firewall-bouncer/files/crowdsec_firewall.in
@@ -83,6 +83,8 @@ crowdsec_firewall_stop()
 }
 
 crowdsec_firewall_start() {
+    # ensure we have a backend if the config file was not patched
+    export BACKEND=pf
     /usr/sbin/daemon -f -p "$pidfile" -t "$desc" -- \
         "$command" -c "$crowdsec_firewall_config" ${crowdsec_firewall_flags}
 }
diff --git a/security/crowdsec-firewall-bouncer/files/patch-config_crowdsec-firewall-bouncer.yaml b/security/crowdsec-firewall-bouncer/files/patch-config_crowdsec-firewall-bouncer.yaml
new file mode 100644
index 000000000000..f09f44420eaa
--- /dev/null
+++ b/security/crowdsec-firewall-bouncer/files/patch-config_crowdsec-firewall-bouncer.yaml
@@ -0,0 +1,9 @@
+--- config/crowdsec-firewall-bouncer.yaml.orig	2023-07-31 19:34:51 UTC
++++ config/crowdsec-firewall-bouncer.yaml
+@@ -1,4 +1,5 @@
+-mode: ${BACKEND}
++mode: pf
++retry_initial_connect: true
+ update_frequency: 10s
+ log_mode: file
+ log_dir: /var/log/