File tree Expand file tree Collapse file tree 5 files changed +22
-21
lines changed Expand file tree Collapse file tree 5 files changed +22
-21
lines changed Original file line number Diff line number Diff line change @@ -26,16 +26,17 @@ RUN addgroup -S crowdsec-spoa && adduser -S -D -H -s /sbin/nologin -g crowdsec-s
2626# # Create a socket for the spoa to inherit crowdsec-spoa:haproxy user from official haproxy image
2727RUN mkdir -p /run/crowdsec-spoa/ && chown crowdsec-spoa:haproxy /run/crowdsec-spoa/ && chmod 770 /run/crowdsec-spoa/
2828
29- # # Copy templates
30- RUN mkdir -p /var /lib/crowdsec/lua/ haproxy/templates/
31- COPY --from=build /go/src/cs-spoa-bouncer/templates /* /var /lib/crowdsec/lua/ haproxy/templates /
29+ # # Copy Lua files (matching Debian/RPM paths)
30+ RUN mkdir -p /usr /lib/crowdsec- haproxy-spoa-bouncer/lua
31+ COPY --from=build /go/src/cs-spoa-bouncer/lua /* /usr /lib/crowdsec- haproxy-spoa-bouncer/lua /
3232
33- RUN mkdir -p /usr/local/crowdsec/lua/haproxy/
34- COPY --from=build /go/src/cs-spoa-bouncer/lua/* /usr/local/crowdsec/lua/haproxy/
33+ # # Copy templates (matching Debian/RPM paths)
34+ RUN mkdir -p /var/lib/crowdsec-haproxy-spoa-bouncer/html
35+ COPY --from=build /go/src/cs-spoa-bouncer/templates/* /var/lib/crowdsec-haproxy-spoa-bouncer/html/
3536
36- RUN chown -R root:haproxy /var /lib/crowdsec/lua/haproxy /usr/local /crowdsec/lua/ haproxy
37+ RUN chown -R root:haproxy /usr /lib/crowdsec-haproxy-spoa-bouncer /lua /var/lib /crowdsec- haproxy-spoa-bouncer/html
3738
38- VOLUME [ "/usr/local /crowdsec/lua/haproxy/ " , "/var/lib/crowdsec/lua/ haproxy/templates /" ]
39+ VOLUME [ "/usr/lib /crowdsec-haproxy-spoa-bouncer /lua/" , "/var/lib/crowdsec- haproxy-spoa-bouncer/html /" ]
3940
4041RUN chmod +x /docker_start.sh
4142
Original file line number Diff line number Diff line change 66 log stdout format raw local0
77 lua-prepend-path /usr/lib/crowdsec-haproxy-spoa-bouncer/lua/?.lua
88 lua-load /usr/lib/crowdsec-haproxy-spoa-bouncer/lua/crowdsec.lua
9- setenv CROWDSEC_BAN_TEMPLATE_PATH /var/lib/crowdsec/lua/ haproxy/templates /ban.html
10- setenv CROWDSEC_CAPTCHA_TEMPLATE_PATH /var/lib/crowdsec/lua/ haproxy/templates /captcha.html
9+ setenv CROWDSEC_BAN_TEMPLATE_PATH /var/lib/crowdsec- haproxy-spoa-bouncer/html /ban.html
10+ setenv CROWDSEC_CAPTCHA_TEMPLATE_PATH /var/lib/crowdsec- haproxy-spoa-bouncer/html /captcha.html
1111
1212defaults
1313 log global
@@ -41,9 +41,9 @@ frontend test
4141 # tcp-request content reject if { var(txn.crowdsec.remediation) -m str "ban" }
4242
4343 ## Set a custom header on the request for upstream services to use
44- http-request set-header X-CrowdSec -Remediation %[var(txn.crowdsec.remediation)] if { var(txn.crowdsec.remediation) -m found }
44+ http-request set-header X-Crowdsec -Remediation %[var(txn.crowdsec.remediation)] if { var(txn.crowdsec.remediation) -m found }
4545 ## Set a custom header on the request for upstream services to use
46- http-request set-header X-CrowdSec -IsoCode %[var(txn.crowdsec.isocode)] if { var(txn.crowdsec.isocode) -m found }
46+ http-request set-header X-Crowdsec -IsoCode %[var(txn.crowdsec.isocode)] if { var(txn.crowdsec.isocode) -m found }
4747
4848 ## Handle 302 redirect for successful captcha validation (native HAProxy redirect)
4949 http-request redirect code 302 location %[var(txn.crowdsec.redirect)] if { var(txn.crowdsec.remediation) -m str "allow" } { var(txn.crowdsec.redirect) -m found }
Original file line number Diff line number Diff line change 33 log stdout format raw local0
44 lua-prepend-path /usr/lib/crowdsec-haproxy-spoa-bouncer/lua/?.lua
55 lua-load /usr/lib/crowdsec-haproxy-spoa-bouncer/lua/crowdsec.lua
6- setenv CROWDSEC_BAN_TEMPLATE_PATH /var/lib/crowdsec/lua/ haproxy/templates /ban.html
7- setenv CROWDSEC_CAPTCHA_TEMPLATE_PATH /var/lib/crowdsec/lua/ haproxy/templates /captcha.html
6+ setenv CROWDSEC_BAN_TEMPLATE_PATH /var/lib/crowdsec- haproxy-spoa-bouncer/html /ban.html
7+ setenv CROWDSEC_CAPTCHA_TEMPLATE_PATH /var/lib/crowdsec- haproxy-spoa-bouncer/html /captcha.html
88
99defaults
1010 log global
@@ -31,9 +31,9 @@ frontend test
3131 # tcp-request content reject if { var(txn.crowdsec.remediation) -m str "ban" }
3232
3333 ## Set a custom header on the request for upstream services to use
34- http-request set-header X-CrowdSec -Remediation %[var(txn.crowdsec.remediation)] if { var(txn.crowdsec.remediation) -m found }
34+ http-request set-header X-Crowdsec -Remediation %[var(txn.crowdsec.remediation)] if { var(txn.crowdsec.remediation) -m found }
3535 ## Set a custom header on the request for upstream services to use
36- http-request set-header X-CrowdSec -IsoCode %[var(txn.crowdsec.isocode)] if { var(txn.crowdsec.isocode) -m found }
36+ http-request set-header X-Crowdsec -IsoCode %[var(txn.crowdsec.isocode)] if { var(txn.crowdsec.isocode) -m found }
3737
3838 ## Handle 302 redirect for successful captcha validation (native HAProxy redirect)
3939 http-request redirect code 302 location %[var(txn.crowdsec.redirect)] if { var(txn.crowdsec.remediation) -m str "allow" } { var(txn.crowdsec.redirect) -m found }
Original file line number Diff line number Diff line change @@ -8,8 +8,8 @@ services:
88 - crowdsec
99 volumes :
1010 - sockets:/run/
11- - templates:/var/lib/crowdsec/lua/ haproxy/templates /
12- - lua:/usr/local /crowdsec/lua/haproxy /
11+ - templates:/var/lib/crowdsec- haproxy-spoa-bouncer/html /
12+ - lua:/usr/lib /crowdsec-haproxy-spoa-bouncer /lua/
1313 - geodb:/var/lib/crowdsec/data/
1414 - ./config/crowdsec-spoa-bouncer.yaml.local:/etc/crowdsec/bouncers/crowdsec-spoa-bouncer.yaml.local
1515 networks :
@@ -35,7 +35,7 @@ services:
3535 - ./config/haproxy-upstreamproxy.cfg:/usr/local/etc/haproxy/haproxy.cfg
3636 - ./config/crowdsec-upstreamproxy.cfg:/etc/haproxy/crowdsec.cfg
3737 - sockets:/run/
38- - templates:/var/lib/crowdsec/lua/ haproxy/templates /
38+ - templates:/var/lib/crowdsec- haproxy-spoa-bouncer/html /
3939 - lua:/usr/lib/crowdsec-haproxy-spoa-bouncer/lua/
4040 # HAProxy is now only accessible via nginx (not exposed directly)
4141 depends_on :
Original file line number Diff line number Diff line change @@ -9,8 +9,8 @@ services:
99 - crowdsec
1010 volumes :
1111 - sockets:/run/
12- - templates:/var/lib/crowdsec/lua/ haproxy/templates /
13- - lua:/usr/local /crowdsec/lua/haproxy /
12+ - templates:/var/lib/crowdsec- haproxy-spoa-bouncer/html /
13+ - lua:/usr/lib /crowdsec-haproxy-spoa-bouncer /lua/
1414 - geodb:/var/lib/crowdsec/data/
1515 - ./config/crowdsec-spoa-bouncer.yaml.local:/etc/crowdsec/bouncers/crowdsec-spoa-bouncer.yaml.local
1616 networks :
@@ -37,7 +37,7 @@ services:
3737 - ./config/haproxy.cfg:/usr/local/etc/haproxy/haproxy.cfg
3838 - ./config/crowdsec.cfg:/etc/haproxy/crowdsec.cfg
3939 - sockets:/run/
40- - templates:/var/lib/crowdsec/lua/ haproxy/templates /
40+ - templates:/var/lib/crowdsec- haproxy-spoa-bouncer/html /
4141 - lua:/usr/lib/crowdsec-haproxy-spoa-bouncer/lua/
4242 ports :
4343 - " 9090:9090"
You can’t perform that action at this time.
0 commit comments