# CrowdSec package for OpenWrt

**URL:** <https://discourse.crowdsec.net/t/crowdsec-package-for-openwrt/225>\
**Category:** Uncategorized\
**Created:** [July 23, 2021, 2:07pm UTC](https://discourse.crowdsec.net/t/crowdsec-package-for-openwrt/225 "2021-07-23T14:07:07Z")\
**Posts on this page:** 2\
**Page:** 3

<div class="post-metadata">

**Author:** ![Gandalf](https://dub1.discourse-cdn.com/flex013/user_avatar/discourse.crowdsec.net/gandalf/32/43_2.png) [@Gandalf](https://discourse.crowdsec.net/u/Gandalf)\
**Post date:** [February 6, 2022, 3:35pm UTC](https://discourse.crowdsec.net/t/crowdsec-package-for-openwrt/225/42 "2022-02-06T15:35:15Z")

</div>

> <https://github.com/openwrt/packages/pull/17807>
>
> Maintainer: Gérald Kerma @erdoukki \[gandalf@gk2.net\](mailto:gandalf@gk2.net)
> En…vironment: (all, OpenWrt Master & 21.02.x)
> 
> Description:
> https://docs.crowdsec.net/docs/next/notification\_plugins/intro
> 
> \> Crowdsec supports notification plugins, meant to be able to push alerts to third party services, for alerting or integration purposes. At the time of writting, plugins exists for \[slack\](https://docs.crowdsec.net/docs/next/notification\_plugins/slack), \[splunk\](https://docs.crowdsec.net/docs/next/notification\_plugins/splunk), and a generic \[http push\](https://docs.crowdsec.net/docs/next/notification\_plugins/http) plugin (allowing to push to services such as \[elasticsearch\](https://docs.crowdsec.net/docs/next/notification\_plugins/elastic)).
> 
> update crowdsec Makefile to fix plugins notifications build and install:
> \- use correct path in GO\_PKG\_BUILD\_PKG to build plugins
> \- use INSTALL\_DATA and INSTALL\_BIN instead of CP to install plugins and config
> 
> other fix:
> \- add bouncers directory
> \- add upstream patches for default data and config directories
> \- rewrote & clean the defaults script (also verified with shellcheck)
> \- rewrote & clean the Makefile
> \- remove useless crowdsec-cli
> \- add configdir to config file
> \- add lapi\_host and lapi\_port to config file
> \- upgrade missing configs values to defaults in config file at upgrade
> \- add license and copyright
> \- use CWD\_VARS for Makefile variables
> 
> Signed-off-by: Kerma Gérald \<gandalf@gk2.net\>

> <https://github.com/openwrt/packages/pull/17805>
>
> crowdsec-firewall-bouncer: fix API error: access forbidden when bouncer is not c…orrectly registered #17804
> 
> Maintainer: Gérald Kerma @erdoukki \[gandalf@gk2.net\](mailto:gandalf@gk2.net)
> Environment: (all, OpenWrt Master & 21.02.x)
> 
> Issue: https://github.com/openwrt/packages/issues/17804
> Initially reported here: https://forum.openwrt.org/t/crowdsec-packages-for-openwrt/102648/25
> 
> This fix by checking deeper the bouncer status, re-registering it with force and api key if necessary
> This PR also fix some ENV names
> Fix also tests on strings
> Fix script net/crowdsec-firewall-bouncer/files/crowdsec-firewall-bouncer.defaults with spellcheck
> Fix strings with quotes
> Removed space before exclamation point
> Fix typo and replace triple dot by ellipsis
> 
> Description:
> I got an issue, which I resolved with as small modification on the script (look from OpenWrt side)
> While the api\_key is already defined in crowdsec-firewall-bouncer.yaml the grep on {API\_KEY} will not success.
> It may be normal behaviour, but in case the bouncer is not actually registered, because of an error or anything out of scope, the results is the bouncer is lost because of noo re-registering !
> 
> Actual "initialisation" (at upgrade, install, ...) on OpenWrt, is in the following script:
> https://github.com/openwrt/packages/blob/2b28e3dfdb14d4bea995181b9f00fc32407c7a73/net/crowdsec-firewall-bouncer/files/crowdsec-firewall-bouncer.defaults
> If made this fix in;
> \## Gen&ConfigApiKey
> 
> which force to re-register with the same api-key ( thanks to PR https://github.com/crowdsecurity/crowdsec/commit/9034bb791926b193f9f3fb73878399568ef656cb ) !
> 
> This is now working better,
> this is an issue we already know on OpenWrt, on reported and the OpenWrt CrowdSec dev topic ...
> https://forum.openwrt.org/t/crowdsec-packages-for-openwrt/102648/25
> 
> and already reported on the CrowdSec forum:
> https://discourse.crowdsec.net/t/crowdsec-openwrt-21-02-1-iptables-ipset-package-problems/533/2
> 
> /var/log/crowdsec-firewall-bouncer.log:time="13-01-2022 15:34:05" level=fatal msg="API error: access forbidden"
> 
> I will share this resolution tweak in the OpenWrt CrowdSec-Firewall-Bouncer package and made a PR at OpenWrt...
> 
> REF to issue: https://github.com/openwrt/packages/issues/17804
> REF to upstream issue: https://github.com/crowdsecurity/crowdsec/issues/1240
> 
> Signed-off-by: Kerma Gérald \<gandalf@gk2.net\>

---

<div class="post-metadata">

**Author:** ![Gandalf](https://dub1.discourse-cdn.com/flex013/user_avatar/discourse.crowdsec.net/gandalf/32/43_2.png) [@Gandalf](https://discourse.crowdsec.net/u/Gandalf)\
**Post date:** [February 6, 2022, 9:47pm UTC](https://discourse.crowdsec.net/t/crowdsec-package-for-openwrt/225/43 "2022-02-06T21:47:13Z")

</div>

Some Wiki Update:

> **[CrowdSec](https://openwrt.org/docs/guide-user/services/crowdsec)**
>
> CrowdSec This wiki page is currently a work in progress and information is currently in the process of being transferred from the community forum. Main Website: Documentation : Release info: OpenWrt Forum thread: CrowdSec Forum thread:

About the upcoming feature of notifications alerts (fix in; [https://github.com/openwrt/packages/pull/17807](https://github.com/openwrt/packages/pull/17807)) and quick howto with collections from the hub, to protect dockers instance of NextCloud and NginxProxyManager…

[[OpenWrt Wiki] CrowdSec](https://openwrt.org/docs/guide-user/services/crowdsec#external_tools) a new script will be available for external tools contributing to simplify users experience with CrowdSec!

[Previous page](https://discourse.crowdsec.net/t/crowdsec-package-for-openwrt/225.md?page=2)
