jlesage / docker-nginx-proxy-manager

Docker container for Nginx Proxy Manager
MIT License
770 stars 173 forks source link

Added support for crowdsec openresty bouncer. #237

Closed LePresidente closed 2 years ago

LePresidente commented 2 years ago

https://github.com/NginxProxyManager/nginx-proxy-manager/issues/1131

It can be enabled by setting the environment variable CROWDSEC_BOUNCER=1 The config file crowdsec-openresty-bouncer.conf will be available in /config/ for editing.

baudneo commented 2 years ago

I built your Docker image and followed all instructions but the openresty bouncer only does the initial check-in and then never hits the crowdsec Local API after initially being added?

As far as I am aware the bouncer should be polling the local API every 30 seconds by default.

LePresidente commented 2 years ago

just to confirm after you edited /config/crowdsec-openresty-bouncer.conf you restarted the docker container?

baudneo commented 2 years ago

Yes, I did a --force-recreate as well after just to be triple sure. Can you confirm that your openresty bouncer keeps polling your local API? I had the same issue on bare metal with the openresty bouncer -> https://github.com/crowdsecurity/cs-openresty-bouncer/issues/13

LePresidente commented 2 years ago

it takes a while to sync also you need to connect to a website hosted on NPM for it to kick in by the looks of things

time="18-02-2022 08:24:48" level=warning msg="new IP address detected for bouncer 'nginxtest': 172.17.0.1 (old: 172.17.0.4)"

time="18-02-2022 08:24:48" level=info msg="172.17.0.1 - [Fri, 18 Feb 2022 08:24:48 SAST] \"GET /v1/decisions/stream?startup=true HTTP/1.1 200 278.549815ms \"crowdsec-openresty-bouncer/v0.0.1\" \""
time="18-02-2022 08:24:58" level=info msg="172.17.0.1 - [Fri, 18 Feb 2022 08:24:58 SAST] \"GET /v1/decisions/stream?startup=false HTTP/1.1 200 67.167224ms \"crowdsec-openresty-bouncer/v0.0.1\" \""
baudneo commented 2 years ago

Awesome, thats the first time ive seen confirmation the openresty bouncer works!

LePresidente commented 2 years ago

I'm going to close this and rework it not a fan of how it's currently implemented.