Skip to content

Commit eaebac8

Browse files
committed
[major] Prefer multi-layer routing for v2
Breaking changes: - Requires Traefik v3.6 or newer so deployments can use multi-layer routing parentRefs. - Removes `ipv4subnetMask`, `ipv6subnetMask`, and `rateLimit`. Given the distributed nature of bots these config values have become additional config/logic that adds no real value. Most crawlers at this point are issuing a small amount of requests per IP across a wide range of subnets. - Removes `enableStateReconciliation` and all state reconciliation code. `persistentStateFile` is now restart persistence only, not multi-instance coordination. - Makes Traefik multi-layer routing the preferred multi-service protection model: attach captcha-protect to one parent router and route accepted traffic through child routers. Implementation notes: - Adds first-class CI coverage for the documented file-provider multi-layer routing config across Traefik v3.6, v3.7, and latest. - Drops older Traefik integration targets below v3.6. - Keeps Docker label smoke coverage for single-router provider configuration. - Updates README and plugin metadata for the v2 behavior and Traefik baseline. Closes #95
1 parent 89cec5a commit eaebac8

17 files changed

Lines changed: 289 additions & 2494 deletions

.github/workflows/lint-test.yml

Lines changed: 26 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -53,43 +53,59 @@ jobs:
5353
env:
5454
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
5555

56-
integration-test-latest:
56+
integration-test-labels:
5757
needs: [run]
5858
permissions:
5959
contents: read
6060
runs-on: ubuntu-24.04
61+
strategy:
62+
fail-fast: false
63+
matrix:
64+
traefik: [v3.6, v3.7, latest]
65+
env:
66+
TRAEFIK_TAG: ${{ matrix.traefik }}
6167
steps:
6268
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7
6369

6470
- name: run
6571
run: go run test.go
6672
working-directory: ./ci
67-
env:
68-
TRAEFIK_TAG: latest
73+
74+
- name: capture logs
75+
if: ${{ always() }}
76+
run: docker compose logs --tail 100 nginx nginx2 traefik
77+
working-directory: ./ci
6978

7079
- name: cleanup
7180
if: ${{ always() }}
72-
run: docker compose logs --tail 100 nginx nginx2 traefik && docker compose down
81+
run: docker compose down
7382
working-directory: ./ci
7483

75-
integration-test:
76-
needs: [integration-test-latest]
84+
integration-test-multilayer-routing:
85+
needs: [run]
7786
permissions:
7887
contents: read
7988
runs-on: ubuntu-24.04
8089
strategy:
90+
fail-fast: false
8191
matrix:
82-
traefik: [v2.11, v3.0, v3.1, v3.2, v3.3, v3.4, v3.5, v3.6, v3.7]
92+
traefik: [v3.6, v3.7, latest]
93+
env:
94+
COMPOSE_FILE: docker-compose.multilayer.yml
95+
TRAEFIK_TAG: ${{ matrix.traefik }}
8396
steps:
8497
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7
8598

8699
- name: run
87100
run: go run test.go
88101
working-directory: ./ci
89-
env:
90-
TRAEFIK_TAG: ${{ matrix.traefik }}
102+
103+
- name: capture logs
104+
if: ${{ always() }}
105+
run: docker compose logs --tail 100 nginx nginx2 traefik
106+
working-directory: ./ci
91107

92108
- name: cleanup
93109
if: ${{ always() }}
94-
run: docker compose logs --tail 100 nginx nginx2 traefik && docker compose down
110+
run: docker compose down
95111
working-directory: ./ci

.github/workflows/stress-test.yaml

Lines changed: 0 additions & 60 deletions
This file was deleted.

.traefik.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
11
displayName: Captcha Protect
2-
summary: Add an anti-bot challenge to individual IPs in a subnet when traffic spikes are detected from that subnet
2+
summary: Add an anti-bot challenge to protected routes
33
type: middleware
44
import: github.com/libops/captcha-protect
55
testData:
66
ProtectRoutes: /
77
ChallengeTmpl: challenge.tmpl.html
88
Window: 86400
9-
RateLimit: 20
109
IPForwardedHeader: "X-Forwarded-For"
1110
CaptchaProvider: turnstile
1211
SiteKey: 1x00000000000000000000AA
1312
SecretKey: 1x0000000000000000000000000000000AA
14-
EnableStateReconciliation: "false"

0 commit comments

Comments
 (0)