File tree Expand file tree Collapse file tree 6 files changed +16
-16
lines changed Expand file tree Collapse file tree 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"
8484## Configuration
8585
8686Before 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 / `
8888
8989``` sh
90- $ vim /etc/crowdsec/custom-bouncer /crowdsec-custom-bouncer.yaml
90+ $ vim /etc/crowdsec/bouncers /crowdsec-custom-bouncer.yaml
9191```
9292
9393``` yaml
Original file line number Diff line number Diff line change 2222
2323
2424TMP=`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
2727rm ${TMP}
2828
2929if [ ${START} -eq 0 ] ; then
3030 echo "no api key was generated"
3131fi
3232
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:
1818 mkdir -p debian/crowdsec-custom-bouncer/usr/sbin
1919 cp crowdsec-custom-bouncer debian/crowdsec-custom-bouncer/usr/sbin
2020 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}
3737rm -rf %{buildroot }
3838mkdir -p %{buildroot }/usr/sbin
3939install -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
4141install -m 644 -D config/%{name }.service %{buildroot }%{_unitdir }/%{name }.service
4242
4343%clean
@@ -47,7 +47,7 @@ rm -rf %{buildroot}
4747%defattr(-,root,root,-)
4848/usr/bin/%{name }
4949%{_unitdir }/%{name }.service
50- %config(noreplace) /etc/crowdsec/%{ name } /%{name }.yaml
50+ %config(noreplace) /etc/crowdsec/bouncers /%{name }.yaml
5151
5252
5353%post
@@ -73,15 +73,15 @@ if [ "$?" -eq "0" ] ; then
7373fi
7474
7575TMP= `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
7878rm ${TMP}
7979
8080if [ ${START} -eq 0 ] ; then
8181 echo "no api key was generated, won't start service"
8282fi
8383
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' "
8585
8686
8787
Original file line number Diff line number Diff line change 11#! /usr/bin/env bash
22BIN_PATH_INSTALLED=" /usr/local/bin/crowdsec-custom-bouncer"
33BIN_PATH=" ./crowdsec-custom-bouncer"
4- CONFIG_DIR=" /etc/crowdsec/crowdsec-custom-bouncer /"
4+ CONFIG_DIR=" /etc/crowdsec/bouncers /"
55PID_DIR=" /var/run/crowdsec/"
66SYSTEMD_PATH_FILE=" /etc/systemd/system/crowdsec-custom-bouncer.service"
77API_KEY=" "
Original file line number Diff line number Diff line change 22
33SYSTEMD_PATH_FILE=" /etc/systemd/system/crowdsec-custom-bouncer.service"
44LOG_FILE=" /var/log/crowdsec-custom-bouncer.log"
5- CONFIG_DIR=" /etc/crowdsec/crowdsec-custom-bouncer/ "
5+ CONFIG_DIR=" /etc/crowdsec/bouncers "
66BIN_PATH_INSTALLED=" /usr/local/bin/crowdsec-custom-bouncer"
77
88uninstall () {
99 systemctl stop crowdsec-custom-bouncer
10- rm -rf " ${CONFIG_DIR} "
10+ rm -f " ${CONFIG_DIR} /crowdsec-custom-bouncer.yaml "
1111 rm -f " ${SYSTEMD_PATH_FILE} "
1212 rm -f " ${BIN_PATH_INSTALLED} "
1313 rm -f " ${LOG_FILE} "
You can’t perform that action at this time.
0 commit comments