From 239762fd3a6757187132435785da6265f55fa724 Mon Sep 17 00:00:00 2001 From: Edwin Noorlander Date: Wed, 29 Jul 2026 14:26:48 +0200 Subject: [PATCH] CodePress CMS v1.8.0: BotGuard security engine, HAProxy docs & ARIA fix - Implement BotGuard security engine (Bot, AI, Scraper & Empty UA blocking) - Add Admin Security page (/admin/security) with toggles, rate limiter & block/allowlists - Add per-IP RateLimiter handoff in index.php with HTTP 429 response - Add dynamic /robots.txt generation and noai/noimageai meta tags - Add RequestLogger status column and blocked badges in admin request logs - Fix ARIAComponents.php syntax errors on lines 67, 137, 262 - Add HAProxy / PFSense bot blocking & IP forwarding guide (docs/haproxy-bot-blocking.md) - Update version to 1.8.0 with release notes in version.php and guides --- TODO.md | 2 +- admin/templates/layout.php | 8 ++ admin/templates/pages/logs.php | 18 ++- admin/templates/pages/security.php | 114 +++++++++++++++++ cms/core/class/ARIAComponents.php | 6 +- cms/core/class/BotGuard.php | 189 +++++++++++++++++++++++++++++ cms/core/class/CodePressCMS.php | 2 + cms/core/class/RequestLogger.php | 134 ++++++-------------- cms/core/config.php | 12 ++ cms/core/index.php | 3 + cms/templates/layout.mustache | 7 ++ config.json.example | 12 ++ docs/haproxy-bot-blocking.md | 67 ++++++++++ guide/en.codepress.md | 2 + guide/nl.codepress.md | 1 + public/admin.php | 62 ++++++++++ public/index.php | 77 ++++++++++-- version.php | 19 ++- 18 files changed, 618 insertions(+), 117 deletions(-) create mode 100644 admin/templates/pages/security.php create mode 100644 cms/core/class/BotGuard.php create mode 100644 docs/haproxy-bot-blocking.md diff --git a/TODO.md b/TODO.md index 351274b..bcc6799 100644 --- a/TODO.md +++ b/TODO.md @@ -87,4 +87,4 @@ - [ ] **Keyboard shortcuts** — Ctrl+S om op te slaan in editor, Ctrl+N voor nieuw bestand - [ ] **Dark mode** — Admin panel dark mode toggle - [ ] **Responsive admin** — Admin sidebar inklapbaar op mobiel (nu is het gestacked) -- [ ] **ARIAComponents.php parse error** — Bestaande PHP parse error op regel 67 (`syntax error, unexpected double-quote mark`) +- [x] **ARIAComponents.php parse error** — Bestaande PHP parse error op regel 67 opgelost (`'UTF-8)` -> `'UTF-8')`) diff --git a/admin/templates/layout.php b/admin/templates/layout.php index 1653113..6cf2b9d 100644 --- a/admin/templates/layout.php +++ b/admin/templates/layout.php @@ -66,6 +66,11 @@ $layoutSidebarColor = $layoutThemeConfig['header_color'] ?? '#0a369d'; Configuratie +