You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-**Per-IP rate limiting:** protects the HTTP server from abuse with a configurable token-bucket middleware. Enabled by default (120 req/min, burst 20). Skipped for `/metrics` and `/api/v1/healthz`. Configure via `GGHSTATS_RATE_LIMIT_*` env vars; set `GGHSTATS_RATE_LIMIT_ENABLED=false` to disable.
14
+
15
+
### Security
16
+
17
+
- Rate limiting mitigates M7 from the professionalism audit (no protection on `POST /api/v1/sync`).
Copy file name to clipboardExpand all lines: README.md
+15-1Lines changed: 15 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -118,11 +118,13 @@ Tap: [homebrew-gghstats](https://github.com/hrodrig/homebrew-gghstats). The cask
118
118
### Local binary (fastest try)
119
119
120
120
```bash
121
-
# From Releases: extract gghstats_*_linux_* archive, or: go install github.com/hrodrig/gghstats/cmd/gghstats@latest
121
+
curl -fsSL https://raw.githubusercontent.com/hrodrig/gghstats/main/scripts/install.sh | sh
122
122
export GGHSTATS_GITHUB_TOKEN=ghp_xxx
123
123
gghstats run --open
124
124
```
125
125
126
+
Or extract a [Release](https://github.com/hrodrig/gghstats/releases) tarball, or `go install github.com/hrodrig/gghstats/cmd/gghstats@latest`. Pin a version: `VERSION=v0.7.4 curl -fsSL …/install.sh | sh`.
127
+
126
128
Open <http://localhost:8080> if you did not use **`--open`**. Data is stored in `./data/gghstats.db` (override with `GGHSTATS_DB`). A first sync may take a while if the default filter includes many repositories — narrow `GGHSTATS_FILTER` in [Configuration](#configuration) when you move beyond this smoke test.
127
129
128
130
### Docker (one command, no clone — UI smoke test)
@@ -159,6 +161,14 @@ Open <http://localhost:8080>. The template [`.env.example`](.env.example) docume
159
161
160
162
**Quick install** — get the binary on your machine. **Configuration on a server, systemd, `.deb`/`.rpm` setup, Compose, Traefik, Helm, env files, and VPS deployment** are documented only in **[gghstats-selfhosted](https://github.com/hrodrig/gghstats-selfhosted)** ([`run/`](https://github.com/hrodrig/gghstats-selfhosted/tree/main/run), [`run/standalone/linux/`](https://github.com/hrodrig/gghstats-selfhosted/blob/main/run/standalone/linux/README.md) for Linux packages and systemd).
161
163
164
+
**One-liner (Linux, macOS, BSD — no Docker):**
165
+
166
+
```bash
167
+
curl -fsSL https://raw.githubusercontent.com/hrodrig/gghstats/main/scripts/install.sh | sh
168
+
```
169
+
170
+
Downloads the latest [release](https://github.com/hrodrig/gghstats/releases) archive for your OS/arch into `/usr/local/bin` (override with `BINDIR=~/bin`). Review [`scripts/install.sh`](scripts/install.sh) before piping to `sh`; pin with `VERSION=v0.7.4`.
171
+
162
172
**From source (recommended for developers):**
163
173
164
174
```bash
@@ -361,6 +371,10 @@ Copy [`.env.example`](.env.example) → `.env` in this repository when running `
361
371
|`GGHSTATS_CUSTOM_CSS`| (none) | Optional **regular**`.css` file: loaded **after** built-in `app.css` at `/theme/custom.css` so you can tone down neo-brutalism or replace accents (see [Custom UI theme](#custom-ui-theme-optional)) |
362
372
|`GGHSTATS_DEFAULT_LOCALE`|`en`| Default **dashboard** language when no cookie, `?lang=`, or `Accept-Language` match (see [Web UI languages](#web-ui-languages-i18n)) |
363
373
|`GGHSTATS_ENABLED_LOCALES`|`en,es,de`| Comma-separated locales shown in the sidebar selector and accepted from `?lang=` / cookie |
374
+
|`GGHSTATS_RATE_LIMIT_ENABLED`|`true`| Set to `false` to disable per-IP rate limiting |
375
+
|`GGHSTATS_RATE_LIMIT_REQUESTS`|`120`| Requests per time window before limiting (per IP) |
376
+
|`GGHSTATS_RATE_LIMIT_PERIOD`|`1m`| Time window for rate limiting (Go duration, e.g. `30s`, `5m`) |
377
+
|`GGHSTATS_RATE_LIMIT_BURST`|`20`| Maximum burst of requests allowed before smoothing kicks in |
0 commit comments