Files
ntfywui/README.md
2026-01-12 13:51:52 +01:00

70 lines
2.2 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# ntfywui (Go) Webinterface für ntfy User/ACL/Token Verwaltung
Dieses Projekt stellt ein **sicheres Webinterface** bereit, um die ntfy **CLI-Administration** (Users, ACL/Access, Tokens) bequem im Browser zu machen.
- **Golang, Standardbibliothek-only** (keine externen deps)
- Arbeitet **gegen die lokale ntfy Auth-DB** über die ntfy CLI (im Container enthalten)
- **CSRF-Schutz**, **Secure Headers (CSP)**, **verschlüsselte Sessions (AES-GCM)**, **Rate-Limit**
- **WebUI-Admins** separat von ntfy-Users (inkl. optionalem TOTP-2FA)
- **Audit Log** (JSONL)
## Quickstart (Docker Compose)
1) `.env` anlegen:
```bash
cp .env.example .env
# SECRET erzeugen (Beispiel): openssl rand -base64 48
```
2) Stelle sicher, dass `/etc/ntfy/server.yml` Authentication aktiv hat, z.B.:
```yaml
auth-file: "/var/lib/ntfy/user.db"
auth-default-access: "deny-all"
```
3) Start:
```bash
docker compose up -d --build
```
- ntfy: http://localhost:8080
- ntfywui: http://localhost:8090
## Wichtige Hinweise (Sicherheit)
- **NTFYWUI_SECRET ist Pflicht** (>=32 Bytes; base64 empfohlen).
- Setze `NTFYWUI_COOKIE_SECURE=true` (Default). Für reines HTTP-Lab ggf. `false`.
- Wenn du einen Reverse Proxy davor hast, setze `NTFYWUI_TRUST_PROXY` nur auf **deine Proxy-CIDRs**,
damit `X-Forwarded-For` nicht spoofbar ist.
- Vergib WebUI-Admin-Rechte sparsam:
- `viewer`: read-only (Users anzeigen)
- `operator`: Users/ACL/Tokens verwalten
- `admin`: zusätzlich Admins/Audit verwalten
## Konfiguration (Env/Flags)
- `NTFYWUI_LISTEN` (Default `:8080`)
- `NTFYWUI_BASE_PATH` (z.B. `/ntfywui`)
- `NTFYWUI_DATA_DIR` (Default `/data`) `admins.json`, `audit.jsonl`
- `NTFYWUI_SECRET` (required)
- `NTFYWUI_COOKIE_SECURE` (Default `true`)
- `NTFYWUI_TRUST_PROXY` (CIDRs, z.B. `10.0.0.0/8,172.16.0.0/12`)
- `NTFYWUI_NTFY_BIN` (Default `/usr/bin/ntfy`)
- `NTFYWUI_NTFY_CONFIG` (Default `/etc/ntfy/server.yml`)
- `NTFYWUI_NTFY_TIMEOUT` (Default `10s`)
- Bootstrap:
- `NTFYWUI_BOOTSTRAP_USER`
- `NTFYWUI_BOOTSTRAP_PASS`
## Limitierungen
- Das UI parst die Textausgabe von `ntfy user list` / `ntfy token list` best-effort.
- Für sehr große Auth-DBs kann `Audit Tail` (einfaches File-Read) angepasst werden.
## Lizenz
MIT mach damit was du willst.