Files
ubuntu-bare-metal/stacks/server-ui/README.md
T
tomasz-syn-grzegorza 359afb3a59 Initial import: bare-metal stacks, Server UI, GPU fan, tutorials.
Infrastructure configs for GMKtec K11 (Docker, vLLM, LocalAI, ComfyUI,
control-plane, gpu-fan agent, Server UI with CLI/file explorer/GPU fan curve).

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-05 12:02:04 +00:00

112 lines
4.1 KiB
Markdown

# Server UI — Docker stack manager
Własny panel do zarządzania znanymi stackami compose na **gmktec-k11**. Zastępuje Dockge i Portainer. Zawiera **przeglądarkę plików**, panel **GPU Fan** (proxy do agenta na hoście) i zarządzanie stackami.
## Dlaczego nie ma Server UI w `docker ps`?
`docker ps` pokazuje tylko **kontenery Docker**. Domyślna instalacja Server UI to **systemd na hoście** (`server-ui.service` na porcie **8091**) — nie pojawi się na liście kontenerów. To normalne.
| Usługa | Runtime | W `docker ps` |
|--------|---------|---------------|
| ComfyUI, LocalAI, vLLM, NPMPlus | Docker compose | tak |
| **Server UI** (native) | systemd → `/opt/server-ui` | **nie** |
| **gpu-fan** agent | systemd → `/opt/gpu-fan` | **nie** |
Sprawdzenie: `systemctl status server-ui` lub `docker compose --profile server-ui ps` (tryb Docker).
## Port
| Serwis | Port | URL |
|--------|------|-----|
| Server UI | **8091** | `http://HOST:8091` |
| CLI (zakładka) | — | ten sam URL, zakładka **CLI** lub `#cli` |
| Pliki (zakładka) | — | ten sam URL, zakładka **Pliki** lub `#files` |
| GPU Fan (zakładka) | — | ten sam URL, zakładka **GPU Fan** |
| gpu-fan agent API | **18090** | tylko localhost (proxy z Server UI) |
## Instalacja (zalecana — jeden skrypt)
```bash
cd ~/cursor/ubuntu-bare-metal/stacks/server-ui
sudo ./scripts/install-control-plane.sh
```
Menu:
1. **gpu-fan** — tylko native (NVML na hoście; Docker nieobsługiwany)
2. **Server UI** — native (systemd) lub Docker (kontener)
Flagi nieinteraktywne:
```bash
sudo ./scripts/install-control-plane.sh -y
sudo ./scripts/install-control-plane.sh --gpu-fan=yes --server-ui=docker
```
### Tylko Server UI
| Tryb | Komenda |
|------|---------|
| Native (systemd) | `sudo ./scripts/install.sh` |
| Docker | `sudo ./scripts/install-docker.sh` |
Klucze API po instalacji:
```bash
bash stacks/server-ui/scripts/show-api-key.sh
```
Tutorial klucza: [`../../manual-tutorial/04a-api-key.md`](../../manual-tutorial/04a-api-key.md)
Dev: `stacks/control-plane/.env` (szablon: `stacks/control-plane/.env.example`)
Tutorial: [`../../manual-tutorial/08-server-ui-install.md`](../../manual-tutorial/08-server-ui-install.md) · CLI: [`10-server-ui-cli.md`](../../manual-tutorial/10-server-ui-cli.md) · Pliki: [`09-file-explorer.md`](../../manual-tutorial/09-file-explorer.md)
## Stacki (whitelist)
| Stack | Profil | Port UI | GPU |
|-------|--------|---------|-----|
| LocalAI | `localai` | 8070 | tak |
| ComfyUI | `comfyui` | 8188 | tak |
| vLLM | `vllm` | 8000 | tak |
| NPMPlus | `npmplus` | 81 (HTTPS) | nie |
Porty edytowalne w UI (zapis do `stacks/<name>/.env`). Szczegóły: [`../../coding-agent/SERVER-UI-PORT-CONFIG.md`](../../coding-agent/SERVER-UI-PORT-CONFIG.md)
## Bezpieczeństwo
- Odczyt statusu stacków/logów/GPU — bez klucza (LAN).
- **Start / Stop / Restart** stacków, **GPU Fan**, **Pliki** (CRUD) i **CLI** — nagłówek `X-API-Key` (CLI: klucz w query WebSocket `?api_key=`).
- Przy `SERVER_UI_HOST=0.0.0.0` klucz jest **wymagany** przy starcie usługi.
## Tryb dev (z repo)
```bash
cp ../control-plane/.env.example ../control-plane/.env
./scripts/start.sh
```
## Struktura
```
stacks/server-ui/
├── app.py
├── Dockerfile
├── docker-compose.yml
├── compose_runner.py
├── stacks.yaml
├── server-ui.service
├── static/index.html
├── static/vendor/xterm/ # xterm.js dla zakładki CLI
├── cli_pty.py
└── scripts/
├── install-control-plane.sh # gpu-fan + server-ui (menu)
├── install.sh # native only
├── install-docker.sh # docker only
└── start.sh
```
## Dokumentacja
- [`../../manual-tutorial/08-server-ui-install.md`](../../manual-tutorial/08-server-ui-install.md)
- [`../../coding-agent/SERVER-UI-INSTALL-OPTIONS.md`](../../coding-agent/SERVER-UI-INSTALL-OPTIONS.md)
- [`../../coding-agent/DOCKER-UI-DEPLOYMENT.md`](../../coding-agent/DOCKER-UI-DEPLOYMENT.md)
- [`../../coding-agent/ADR-001-host-agent-control-plane.md`](../../coding-agent/ADR-001-host-agent-control-plane.md)