I am running caddy with caddy bouncer build from hslatman.
When I run sudo docker exec crowdsec cscli bouncer add caddy-bouncer I get an API key. This is good, then I enter it into my docker compose and Caddyfile and restart Caddy. No issues and crowdsec is working normally.
Unfortunately, whenever there is an update or I run sudo docker compose down that API key needs to be reset. I have looked on forums and though this discord to find fixes but I am unable to find any solutions.
The error which appears only after a container down or update:
"msg":"auth-api: auth with api key failed return nil response, error: dial tcp 172.30.0.2:8080:
I know this means it cant connect to the local API, but it does work once I rerun cscli add caddy-bouncer and replace the API key.
What I've tried:
sudo cscli lapi register doesn't seem to fix anything.
This looks promising but I cannot find the caddy-bouncer remediation file.
https://docs.crowdsec.net/docs/next/local_api/authentication/#:~:text=dedicated documentation.-,Remediation Components (Bouncers),API token to use it in your Remediation Component configuration file.,-Log Processors (machines
My compose:
crowdsec:
container_name: crowdsec
hostname: crowdsec
image: crowdsecurity/crowdsec:latest
expose:
- 8080
restart: always
environment:
GID: "${GID-1000}"
BOUNCER_KEY_CADDY: <KEY>
COLLECTIONS: <COLLECTIONS_HERE>
volumes:
- ./logs:/var/log/caddy
- ./crowdsec/crowdsec-db:/var/lib/crowdsec/data/
- ./crowdsec/crowdsec-config:/etc/crowdsec/
labels:
- com.centurylinklabs.watchtower.enable=true
networks:
caddy:
ipv4_address: 172.30.0.2
Caddyfile:
crowdsec {
api_url http://crowdsec:8080
api_key <KEY>
}
}```