🖥️ Server Infrastruktura¶
Základní údaje
IP: 46.224.121.179 SSH: ssh root@46.224.121.179 OS: Ubuntu/Debian (Hetzner)
🌐 Domény a Nginx¶
| Doména | Port | Backend | Popis |
|---|---|---|---|
| chat.czechai.io | 3002 | Node.js (PM2) | 🎯 CzechAI Cockpit Frontend |
| law.czechai.io | 3000 | Node.js (PM2) | ⚖️ Právník AI |
| hub.czechai.io | 8080 | Docker (Dify) | 🤖 Dify AI Platform |
| app.czechai.io | 3001 | Docker | 📱 Cockpit Backend |
| pardubice.czechai.io | 5050 | Python Flask | 🏠 Reality Pardubice |
| router.czechai.io | 8090 | Python Flask | 🔄 Router Tower API |
| router.czechai.io/docs/ | 8085 | MkDocs | 📚 Tato dokumentace |
| router.czechai.io/web/ | static | Nginx | 🌍 Veřejné stránky |
| n8n.czechai.io | 5678 | Docker | ⚡ Workflow Automation |
| leads.czechai.io | 3030 | Node.js (PM2) | 📋 Leady formulář |
| test1.czechai.io | 3031 | Node.js (PM2) | 🧪 Test dashboard |
⚙️ PM2 Procesy¶
Hlavní aplikace
| Název | Script | CWD | Port |
|---|---|---|---|
chat-frontend | npm start | /opt/czechai-cockpit-full/Czech-AI-Cockpit | 3002 |
czech-legal-ai | npm start | /root/apps/czech-legal-ai | 3000 |
czechai-api | api_server.py | /opt/czechai-api | 5000 |
pardubice | flask_app.py | /root/apps/pardubice | 5050 |
reality-api | app.py | /opt/reality-api | 3003 |
router-api | server.py | /opt/router-api | 8090 |
leads-dashboard | dist/index.cjs | /root/apps/leads-dashboard | 3030 |
test1-dashboard | dist/index.cjs | /root/apps/test1-dashboard | 3031 |
mkdocs | mkdocs serve | /opt/czechai-docs | 8085 |
PM2 příkazy
🐳 Docker Containers¶
| Container | Image | Porty | Účel |
|---|---|---|---|
| kong | kong:latest | 8000-8001 | API Gateway |
| kong-database | postgres:13-alpine | internal | Kong DB |
| n8n | n8nio/n8n:latest | 5678 | Workflow automation |
| czechai-cockpit | custom | 3001 | Cockpit backend |
| docker-nginx-1 | nginx:latest | 8080, 8443 | Dify proxy |
| docker-api-1 | langgenius/dify-api:1.11.1 | 5001 | Dify API |
| docker-worker-1 | langgenius/dify-api:1.11.1 | 5001 | Dify worker |
| docker-web-1 | langgenius/dify-web:1.11.1 | 3000 | Dify frontend |
| docker-db_postgres-1 | postgres:15-alpine | 5432 | PostgreSQL DB |
| docker-qdrant-1 | langgenius/qdrant:v1.8.3 | 6333-6334 | Vector DB |
| docker-redis-1 | redis:6-alpine | 6379 | Cache |
| docker-weaviate-1 | semitechnologies/weaviate | - | Vector search |
💾 Databáze¶
PostgreSQL (Docker)¶
Pozor na Docker IP
Docker IP se mění po restartu! Ověř: docker inspect docker-db_postgres-1 | grep IPAddress
| DB | Účel |
|---|---|
czechai_cockpit | Cockpit aplikace |
czechai_contacts | Kontakty (67M+) |
dify | Dify platform |
dify_plugin | Dify pluginy |
Připojení: postgres:difyai123456@172.19.0.X:5432
SQLite databáze¶
| Soubor | Záznamy | Účel |
|---|---|---|
/opt/czechai-cockpit-full/stat_realit.db | 13,585 | Reality inzeráty |
/opt/contacts/firemni/companies_master.db | 3,482,845 | 🏢 Firmy |
/opt/contacts/db/MASTER_CONTACTS.db | 2,819,063 | 👤 Osoby |
/opt/contacts/firemni/contacts_index.db | 6,760,000 | 📇 Kontakty index |
/opt/geodata/ruian.db | - | 🗺️ RUIAN geodata |
/opt/contacts/csu_vdb.db | - | 📊 ČSÚ data |
/opt/contacts/ares_api.db | - | 🏛️ ARES cache |
🔌 Aktivní porty¶
┌──────┬─────────────────────────┐
│ Port │ Služba │
├──────┼─────────────────────────┤
│ 22 │ SSH │
│ 80 │ Nginx HTTP │
│ 443 │ Nginx HTTPS │
├──────┼─────────────────────────┤
│ 3000 │ czech-legal-ai │
│ 3001 │ czechai-cockpit (Docker)│
│ 3002 │ chat-frontend │
│ 3003 │ reality-api │
│ 3030 │ leads-dashboard │
│ 3031 │ test1-dashboard │
├──────┼─────────────────────────┤
│ 5000 │ czechai-api │
│ 5050 │ pardubice │
│ 5678 │ n8n │
├──────┼─────────────────────────┤
│ 8000 │ Kong API │
│ 8001 │ Kong Admin │
│ 8080 │ Dify (Docker nginx) │
│ 8085 │ MkDocs │
│ 8090 │ router-api │
└──────┴─────────────────────────┘
📁 Klíčové cesty¶
| Cesta | Popis |
|---|---|
/opt/czechai-cockpit-full/Czech-AI-Cockpit/ | Frontend + Reality DB |
/opt/reality-api/ | Reality API (port 3003) |
/opt/czechai-api/ | CzechAI API (port 5000) |
/opt/router-api/ | Router Tower (port 8090) |
/opt/dify/docker/ | Dify platform |
/opt/contacts/ | Kontaktní DB (SQLite) |
/opt/geodata/ | RUIAN geodata |
/opt/czechai-docs/ | MkDocs dokumentace |
/opt/czechai-tools/ | MCP servery, scrapery |
/root/apps/czech-legal-ai/ | Právník AI |
/root/apps/pardubice/ | Pardubice Reality |
/root/apps/leads-dashboard/ | Leads formulář |
/etc/nginx/sites-enabled/ | Nginx konfigurace |
/etc/letsencrypt/live/ | SSL certifikáty |
/var/www/router-static/ | Veřejné stránky |
🚨 Troubleshooting¶
Po restartu serveru¶
Časté problémy
| Problém | Řešení |
|---|---|
| PM2 procesy neběží | pm2 resurrect nebo pm2 start all |
| Docker IP změněna | docker inspect docker-db_postgres-1 \| grep IPAddress |
| Nginx nefunguje | nginx -t && systemctl reload nginx |
| Port obsazený | netstat -tlnp \| grep PORT |
| SSL expiroval | certbot renew |
Diagnostické příkazy¶
# Stav všech služeb
pm2 list && docker ps
# Test všech domén
for h in chat law hub app pardubice router; do
curl -s -o /dev/null -w "%{http_code} - $h.czechai.io\n" https://$h.czechai.io
done
# Nginx test
nginx -t && systemctl status nginx
# Kontrola portů
netstat -tlnp | grep -E ':(80|443|3000|3001|3002|5000|8080|8090)'
🔧 ENV proměnné¶
Cockpit (.env)
Aktualizováno: 5.1.2026 | CzechAI
🎯 LEADY AI Agent (NOVÉ 2026-01-06)¶
Automatický odhad cen nemovitostí
URL: https://leads.czechai.io/agent/ Port: 5005 PM2: leady-ai-agent Cesta: /opt/leady-ai-agent/
API Endpoints¶
| Endpoint | Metoda | Popis |
|---|---|---|
/ | GET | 🖥️ Web GUI |
/api/process | POST | 🔄 Zpracování leadu |
/api/leads | GET | 📋 Seznam leadů |
/api/lead/<id> | GET | 📄 Detail leadu |
/api/stats | GET | 📊 Statistiky |
/api/health | GET | ✅ Health check |
Funkce¶
- 🤖 Extrakce parametrů z inzerátů pomocí GPT-4
- 📊 Tržní odhad nemovitosti (multi-model)
- 💰 Podhodnocení štítky: D10/D15/D20/D30
- 🏷️ Štítkování: ASSET, SRC, DISC, LEG, OCC, COND, STRAT, URG
- ⚠️ Riziková analýza (red/yellow/green flags)
- 💎 Doporučení služeb
Struktura¶
/opt/leady-ai-agent/
├── app.py # Flask backend
├── leady_agent.py # AI agent (GPT-4)
├── .env # Konfigurace
├── leady.db # SQLite databáze
├── venv/ # Python virtual env
├── templates/index.html
└── static/css/style.css, js/app.js
📝 Poznámkové systémy (2026-01-08)¶
Nově nainstalováno
| Služba | URL | Port | Účel |
|---|---|---|---|
| Directus | bi.czechai.io/ | 8055 | 📊 Headless CMS (39k leadů) |
| Blinko | blinko.czechai.io/ | 1111 | ⚡ Quick notes, AI tagging |
| SiYuan | siyuan.czechai.io/ | 6806 | 📚 Těžké dokumenty, stromová struktura |
Blinko¶
- Image: blinkospace/blinko:latest
- Databáze: PostgreSQL (blinko)
- MCP Server: mcp-server-blinko
- Funkce: Quick capture, AI tagging, Telegram bot
SiYuan¶
- Image: b3log/siyuan:latest
- Verze: 3.5.2
- Heslo: Eliska123
- MCP Server: @porkll/siyuan-mcp
- Funkce: Block-level editing, graph view, markdown
Docker compose cesty¶
🔄 MIGRACE SLUŽEB 179 → 117 (2026-03-29)¶
Důvod: Server 179 (30GB RAM) byl přetížen, OOM killer zabíjel procesy. Cíl: Server 117 (251GB RAM) má dostatek kapacity.
Migrované služby:¶
| Služba | Doména | Původně (179) | Nově (117) | Status |
|---|---|---|---|---|
| Umami | umami.czechai.io | port 3600 | port 3096 | ✅ MIGRÁNO |
| Outline Wiki | wiki.czechai.io | port 3090 | port 3090 | ✅ MIGRÁNO |
| Twenty CRM | twenty.czechai.io | port 3080 | port 3080 | ✅ MIGRÁNO |
| SiYuan | siyuan.czechai.io | port 6806 | port 6806 | ✅ MIGRÁNO |
| Blinko | blinko.czechai.io | port 1111 | port 1111 | ✅ MIGRÁNO |
| Affine | affine.czechai.io | port 3016 | port 3016 | ✅ MIGRÁNO |
| useSend | mail.czechai.io | port 3095 | port 3099 | ✅ MIGRÁNO |
| cobalt-api | - | port 9002 | port 9002 | ✅ MIGRÁNO |
| Teable | teable.czechai.io | port 3089 | port 3089 | ✅ MIGRÁNO |
Smazané služby (179):¶
| Služba | Důvod |
|---|---|
| Khoj AI (port 42110) | Málo používáno, zabíralo ~1.1GB |
| Clawdbot | Málo používáno, ~400MB |
| ghost.service | Nefunkční (chyběl /opt/ghost/), způsoboval restart loop |
Jak to funguje:¶
- Nginx na serveru 179 proxuje requesty na server 117
- Domény (wiki.czechai.io, twenty.czechai.io, atd.) stále směřují na 179
- 179 je reverse proxy → 117 je backend
Výsledek:¶
- Před migrací: 179 měl 4GB free RAM
- Po migraci: 179 má 7.8GB free RAM
- Stabilnější provoz, žádné OOM kills