From 0d50cf6a51bd2d6b6fb642e645b12fbca3b229eb Mon Sep 17 00:00:00 2001 From: CyberMind-FR Date: Sun, 12 Jul 2026 07:51:44 +0200 Subject: [PATCH] fix(billets): reskin /billets/ panel to WebUI guideline + per-client login rate-limit - /billets/ management panel rebuilt to the SecuBox WebUI Panel Guidelines (certs reference): restrained header + stat grid + glass cards + dense list + toast, dropping the funky hero/blobs. Cyan, Courier Prime, emoji glyphs. - Login rate-limit now keys on the real client via X-Forwarded-For (admin _client_ip) instead of the shared proxy IP, so one operator's attempts no longer lock out everyone. nginx preserves the XFF chain (X-Real-IP + $proxy_add_x_forwarded_for). Co-Authored-By: Gerald KERMA --- packages/secubox-billets/api/routes/admin.py | 5 + packages/secubox-billets/deploy/nginx.conf | 3 +- .../secubox-billets/www/billets/index.html | 199 +++++++++--------- 3 files changed, 105 insertions(+), 102 deletions(-) diff --git a/packages/secubox-billets/api/routes/admin.py b/packages/secubox-billets/api/routes/admin.py index a65fc733..d1ef4bc9 100644 --- a/packages/secubox-billets/api/routes/admin.py +++ b/packages/secubox-billets/api/routes/admin.py @@ -33,6 +33,11 @@ def _now(request: Request) -> str: def _client_ip(request: Request) -> str: + # Honour X-Forwarded-For (set by the nginx→sbxwaf→HAProxy chain) so the + # login rate-limit keys on the real client, not the shared proxy IP. + fwd = request.headers.get("x-forwarded-for", "") + if fwd: + return fwd.split(",")[0].strip() return request.client.host if request.client else "0.0.0.0" diff --git a/packages/secubox-billets/deploy/nginx.conf b/packages/secubox-billets/deploy/nginx.conf index f9b73af8..2dc500f0 100644 --- a/packages/secubox-billets/deploy/nginx.conf +++ b/packages/secubox-billets/deploy/nginx.conf @@ -21,7 +21,8 @@ server { proxy_http_version 1.1; proxy_set_header Host $host; proxy_set_header X-Forwarded-Proto $scheme; - proxy_set_header X-Forwarded-For $remote_addr; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_read_timeout 30s; client_max_body_size 1m; } diff --git a/packages/secubox-billets/www/billets/index.html b/packages/secubox-billets/www/billets/index.html index f44c3ec5..0e04a3bf 100644 --- a/packages/secubox-billets/www/billets/index.html +++ b/packages/secubox-billets/www/billets/index.html @@ -3,59 +3,54 @@ -📮 Billets — SecuBox - +SecuBox — Billets + + @@ -63,51 +58,46 @@
-
- -
- -

📮 Billets

-

Micro-blog gateway inter-médias sociaux — publie court, embarque, republie 🌍

-
+
+ + ✍️ Nouveau + 🚀 Blog + 🔐 Admin + 📡 Flux +
+ -
-
📝
Billets publiés
-
📄
Brouillons
-
💬
Commentaires
-
Réactions
+
+
📝 Publiés
+
📄 Brouillons
+
💬 Commentaires
+
✨ Réactions
-
- -
- 🚀 Ouvrir le blog - ✍️ Nouveau billet - 🔐 Admin - 📡 Flux Atom +
+

✨ Réactions

+
-
-

🕒 Derniers billets

+
+

🕒 Derniers billets

Chargement… ⏳

-
- -
+
+
+