add theming

This commit is contained in:
mr0xb 2026-08-24 15:43:03 -04:00
commit 8639799f6d
10 changed files with 1069 additions and 287 deletions

View file

@ -4,7 +4,7 @@
# // NXSTATS //
A fast nginx log parser that generates cyberpunk-themed HTML reports with charts, searchable tables, and optional GeoIP2 hit maps.
A fast nginx log parser that generates themeable HTML reports with charts, searchable tables, and optional GeoIP2 hit maps.
![Dashboard overview](screenshot1.png)
@ -19,6 +19,7 @@ A fast nginx log parser that generates cyberpunk-themed HTML reports with charts
- Searchable, filterable **access log table** with status badges
- Optional **GeoIP2 world map** (Leaflet.js) when a MaxMind `.mmdb` is supplied
- **Split-by-day** mode writes one report per calendar day plus a summary index page
- Three built-in **themes**`cyberpunk` (neon dark), `purplerain` (modern purple dark), `cactus` (pastel green light)
- Zero runtime dependencies — the binary is statically compiled Go
## Installation
@ -52,6 +53,7 @@ nxstats [flags]
| `--geoip` | | | Path to MaxMind `GeoLite2-City.mmdb` (enables map) |
| `--no-gzip` | | `false` | Skip `.gz` compressed rotated logs |
| `--split-by-day` | | `false` | Write one HTML report per calendar day plus index |
| `--theme` | | `cyberpunk` | Report visual theme: `cyberpunk`, `purplerain`, `cactus` |
### Examples
@ -76,6 +78,11 @@ nxstats --dir /var/log/nginx --split-by-day -o index.html
# Writes index.html + 2024-01-15.html, 2024-01-16.html, etc.
```
**With a different theme:**
```bash
nxstats --dir /var/log/nginx --theme purplerain -o report.html
```
## GeoIP2 Setup
The geographic distribution map requires a free MaxMind GeoLite2-City database.