11services :
22 traefik :
3- image : " traefik:v3.0 .0"
3+ image : " traefik:v3.5 .0"
44 container_name : " traefik"
55 restart : unless-stopped
66 command :
@@ -11,29 +11,30 @@ services:
1111 - " --providers.docker=true"
1212 - " --providers.docker.exposedbydefault=false"
1313 - " --entrypoints.web.address=:80"
14+ - " --entrypoints.web.forwardedheaders.trustedips=172.18.0.0/24"
1415
1516 - " --experimental.plugins.bouncer.modulename=github.com/maxlerebourg/crowdsec-bouncer-traefik-plugin"
1617 - " --experimental.plugins.bouncer.version=v1.4.5"
1718 # - "--experimental.localplugins.bouncer.modulename=github.com/maxlerebourg/crowdsec-bouncer-traefik-plugin"
1819 volumes :
1920 - /var/run/docker.sock:/var/run/docker.sock:ro
20- - logs-captcha-enabled:/var/log/traefik
21- - ' ./captcha.html:/captcha.html'
21+ - logs-custom- captcha-enabled:/var/log/traefik
22+ - " ./captcha.html:/captcha.html"
2223 # - ./../../:/plugins-local/src/github.com/maxlerebourg/crowdsec-bouncer-traefik-plugin
2324 ports :
2425 - 8000:80
2526 - 8080:8080
2627 depends_on :
2728 - crowdsec
2829
29- whoami :
30+ whoami-foo :
3031 image : traefik/whoami
31- container_name : " whoaami "
32+ container_name : " simple-service-custom-captcha-foo "
3233 restart : unless-stopped
3334 labels :
3435 - " traefik.enable=true"
3536 # Definition of the router
36- - " traefik.http.routers.router-foo.rule=Host(`localhost `)"
37+ - " traefik.http.routers.router-foo.rule=PathPrefix(`/foo `)"
3738 - " traefik.http.routers.router-foo.entrypoints=web"
3839 - " traefik.http.routers.router-foo.middlewares=crowdsec@docker"
3940 # Definition of the service
@@ -42,19 +43,20 @@ services:
4243 - " traefik.http.middlewares.crowdsec.plugin.bouncer.enabled=true"
4344 - " traefik.http.middlewares.crowdsec.plugin.bouncer.crowdseclapikey=40796d93c2958f9e58345514e67740e5"
4445 - " traefik.http.middlewares.crowdsec.plugin.bouncer.loglevel=DEBUG"
45-
46+
4647 # Choose captcha provider
4748 - " traefik.http.middlewares.crowdsec.plugin.bouncer.captchaProvider=custom"
48- - " traefik.http.middlewares.crowdsec.plugin.bouncer.captchaCustomJsURL=http://captcha.localhost:8080/fast.js"
49- - " traefik.http.middlewares.crowdsec.plugin.bouncer.CaptchaCustomValidateURL=http://captcha.localhost:8080/v0/siteverify"
50- - " traefik.http.middlewares.crowdsec.plugin.bouncer.CaptchaCustomKey=wicketpeeker"
51- - " traefik.http.middlewares.crowdsec.plugin.bouncer.CaptchaCustomResponse=response"
49+ - " traefik.http.middlewares.crowdsec.plugin.bouncer.captchaCustomJsURL=http://captcha.localhost:8000/fast.js"
50+ # Inside Traefik container the plugin must be able to reach wicketkeeper service so we can go through a Traefik localhost
51+ # domain which would resolve traefik itself and the port for the dashboard
52+ - " traefik.http.middlewares.crowdsec.plugin.bouncer.CaptchaCustomValidateURL=http://wicketkeeper:8080/v0/siteverify"
53+ - " traefik.http.middlewares.crowdsec.plugin.bouncer.CaptchaCustomKey=wicketkeeper"
54+ - " traefik.http.middlewares.crowdsec.plugin.bouncer.CaptchaCustomResponse=wicketkeeper_solution"
5255 # Define captcha grade period seconds
5356 - " traefik.http.middlewares.crowdsec.plugin.bouncer.captchaGracePeriodSeconds=20"
5457 # Define captcha HTML file path
5558 - " traefik.http.middlewares.crowdsec.plugin.bouncer.captchaHTMLFilePath=/captcha.html"
5659
57-
5860 crowdsec :
5961 image : crowdsecurity/crowdsec:v1.6.1-2
6062 container_name : " crowdsec"
@@ -65,39 +67,44 @@ services:
6567 BOUNCER_KEY_TRAEFIK_DEV : 40796d93c2958f9e58345514e67740e5
6668 volumes :
6769 # For captcha and ban mixed decision
68- - ' ./profiles.yaml:/etc/crowdsec/profiles.yaml:ro'
70+ - " ./profiles.yaml:/etc/crowdsec/profiles.yaml:ro"
6971 # For captcha only remediation
7072 # - './profiles_captcha_only.yaml:/etc/crowdsec/profiles.yaml:ro'
71- - ' ./acquis.yaml:/etc/crowdsec/acquis.yaml:ro'
72- - logs-captcha-enabled:/var/log/traefik:ro
73- - crowdsec-db-captcha-enabled:/var/lib/crowdsec/data/
74- - crowdsec-config-captcha-enabled:/etc/crowdsec/
73+ - " ./acquis.yaml:/etc/crowdsec/acquis.yaml:ro"
74+ - logs-custom- captcha-enabled:/var/log/traefik:ro
75+ - crowdsec-db-custom- captcha-enabled:/var/lib/crowdsec/data/
76+ - crowdsec-config-custom- captcha-enabled:/etc/crowdsec/
7577 labels :
7678 - " traefik.enable=false"
7779
7880 wicketkeeper :
79- image : ghcr.io/a-ve /wicketkeeper:latest
81+ image : ghcr.io/maxlerebourg /wicketkeeper:latest
8082 container_name : " wicketkeeper"
8183 environment :
82- - ROOT_URL=http://localhost:8080
84+ - ROOT_URL=http://captcha. localhost:8000
8385 - LISTEN_PORT=8080
8486 - REDIS_ADDR=redis:6379
8587 - DIFFICULTY=4
8688 - ALLOWED_ORIGINS=*
89+ - PRIVATE_KEY_PATH=/data/wicketkeeper.key
90+ volumes :
91+ - wicketkeeper-custom-captcha-enabled:/data
92+ user : root
8793 labels :
8894 - " traefik.enable=true"
8995 # Definition of the router
9096 - " traefik.http.routers.router-wicketpeeker.rule=Host(`captcha.localhost`)"
9197 - " traefik.http.routers.router-wicketpeeker.entrypoints=web"
9298 # Definition of the service
93- - " traefik.http.services.service-foo .loadbalancer.server.port=8080"
99+ - " traefik.http.services.service-whitekeeper .loadbalancer.server.port=8080"
94100 depends_on :
95101 - redis
96102
97103 redis :
98104 image : redis/redis-stack-server:latest
99-
105+
100106volumes :
101- logs-captcha-enabled :
102- crowdsec-db-captcha-enabled :
103- crowdsec-config-captcha-enabled :
107+ logs-custom-captcha-enabled :
108+ wicketkeeper-custom-captcha-enabled :
109+ crowdsec-db-custom-captcha-enabled :
110+ crowdsec-config-custom-captcha-enabled :
0 commit comments