fix - carto now requires api keys
This commit is contained in:
parent
9cfec42104
commit
3a3307e190
9 changed files with 100 additions and 6 deletions
21
README.md
21
README.md
|
|
@ -6,9 +6,9 @@
|
|||
|
||||
A fast nginx log parser that generates themeable HTML reports with charts, searchable tables, and optional GeoIP2 hit maps.
|
||||
|
||||

|
||||

|
||||
|
||||

|
||||

|
||||
|
||||
## Features
|
||||
|
||||
|
|
@ -54,6 +54,7 @@ nxstats [flags]
|
|||
| `--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` |
|
||||
| `--map-api-key` | | | CARTO basemap API key, appended to tile URLs as `?key=` (env: `NXSTATS_MAP_API_KEY`) |
|
||||
|
||||
### Examples
|
||||
|
||||
|
|
@ -78,6 +79,12 @@ 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 CARTO basemap API key (required for map tiles):**
|
||||
```bash
|
||||
nxstats --geoip ./GeoLite2-City.mmdb --map-api-key XYZ -o report.html
|
||||
# or: NXSTATS_MAP_API_KEY=XYZ nxstats --geoip ./GeoLite2-City.mmdb -o report.html
|
||||
```
|
||||
|
||||
**With a different theme:**
|
||||
```bash
|
||||
nxstats --dir /var/log/nginx --theme purplerain -o report.html
|
||||
|
|
@ -91,6 +98,16 @@ The geographic distribution map requires a free MaxMind GeoLite2-City database.
|
|||
2. Download `GeoLite2-City.mmdb`
|
||||
3. Pass the path via `--geoip ./GeoLite2-City.mmdb`
|
||||
|
||||
## Basemap API Key
|
||||
|
||||
The map's background tiles come from [CARTO](https://carto.com/), which now
|
||||
requires an API key. Create one in the CARTO dashboard and pass it with
|
||||
`--map-api-key` (or set `NXSTATS_MAP_API_KEY`); it is appended to the theme's
|
||||
tile URL as `?key=...` in the generated report. Note that the key is embedded
|
||||
in the HTML output, so treat generated reports as you would the key itself.
|
||||
|
||||
Without a key the map still renders, but tiles may come back blank.
|
||||
|
||||
## Log Format
|
||||
|
||||
nxstats expects the standard nginx combined log format for access logs:
|
||||
|
|
|
|||
Loading…
Reference in a new issue