131 lines
4.3 KiB
Markdown
131 lines
4.3 KiB
Markdown
# Privacy Gateway - Deployment Anleitung
|
|
|
|
## Übersicht
|
|
- **Container:** CT150
|
|
- **IP:** 192.168.0.150
|
|
- **Services:** PostgreSQL, Ollama (Anonymisierung), Redis, Backend, Frontend, Portainer Agent
|
|
|
|
## Schnellstart
|
|
|
|
### 1. CT auf Proxmox erstellen
|
|
```bash
|
|
# Auf Proxmox Host ausführen:
|
|
bash deploy-ct150.sh
|
|
```
|
|
|
|
### 2. Projekt kopieren
|
|
```bash
|
|
# Vom Workspace aus:
|
|
scp -r /root/.openclaw/workspace/privacy-gateway/* root@192.168.0.150:/opt/privacy-gateway/
|
|
```
|
|
|
|
### 3. Setup abschließen
|
|
```bash
|
|
ssh root@192.168.0.150
|
|
chmod +x /opt/privacy-gateway/setup-ct150.sh
|
|
bash /opt/privacy-gateway/setup-ct150.sh
|
|
```
|
|
|
|
## Manuelle Installation (falls nötig)
|
|
|
|
### Schritt 1: CT erstellen
|
|
```bash
|
|
pct create 150 local:vztmpl/debian-12-standard_12.7-1_amd64.tar.zst \
|
|
--hostname privacy-gateway \
|
|
--storage local-zfs \
|
|
--rootfs 32G \
|
|
--memory 8192 \
|
|
--cores 4 \
|
|
--net0 name=eth0,bridge=vmbr0,ip=192.168.0.150/22,gw=192.168.0.1 \
|
|
--unprivileged 1 \
|
|
--features nesting=1
|
|
|
|
pct start 150
|
|
```
|
|
|
|
### Schritt 2: Docker installieren
|
|
```bash
|
|
pct exec 150 -- bash -c "
|
|
apt-get update
|
|
apt-get install -y curl git ca-certificates
|
|
install -m 0755 -d /etc/apt/keyrings
|
|
curl -fsSL https://download.docker.com/linux/debian/gpg | gpg --dearmor -o /etc/apt/keyrings/docker.gpg
|
|
echo 'deb [arch=amd64 signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/debian bookworm stable' > /etc/apt/sources.list.d/docker.list
|
|
apt-get update
|
|
apt-get install -y docker-ce docker-ce-cli containerd.io docker-compose-plugin
|
|
"
|
|
```
|
|
|
|
### Schritt 3: Projekt deployen
|
|
```bash
|
|
mkdir -p /opt/privacy-gateway
|
|
cd /opt/privacy-gateway
|
|
# Kopiere alle Dateien...
|
|
docker compose -f docker-compose.ct150.yml up -d
|
|
```
|
|
|
|
## URLs nach Deployment
|
|
- **Web UI:** http://192.168.0.150
|
|
- **API:** http://192.168.0.150:3000
|
|
- **Health:** http://192.168.0.150:3000/health
|
|
- **Portainer Agent:** Port 9001 (für externen Portainer)
|
|
|
|
## Konfiguration
|
|
|
|
### Environment-Variablen
|
|
```bash
|
|
# In /opt/privacy-gateway/.env:
|
|
DB_PASSWORD=dein-sicheres-passwort
|
|
OLLAMA_TARGET_HOST=192.168.2.122 # Dein Ollama Server
|
|
CHAT_MODEL=llama3.2:latest
|
|
```
|
|
|
|
### Modelle
|
|
Das System braucht:
|
|
1. **Gemma4** (im Anonymizer-Container) - für PII-Erkennung
|
|
2. **Externes Modell** (z.B. auf 192.168.2.122) - für Antworten
|
|
|
|
## Troubleshooting
|
|
|
|
### Logs ansehen
|
|
```bash
|
|
docker compose logs -f [service-name]
|
|
```
|
|
|
|
### Services neu starten
|
|
```bash
|
|
docker compose restart
|
|
```
|
|
|
|
### Modelle laden
|
|
```bash
|
|
docker exec ollama-privacy ollama pull gemma4:latest
|
|
```
|
|
|
|
## Architektur
|
|
```
|
|
┌─────────────┐ ┌──────────────┐ ┌──────────────┐ ┌─────────────┐
|
|
│ Browser │────▶│ Frontend │────▶│ Backend │────▶│ Postgres │
|
|
│ │◄────│ (Nginx) │◄────│ (Node.js) │◄────│ │
|
|
└─────────────┘ └──────────────┘ └──────┬───────┘ └─────────────┘
|
|
│
|
|
┌─────────────────────────┼─────────────────────────┐
|
|
│ │ │
|
|
▼ ▼ ▼
|
|
┌──────────────┐ ┌──────────────┐ ┌──────────────┐
|
|
│ Redis │ │ Anonymizer │ │ Externes │
|
|
│ (Cache) │ │ (Ollama) │ │ Ollama │
|
|
└──────────────┘ └──────────────┘ └──────────────┘
|
|
```
|
|
|
|
## Git Repository
|
|
Nach erfolgreichem Test:
|
|
```bash
|
|
cd /opt/privacy-gateway
|
|
git init
|
|
git remote add origin http://192.168.0.146:3000/peter/privacy-gateway.git
|
|
git add .
|
|
git commit -m "Initial deployment CT150"
|
|
git push -u origin master
|
|
```
|