Add request log to dashboard, update guides with logging docs
This commit is contained in:
@@ -9,6 +9,7 @@
|
||||
- [Configuration](#configuration)
|
||||
- [Content Structure](#content-structure)
|
||||
- [Admin Console](#admin-console)
|
||||
- [Logging & Request Log](#logging--request-log)
|
||||
- [Templates](#templates)
|
||||
- [URL Structure](#url-structure)
|
||||
- [SEO Optimization](#seo-optimization)
|
||||
@@ -86,6 +87,8 @@ CodePress CMS is a lightweight, file-based content management system built with
|
||||
- **Media management** - Upload and delete media files in `content/-assets/`
|
||||
- **User management** - Add, remove users, change passwords
|
||||
- **Guide** - Built-in documentation with API reference
|
||||
- **Logging** - Activity log and request log with IP, page, domain; view and download via `/admin/logs`
|
||||
- **Bot & AI blocking** - Automatic 403 for known bots and AI crawlers
|
||||
- Session-based authentication with bcrypt hashing
|
||||
- CSRF protection, brute-force lockout (5 attempts, 15 min)
|
||||
- Default login: `admin` / `admin` (change immediately after installation)
|
||||
@@ -310,6 +313,7 @@ Media files (images, PDFs, video, audio) can be placed in any `content/` subdire
|
||||
| `media-list` | JSON list of all media (for editor modal) |
|
||||
| `users` | User management |
|
||||
| `guide` | Guide / documentation |
|
||||
| `logs` | Log viewer (activity + requests) |
|
||||
|
||||
### Editor Features
|
||||
|
||||
@@ -324,6 +328,27 @@ The content editor (`content-edit`, `content-new`) includes:
|
||||
- **Upload and "Create" buttons** are disabled until input is provided
|
||||
- **"Cancel" button** (instead of "Back") for unsaved changes
|
||||
|
||||
### Logging & Request Log
|
||||
|
||||
The admin console maintains two logs:
|
||||
|
||||
- **Activity log** (`admin/storage/logs/admin.log`) — admin actions like creating, editing, deleting pages, enabling/disabling plugins, changing configuration.
|
||||
- **Request log** (`admin/storage/logs/requests.log`) — every page view on the website, including IP, page, domain, language, user agent, and referrer.
|
||||
|
||||
Both logs can be viewed and downloaded via **`/admin/logs`** or the sidebar "Logs" link. The dashboard shows the last 20 entries of each log. Click "View all →" for the full list, where you can also download or clear.
|
||||
|
||||
### Bot & AI Blocking
|
||||
|
||||
Incoming requests are checked against known bot and AI crawler patterns via the User-Agent header. Detected bots receive a **403 Forbidden** response.
|
||||
|
||||
Blocked categories:
|
||||
|
||||
| Category | Examples |
|
||||
|---|---|
|
||||
| AI Crawlers | GPTBot, ChatGPT-User, Claude-Web, ClaudeBot, Google-Extended, CCBot, PerplexityBot |
|
||||
| Search Engines | Googlebot, Bingbot, BingPreview, DuckDuckBot, YandexBot, Baiduspider |
|
||||
| Scrapers | HTTrack, Scrapy, PhantomJS |
|
||||
|
||||
## Templates
|
||||
|
||||
### Template Variables
|
||||
|
||||
Reference in New Issue
Block a user