Transform banTemplate to add blocking reason and client IP (#290)

*  Transform banTemplate to add blocking reason

* 🍱 fix test

* 🍱 fix lint

* 🍱 fix test

* 🍱 fix lint

* 🍱 fix lint

* 🍱 add doc and fix lint

* 🍱 fix lint

* 🍱 fix lint

* 🍱 fix lint

* 🍱 fix lint

* 🍱 fix lint

* 🍱 lint html

* 🍱 fix comments + fix wicketpeeker readme

* 🍱 Give ClientIP in ban page

* 🍱 fix test
This commit is contained in:
maxlerebourg
2025-11-15 10:42:14 +01:00
committed by GitHub
parent 2aac531ea7
commit 4ab4f3f183
7 changed files with 61 additions and 48 deletions
+10
View File
@@ -45,3 +45,13 @@ To play the demo environment run:
```bash
make run_custom_ban_page
```
## Another thing to note
In the html of the ban page, you can use:
- {{ .ClientIP }} to display the IP used to ban the request.
- {{ .RemediationReason }} that convert on runtime into why the ban page is served. It's an enum with "APPSEC", "LAPI", "TECHNICAL_ISSUE" and it is useful to help user understand why the request is blocked.
```
<script>var remediation = "{{ .RemediationReason }}"</script>
<script>var clientIp = "{{ .ClientIP }}"</script>
```
With the above tweak and some other js, you can customize your ban page on runtime.