HAProxy configuration and lua scripts implementing a challenge-response page where visitors solve a captcha and/or proof-of-work (cpu intensive) task. Intended to stop bots, spam, ddos, etc.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

51 lines
1.5 KiB

version: "3.9"
services:
haproxy:
network_mode: host
ports:
- 80:80
# - 2000:2000 #runtime api
# - 2001:2001 #dataplaneapi
build:
context: ./
dockerfile: haproxy/Dockerfile
volumes:
- ./haproxy/haproxy.cfg:/etc/haproxy/haproxy.cfg
- ./haproxy/dataplaneapi.hcl:/etc/haproxy/dataplaneapi.hcl
- ./haproxy/map/:/etc/haproxy/map/
- ./haproxy/template/:/etc/haproxy/template/
- ./src/lua/scripts/:/etc/haproxy/scripts/
- ./src/lua/libs/:/etc/haproxy/libs/
- ./src/js/:/etc/haproxy/js/
environment:
# These are the hcaptcha and recaptcha test keys, not leaking any dont worry :^)
- HCAPTCHA_SITEKEY=20000000-ffff-ffff-ffff-000000000002
- HCAPTCHA_SECRET=0x0000000000000000000000000000000000000000
#- RECAPTCHA_SECRET=6LeIxAcTAAAAAGG-vFI1TnRWxMZNFuojJ4WifJWe
#- RECAPTCHA_SITEKEY=6LeIxAcTAAAAAJcZVRqyHh71UMIEGNQ_MXjiZKhI
- CAPTCHA_COOKIE_SECRET=changeme
- POW_COOKIE_SECRET=changeme
- HMAC_COOKIE_SECRET=changeme
- RAY_ID=docker
- CHALLENGE_EXPIRY=43200
- BACKEND_NAME=servers
- SERVER_PREFIX=websrv
- CHALLENGE_INCLUDES_IP=1
- ARGON_TIME=2
- ARGON_KB=512
- POW_DIFFICULTY=24
- POW_TYPE=argon2
- TOR_CONTROL_PORT_PASSWORD=changeme
nginx:
ports:
- 81:80
image: "nginx:latest"
volumes:
- ./nginx:/usr/share/nginx/html
# tor:
# build:
# context: ./
# dockerfile: tor/Dockerfile