File tree 6 files changed +16
-16
lines changed
6 files changed +16
-16
lines changed Original file line number Diff line number Diff line change @@ -84,10 +84,10 @@ custom_binary.sh del 1.2.3.4/32 3600 "test blacklist"
84
84
## Configuration
85
85
86
86
Before starting the ` crowdsec-custom-bouncer ` service, please edit the configuration to add your API url and key.
87
- The default configuration file is located under : ` /etc/crowdsec/crowdsec-custom-bouncer / `
87
+ The default configuration file is located under : ` /etc/crowdsec/bouncers / `
88
88
89
89
``` sh
90
- $ vim /etc/crowdsec/custom-bouncer /crowdsec-custom-bouncer.yaml
90
+ $ vim /etc/crowdsec/bouncers /crowdsec-custom-bouncer.yaml
91
91
```
92
92
93
93
``` yaml
Original file line number Diff line number Diff line change 22
22
23
23
24
24
TMP=`mktemp -p /tmp/`
25
- cp /etc/crowdsec/crowdsec-custom-bouncer /crowdsec-custom-bouncer.yaml ${TMP}
26
- API_KEY=${API_KEY} envsubst < ${TMP} > /etc/crowdsec/crowdsec-custom-bouncer /crowdsec-custom-bouncer.yaml
25
+ cp /etc/crowdsec/bouncers /crowdsec-custom-bouncer.yaml ${TMP}
26
+ API_KEY=${API_KEY} envsubst < ${TMP} > /etc/crowdsec/bouncers /crowdsec-custom-bouncer.yaml
27
27
rm ${TMP}
28
28
29
29
if [ ${START} -eq 0 ] ; then
30
30
echo "no api key was generated"
31
31
fi
32
32
33
- echo "please enter the binary path in '/etc/crowdsec/crowdsec-custom-bouncer /crowdsec-custom-bouncer.yaml' and start the bouncer via 'sudo systemctl start crowdsec-custom-bouncer' "
33
+ echo "please enter the binary path in '/etc/crowdsec/bouncers /crowdsec-custom-bouncer.yaml' and start the bouncer via 'sudo systemctl start crowdsec-custom-bouncer' "
Original file line number Diff line number Diff line change @@ -18,6 +18,6 @@ override_dh_auto_install:
18
18
mkdir -p debian/crowdsec-custom-bouncer/usr/sbin
19
19
cp crowdsec-custom-bouncer debian/crowdsec-custom-bouncer/usr/sbin
20
20
mkdir -p debian/crowdsec-custom-bouncer/etc/systemd/system/
21
- mkdir -p debian/crowdsec-custom-bouncer/etc/crowdsec/crowdsec-custom-bouncer /
22
- BIN=/sbin/crowdsec-custom-bouncer CFG=/etc/crowdsec/crowdsec-custom-bouncer envsubst < config/crowdsec-custom-bouncer.service > debian/crowdsec-custom-bouncer/etc/systemd/system/crowdsec-custom-bouncer.service
23
- cp config/crowdsec-custom-bouncer.yaml debian/crowdsec-custom-bouncer/etc/crowdsec/crowdsec-custom-bouncer /
21
+ mkdir -p debian/crowdsec-custom-bouncer/etc/crowdsec/bouncers /
22
+ BIN=/sbin/crowdsec-custom-bouncer CFG=/etc/crowdsec/bouncers envsubst < config/crowdsec-custom-bouncer.service > debian/crowdsec-custom-bouncer/etc/systemd/system/crowdsec-custom-bouncer.service
23
+ cp config/crowdsec-custom-bouncer.yaml debian/crowdsec-custom-bouncer/etc/crowdsec/bouncers /
Original file line number Diff line number Diff line change @@ -37,7 +37,7 @@ rm ${TMP}
37
37
rm -rf %{buildroot }
38
38
mkdir -p %{buildroot }/usr/sbin
39
39
install -m 755 -D %{name } %{buildroot }%{_bindir }/%{name }
40
- install -m 600 -D config/%{name }.yaml %{buildroot }/etc/crowdsec/%{ name } /%{name }.yaml
40
+ install -m 600 -D config/%{name }.yaml %{buildroot }/etc/crowdsec/bouncers /%{name }.yaml
41
41
install -m 644 -D config/%{name }.service %{buildroot }%{_unitdir }/%{name }.service
42
42
43
43
%clean
@@ -47,7 +47,7 @@ rm -rf %{buildroot}
47
47
%defattr(-,root,root,-)
48
48
/usr/bin/%{name }
49
49
%{_unitdir }/%{name }.service
50
- %config(noreplace) /etc/crowdsec/%{ name } /%{name }.yaml
50
+ %config(noreplace) /etc/crowdsec/bouncers /%{name }.yaml
51
51
52
52
53
53
%post
@@ -73,15 +73,15 @@ if [ "$?" -eq "0" ] ; then
73
73
fi
74
74
75
75
TMP= `mktemp -p /tmp/`
76
- cp /etc/crowdsec/crowdsec-custom-bouncer /crowdsec-custom-bouncer.yaml ${TMP}
77
- API_KEY= ${API_KEY} envsubst < ${TMP} > /etc/crowdsec/crowdsec-custom-bouncer /crowdsec-custom-bouncer.yaml
76
+ cp /etc/crowdsec/bouncers /crowdsec-custom-bouncer.yaml ${TMP}
77
+ API_KEY= ${API_KEY} envsubst < ${TMP} > /etc/crowdsec/bouncers /crowdsec-custom-bouncer.yaml
78
78
rm ${TMP}
79
79
80
80
if [ ${START} -eq 0 ] ; then
81
81
echo "no api key was generated, won't start service"
82
82
fi
83
83
84
- echo "please enter the binary path in '/etc/crowdsec/crowdsec-custom-bouncer /crowdsec-custom-bouncer.yaml' and start the bouncer via 'sudo systemctl start crowdsec-custom-bouncer' "
84
+ echo "please enter the binary path in '/etc/crowdsec/bouncers /crowdsec-custom-bouncer.yaml' and start the bouncer via 'sudo systemctl start crowdsec-custom-bouncer' "
85
85
86
86
87
87
Original file line number Diff line number Diff line change 1
1
#! /usr/bin/env bash
2
2
BIN_PATH_INSTALLED=" /usr/local/bin/crowdsec-custom-bouncer"
3
3
BIN_PATH=" ./crowdsec-custom-bouncer"
4
- CONFIG_DIR=" /etc/crowdsec/crowdsec-custom-bouncer /"
4
+ CONFIG_DIR=" /etc/crowdsec/bouncers /"
5
5
PID_DIR=" /var/run/crowdsec/"
6
6
SYSTEMD_PATH_FILE=" /etc/systemd/system/crowdsec-custom-bouncer.service"
7
7
API_KEY=" "
Original file line number Diff line number Diff line change 2
2
3
3
SYSTEMD_PATH_FILE=" /etc/systemd/system/crowdsec-custom-bouncer.service"
4
4
LOG_FILE=" /var/log/crowdsec-custom-bouncer.log"
5
- CONFIG_DIR=" /etc/crowdsec/crowdsec-custom-bouncer/ "
5
+ CONFIG_DIR=" /etc/crowdsec/bouncers "
6
6
BIN_PATH_INSTALLED=" /usr/local/bin/crowdsec-custom-bouncer"
7
7
8
8
uninstall () {
9
9
systemctl stop crowdsec-custom-bouncer
10
- rm -rf " ${CONFIG_DIR} "
10
+ rm -f " ${CONFIG_DIR} /crowdsec-custom-bouncer.yaml "
11
11
rm -f " ${SYSTEMD_PATH_FILE} "
12
12
rm -f " ${BIN_PATH_INSTALLED} "
13
13
rm -f " ${LOG_FILE} "
You can’t perform that action at this time.
0 commit comments