Files
docker-nginx-full/scripts/install-crowdsec_openresty_bouncer
T
Brian Munro b4804e6faf Install Crowdsec OpenResty Bouncer directly into the docker image.
Config files and templates are saved in /defaults/crowdsec A script in the main docker image will handle deployment.
2022-02-22 08:55:22 +02:00

23 lines
1.1 KiB
Bash
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#!/bin/bash -e
BLUE='\E[1;34m'
CYAN='\E[1;36m'
YELLOW='\E[1;33m'
GREEN='\E[1;32m'
RESET='\E[0m'
echo -e "${BLUE} ${CYAN}Installing Crowdsec OpenResty Bouncer ${YELLOW}${CROWDSEC_OPENRESTY_BOUNCER_VERSION}...${RESET}"
cd /tmp
#Offical Crowdsec download location is currently blocked due to two pull requests waiting to be added for full support for Docker installs
#weg "https://github.com/crowdsecurity/cs-openresty-bouncer/releases/download/v${CROWDSEC_OPENRESTY_BOUNCER_VERSION}/crowdsec-openresty-bouncer.tgz"
wget "https://github.com/LePresidente/cs-openresty-bouncer/releases/download/v${CROWDSEC_OPENRESTY_BOUNCER_VERSION}/crowdsec-openresty-bouncer.tgz"
mkdir -p /tmp/crowdsec
tar -xzf --strip 1 crowdsec-openresty-bouncer.tgz -C /tmp/crowdsec
cd /tmp/crowdsec
bash ./install.sh --NGINX_CONF_DIR=/etc/nginx/conf.d --LIB_PATH=/etc/nginx/lualib --CONFIG_PATH=/defaults/crowdsec --DATA_PATH=/defaults/crowdsec --docker
sed-patch 's|ENABLED=.*|ENABLED=false|' /defaults/crowdsec/crowdsec-openresty-bouncer.conf
echo -e "${BLUE} ${GREEN}OpenResty plugins install completed${RESET}"