From ff5c88ecfdbab33af8e1cbbba8e662a03da566b1 Mon Sep 17 00:00:00 2001 From: Oliver Hofmann Date: Tue, 28 Apr 2026 08:41:18 +0200 Subject: [PATCH] Remove admin port binding from docker run example Port 8001 should not be exposed to the host directly. Add nginx reverse proxy and SSH tunnel examples instead. Co-Authored-By: Claude Sonnet 4.6 --- README.md | 31 ++++++++++++++++++++++++------- 1 file changed, 24 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 44a6237..a833c9f 100644 --- a/README.md +++ b/README.md @@ -85,7 +85,6 @@ docker build -t llm-quota . ```bash docker run -d \ -p 8000:8000 \ - -p 8001:8001 \ -e ADMIN_PASSWORD=geheim \ -e OLLAMA_URL=http://host.docker.internal:11434 \ -e DATABASE_URL=sqlite:///./data/quota.db \ @@ -94,27 +93,45 @@ docker run -d \ llm-quota ``` +Port 8001 (Admin) wird bewusst **nicht** an den Host gebunden. Die Admin-Oberfläche ist über einen Reverse-Proxy zu exponieren (siehe unten). + | Port | Dienst | |------|--------| -| `8000` | Proxy (für LLM-Clients) | -| `8001` | Admin-API + Admin-Oberfläche | +| `8000` | Proxy (für LLM-Clients, öffentlich) | +| `8001` | Admin-API + Admin-Oberfläche (nur intern) | -Admin-Oberfläche: `http://localhost:8001` +### Admin-Oberfläche via Reverse-Proxy zugänglich machen + +Beispiel mit nginx — Port 8001 intern weiterleiten, nach außen absichern: + +```nginx +server { + listen 443 ssl; + server_name admin.example.com; + + location / { + proxy_pass http://localhost:8001; + } +} +``` + +Oder temporär für lokalen Zugriff per SSH-Tunnel: + +```bash +ssh -L 8001:localhost:8001 user@server +``` ### Mit PostgreSQL ```bash docker run -d \ -p 8000:8000 \ - -p 8001:8001 \ -e ADMIN_PASSWORD=geheim \ -e DATABASE_URL=postgresql://user:pass@db-host:5432/llm_quota \ -e OLLAMA_URL=http://ollama:11434 \ llm-quota ``` -> **Hinweis:** Im Container bindet die Admin-API auf `0.0.0.0`. Port 8001 sollte nicht öffentlich exponiert werden — entweder per Firewall absichern oder hinter einem Reverse-Proxy (nginx, Caddy) betreiben. - ## Proxy-Endpunkte (Port 8000) Alle Endpunkte erfordern einen gültigen API-Key im `Authorization`-Header.