Aller au contenu

🖥️ Documentation Environnement Serveur - srv759970

Pour LLMs/IA déployant de nouveaux services

Cette documentation décrit l'infrastructure complète du serveur pour permettre une intégration correcte de nouveaux services.


📋 Vue d'ensemble

  • Hostname : srv759970.hstgr.cloud
  • IP Publique : 69.62.108.82
  • OS : Ubuntu 22.04 LTS
  • RAM : 16 GB (actuellement ~31% utilisés)
  • CPU : 4 vCPU
  • Stockage : 193 GB total (112 GB utilisés, 81 GB disponibles)
  • Uptime : 206+ jours

🔧 Stack Technique

1. Orchestration & Conteneurisation

Docker & Docker Compose

  • Version Docker : 24.x
  • Localisation configs : /opt/<nom-service>/docker-compose.yml
  • Réseau : Multiples réseaux Docker isolés par service
  • Volumes : Named volumes pour persistence

Réseaux Docker existants :

- whisperx_whisperx              (Transcription stack)
- faster-whisper-queue_faster-whisper-net
- memvid_memvid-network          (Video RAG)
- rag-anything_default           (RAG pipeline)
- monitoring_monitoring          (Prometheus/Grafana/Loki)
- sablier-network                (Auto-start services)
- wordpress-shared-network       (WordPress mutualisé)
- wordpress-clemence_clemence-network
- wordpress-jesuishyperphagique_jesuishyperphagique-network
- wordpress-panneauxsolidaires_panneauxsolidaires-network
- neutts-network                 (Text-to-Speech)
- rustdesk_rustdesk-net          (Remote desktop)
- dashy_default
- mkdocs_default
- api-portal_default

Auto-Start System (Custom)

  • Localisation : /opt/docker-autostart/
  • Fonction : Démarre/arrête automatiquement les conteneurs selon utilisation
  • Config : /opt/docker-autostart/config.json
  • Port : 10000 (API interne)
  • Principe : Nginx proxy_pass → Auto-start détecte requête → Lance conteneur si stopped

Services gérés par auto-start : - Tika Server (OCR/parsing) - Strapi (CMS headless) - N8N (Automatisation) - Et autres services peu utilisés

⚠️ Important pour nouveaux services : - Services critiques : restart: unless-stopped - Services occasionnels : restart: "no" + labels auto-start


2. Reverse Proxy & SSL

Nginx

  • Config principale : /etc/nginx/nginx.conf
  • Sites disponibles : /etc/nginx/sites-available/
  • Sites actifs : /etc/nginx/sites-enabled/ (symlinks)
  • Snippets réutilisables : /etc/nginx/snippets/

Snippets disponibles :

# /etc/nginx/snippets/basic-auth.conf
auth_basic "Restricted Access - Dev Server";
auth_basic_user_file /etc/nginx/.htpasswd;

# /etc/nginx/snippets/auto-start-service.conf
# Détection auto-start pour services on-demand

# /etc/nginx/snippets/wordpress-cache.conf
# Cache FastCGI pour WordPress

Template vhost standard :

server {
    listen 443 ssl http2;
    server_name monservice.srv759970.hstgr.cloud;

    ssl_certificate /etc/letsencrypt/live/monservice.srv759970.hstgr.cloud/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/monservice.srv759970.hstgr.cloud/privkey.pem;

    # Auth si service interne
    include snippets/basic-auth.conf;

    location / {
        proxy_pass http://localhost:PORT;
        proxy_http_version 1.1;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
    }
}

# HTTP -> HTTPS redirect
server {
    listen 80;
    server_name monservice.srv759970.hstgr.cloud;
    return 301 https://$host$request_uri;
}

Certbot (Let's Encrypt)

  • Certificats : /etc/letsencrypt/live/<domain>/
  • Renouvellement : Automatique via systemd timer
  • Email : julien.fernandez.work@gmail.com

Obtenir nouveau certificat :

certbot --nginx -d monservice.srv759970.hstgr.cloud \
  --non-interactive --agree-tos --email julien.fernandez.work@gmail.com


3. Monitoring & Observabilité

Prometheus

  • URL : https://prometheus.srv759970.hstgr.cloud
  • Port interne : 9090
  • Config : /opt/monitoring/prometheus/prometheus.yml
  • Scrape interval : 15s
  • Rétention : 30 jours

Jobs configurés :

scrape_configs:
  - job_name: 'node-exporter'        # Métriques système
  - job_name: 'cadvisor'             # Métriques Docker containers
  - job_name: 'rq-whisperx'          # Queue WhisperX
  - job_name: 'rq-faster-whisper'    # Queue Faster-Whisper
  - job_name: 'prometheus'           # Self-monitoring

⚠️ Pour nouveau service avec métriques : 1. Exposer endpoint /metrics (format Prometheus) 2. Ajouter job dans /opt/monitoring/prometheus/prometheus.yml 3. Redémarrer : cd /opt/monitoring && docker-compose restart prometheus

Grafana

  • URL : https://monitoring.srv759970.hstgr.cloud
  • Port interne : 3001
  • Credentials : admin / [voir .env]
  • Datasources :
  • Prometheus (métriques)
  • Loki (logs)
  • Redis (optionnel, plugin installé)

Dashboards existants : - System metrics (CPU, RAM, disk) - Docker containers (cAdvisor) - RQ queues (WhisperX, Faster-Whisper) - Nginx logs

Loki + Promtail

  • Loki URL : http://localhost:3100 (interne)
  • Fonction : Collecte logs containers Docker
  • Config : /opt/monitoring/loki/loki-config.yml
  • Promtail : Scrape /var/lib/docker/containers/ automatiquement

⚠️ Logs automatiques : Tout conteneur Docker est automatiquement scraped par Promtail

Netdata

  • URL : http://69.62.108.82:19999 (pas de SSL, localhost only)
  • Fonction : Monitoring temps réel système
  • RAM : ~360 MB (peut être optimisé)

4. Dashboards & Documentation

Dashy (Service Dashboard)

  • URL : https://dashy.srv759970.hstgr.cloud
  • Port interne : 4000
  • Config : /opt/dashy/conf.yml
  • Fonction : Landing page avec liens vers tous les services

⚠️ Ajouter nouveau service dans Dashy :

# /opt/dashy/conf.yml
sections:
  - name: Mon Nouveau Service
    items:
      - title: Mon Service
        description: Description courte
        icon: hl-docker  # Ou autre icône
        url: https://monservice.srv759970.hstgr.cloud
        statusCheck: true
        statusCheckUrl: https://monservice.srv759970.hstgr.cloud/health

Puis : cd /opt/dashy && docker-compose restart

MkDocs (Documentation)

  • URL : https://docs.srv759970.hstgr.cloud
  • Port interne : 8005
  • Config : /opt/mkdocs/mkdocs.yml (ou racine /mkdocs.yml)
  • Source : /docs/ (Markdown)

⚠️ Ajouter doc nouveau service : 1. Créer /docs/services/mon-service.md 2. Ajouter dans /mkdocs.yml :

nav:
  - Services:
    - Mon Service: services/mon-service.md

Swagger UI (API Documentation)

  • URL : https://portal.srv759970.hstgr.cloud (ou swagger spécifique)
  • Port interne : 8503
  • Fonction : Documentation OpenAPI centralisée

⚠️ Si ton service expose OpenAPI/Swagger : - Fournir URL du spec JSON : http://monservice:PORT/openapi.json - Sera auto-découvert par Swagger UI

Dozzle (Docker Logs Viewer)

  • URL : https://dozzle.srv759970.hstgr.cloud
  • Port interne : 8888
  • Fonction : Interface web pour logs Docker temps réel
  • Auto-découverte : Tous les conteneurs visibles automatiquement

5. Bases de données

MySQL (WordPress)

⚠️ Important : Chaque site WordPress a son MySQL dédié (problèmes licensing plugins si mutualisé)

Instances existantes :

- mysql-clemence              (port interne 3306)
- mysql-wordpress-shared      (port 3307, pour petits sites)
- mysql-jesuishyperphagique   (port interne 3306)
- mysql-panneauxsolidaires    (port interne 3306)

⚠️ Pour nouveau WordPress : - Créer instance MySQL dédiée (ne PAS réutiliser mysql-wordpress-shared) - Utiliser réseau Docker isolé

Redis (Queues)

Instance existante :

- rq-queue-redis (port 6380)
  - DB 0 : WhisperX queue
  - DB 1 : Faster-Whisper queue

⚠️ Pour nouveau service avec queue RQ : - Réutiliser rq-queue-redis - Utiliser DB différente (DB 2, 3, etc.) - Rejoindre réseau whisperx_whisperx

À venir (Phase 1 du plan)

  • MongoDB partagé (port 27017) : Rocket.Chat, MemVid
  • PostgreSQL partagé (port 5432) : Nextcloud, metadata transcription
  • Redis cache partagé (port 6379) : Cache applicatif (distinct de Redis RQ)

6. Services opérationnels

Transcription & TTS

Service URL Port Capacités RAM
WhisperX https://whisperx.srv759970.hstgr.cloud 8002 Transcription + diarization 40 MB
WhisperX Dashboard https://whisperx-dashboard.srv759970.hstgr.cloud 9181 RQ Dashboard 20 MB
Faster-Whisper https://faster-whisper.srv759970.hstgr.cloud 8001 Transcription rapide CPU 438 MB
Faster-Whisper Queue https://faster-whisper.srv759970.hstgr.cloud 8003 API avec queue RQ 45 MB
NeuTTS (à retirer) http://localhost:8004 8004 Text-to-Speech 6.66 GB 🔴

Réseau : whisperx_whisperx, faster-whisper-queue_faster-whisper-net

Service URL Port Fonction RAM
MemVid https://memvid.srv759970.hstgr.cloud 8506 Video encoding QR + search 468 MB
MemVid UI https://memvid-ui.srv759970.hstgr.cloud 8507 Interface Streamlit 44 MB
RAG-Anything https://rag-anything.srv759970.hstgr.cloud 9510 Pipeline RAG universel 212 MB
RagFlow (stopped) https://ragflow.srv759970.hstgr.cloud - RAG orchestration 0 MB

Réseau : memvid_memvid-network, rag-anything_default

OCR & Parsing

Service URL Port Fonction RAM Auto-start
Tika Server https://tika.srv759970.hstgr.cloud 9998 OCR Tesseract + parsing universel 0 MB ✅ Sablier

Réseau : sablier-network

Formats supportés : PDF, DOCX, PPTX, XLSX, images, emails, archives, etc.

WordPress Sites

Site URL MySQL Réseau
Clémence https://clemence.srv759970.hstgr.cloud mysql-clemence clemence-network
JeSuisHyperphagique https://jesuishyperphagique.srv759970.hstgr.cloud mysql-jesuishyperphagique jesuishyperphagique-network
PanneauxSolidaires https://panneauxsolidaires.srv759970.hstgr.cloud mysql-panneauxsolidaires panneauxsolidaires-network
SolidarLink https://solidarlink.srv759970.hstgr.cloud mysql-wordpress-shared wordpress-shared-network

Stack : Nginx (Alpine) → WordPress (PHP-FPM) → MySQL

Autres Services

Service URL Port Fonction
Portainer http://69.62.108.82:9000 9000 Gestion Docker UI
RustDesk https://rustdesk.srv759970.hstgr.cloud 21115-21119 Remote desktop (hbbs+hbbr)
Ollama http://localhost:11434 11434 LLM inference (systemd, stopped)
Strapi https://strapi.srv759970.hstgr.cloud - CMS headless (auto-start)
N8N https://n8n.srv759970.hstgr.cloud - Workflow automation (auto-start)

🔐 Sécurité & Accès

Authentification

Basic Auth : - Fichier : /etc/nginx/.htpasswd - Usage : Protège tous les services internes - Snippet : include snippets/basic-auth.conf;

Services publics (sans auth) : - Sites WordPress (Clémence, JeSuisHyperphagique, etc.)

Services internes (avec auth) : - Tous les dashboards (Grafana, Prometheus, Dashy) - APIs de développement - Services RAG/Transcription

Firewall (UFW)

Status: active

To                         Action      From
--                         ------      ----
22/tcp                     ALLOW       Anywhere
80,443/tcp                 ALLOW       Anywhere
21115:21119/tcp            ALLOW       Anywhere  # RustDesk

Fail2ban

  • SSH : 3 tentatives → ban 1h
  • Nginx HTTP Auth : 5 tentatives → ban 1h

📊 Ports utilisés

Ports publics (exposés)

80         HTTP (redirect → HTTPS)
443        HTTPS (Nginx reverse proxy)
3307       MySQL wordpress-shared
6380       Redis RQ (pour workers externes)
9000       Portainer
19999      Netdata (localhost only)
21115-21119 RustDesk

Ports internes (containers)

3000       Grafana
3001       Grafana (exposé via Nginx monitoring)
3100       Loki
4000       Dashy
8001       Faster-Whisper
8002       WhisperX
8003       Faster-Whisper Queue
8004       NeuTTS (à retirer)
8005       MkDocs
8080       cAdvisor
8100       Node Exporter
8503       Swagger UI
8505       Nextcloud (à venir)
8506       MemVid API
8507       MemVid UI
8508       Jitsi (à venir)
8509       ONLYOFFICE (à venir)
8510       Transcription Pipeline (à venir)
8888       Dozzle
9090       Prometheus
9181       WhisperX Dashboard
9187       PostgreSQL Exporter (à venir)
9216       MongoDB Exporter (à venir)
9510       RAG-Anything
9726       RQ Exporter WhisperX
9727       RQ Exporter Faster-Whisper
9998       Tika Server
10000      Docker Auto-start API
11434      Ollama

📁 Structure fichiers

/opt/
├── api-portal/              # Swagger UI centralisé
├── cristina-backend/        # Backend Cristina (stopped)
├── cristina-site/           # Site Astro Cristina
├── dashy/                   # Dashboard services
│   └── conf.yml
├── docker-autostart/        # Système auto-start custom
│   ├── config.json
│   └── server.js
├── faster-whisper-queue/    # Queue Faster-Whisper
├── memvid/                  # Video RAG
├── mkdocs/                  # Documentation
├── monitoring/              # Prometheus + Grafana + Loki
│   ├── prometheus/
│   │   └── prometheus.yml
│   ├── loki/
│   └── grafana/
├── neutts-air/              # Text-to-Speech (à retirer)
├── rag-anything/            # RAG pipeline
├── ragflow/                 # RAG orchestration (stopped)
├── rustdesk/                # Remote desktop
├── sablier/                 # Auto-start orchestrator
├── tika-server/             # OCR + parsing
├── whisperx/                # Transcription + diarization
├── wordpress-clemence/      # Site Clémence
├── wordpress-jesuishyperphagique/
├── wordpress-panneauxsolidaires/
├── wordpress-shared-db/     # MySQL mutualisé
└── wordpress-solidarlink/

/etc/nginx/
├── nginx.conf               # Config principale
├── sites-available/         # Tous les vhosts
├── sites-enabled/           # Vhosts actifs (symlinks)
└── snippets/                # Configs réutilisables
    ├── basic-auth.conf
    ├── auto-start-service.conf
    └── wordpress-cache.conf

/etc/letsencrypt/
└── live/
    ├── clemence.srv759970.hstgr.cloud/
    ├── dashy.srv759970.hstgr.cloud/
    ├── whisperx.srv759970.hstgr.cloud/
    └── [... tous les autres domaines]

/var/log/
├── nginx/                   # Logs Nginx
│   ├── access.log
│   └── error.log
└── [service]-access.log     # Logs par vhost

🚀 Checklist déploiement nouveau service

1. Préparation

  • Choisir nom de service (ex: mon-service)
  • Choisir port interne unique (vérifier liste ports ci-dessus)
  • Déterminer si service critique (always-on) ou occasionnel (auto-start)
  • Identifier dépendances (DB, Redis, autres services)

2. Docker

# Créer structure
mkdir -p /opt/mon-service
cd /opt/mon-service

# Créer docker-compose.yml
cat > docker-compose.yml <<'EOF'
version: '3.8'

services:
  mon-service:
    image: mon-image:latest
    container_name: mon-service
    restart: unless-stopped  # Ou "no" si auto-start
    ports:
      - "PORT:PORT"
    environment:
      - ENV_VAR=valeur
    volumes:
      - mon-service-data:/data
    healthcheck:
      test: ["CMD", "curl", "-f", "http://localhost:PORT/health"]
      interval: 30s
      timeout: 10s
      retries: 3
    networks:
      - mon-service-network
    # Si auto-start :
    # labels:
    #   - sablier.enable=true
    #   - sablier.group=api-services

volumes:
  mon-service-data:

networks:
  mon-service-network:
    driver: bridge
  # Si besoin accès autres services :
  # whisperx_whisperx:
  #   external: true
EOF

# Démarrer
docker-compose up -d

# Vérifier logs
docker-compose logs -f

3. Nginx

# Créer vhost
cat > /etc/nginx/sites-available/mon-service <<'NGINX'
server {
    listen 443 ssl http2;
    server_name mon-service.srv759970.hstgr.cloud;

    ssl_certificate /etc/letsencrypt/live/mon-service.srv759970.hstgr.cloud/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/mon-service.srv759970.hstgr.cloud/privkey.pem;

    # Si service interne
    include snippets/basic-auth.conf;

    location / {
        proxy_pass http://localhost:PORT;
        proxy_http_version 1.1;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;

        # Si WebSocket
        # proxy_set_header Upgrade $http_upgrade;
        # proxy_set_header Connection "upgrade";

        # Timeouts si long processing
        # proxy_read_timeout 600s;
        # proxy_send_timeout 600s;
    }
}

server {
    listen 80;
    server_name mon-service.srv759970.hstgr.cloud;
    return 301 https://$host$request_uri;
}
NGINX

# Activer
ln -sf /etc/nginx/sites-available/mon-service /etc/nginx/sites-enabled/

# Tester config
nginx -t

# Recharger
systemctl reload nginx

4. SSL

# Obtenir certificat
certbot --nginx -d mon-service.srv759970.hstgr.cloud \
  --non-interactive --agree-tos --email julien.fernandez.work@gmail.com

# Vérifier renouvellement auto
certbot renew --dry-run

5. Monitoring

Si expose métriques Prometheus :

# Éditer /opt/monitoring/prometheus/prometheus.yml
# Ajouter :
  - job_name: 'mon-service'
    static_configs:
      - targets: ['mon-service:PORT']

# Redémarrer Prometheus
cd /opt/monitoring
docker-compose restart prometheus

Logs automatiques : Déjà scraped par Promtail (rien à faire)

6. Dashboards

Dashy :

# Éditer /opt/dashy/conf.yml
# Ajouter dans section appropriée :
  - title: Mon Service
    description: Description
    icon: hl-docker
    url: https://mon-service.srv759970.hstgr.cloud
    statusCheck: true

# Redémarrer
cd /opt/dashy
docker-compose restart

MkDocs :

# Créer doc
cat > /docs/services/mon-service.md <<'DOC'
# Mon Service

Description...

## API

...
DOC

# Ajouter dans mkdocs.yml
# Redémarrer mkdocs

7. Tests

# Health check
curl https://mon-service.srv759970.hstgr.cloud/health

# Logs
docker logs mon-service --tail 50 -f

# Prometheus metrics (si applicable)
curl http://localhost:PORT/metrics

# Vérifier Grafana
# Vérifier Dashy
# Vérifier logs dans Dozzle

🔄 Intégration avec services existants

Se connecter à WhisperX/Faster-Whisper

# docker-compose.yml
services:
  mon-service:
    environment:
      - WHISPERX_URL=http://whisperx:8002
      - FASTER_WHISPER_URL=http://faster-whisper:8001
    networks:
      - whisperx_whisperx  # Important !
      - faster-whisper-queue_faster-whisper-net

networks:
  whisperx_whisperx:
    external: true
  faster-whisper-queue_faster-whisper-net:
    external: true

Utiliser Redis RQ (queue jobs)

services:
  mon-service:
    environment:
      - REDIS_URL=redis://rq-queue-redis:6379/2  # DB 2 (0=WhisperX, 1=Faster-Whisper)
    networks:
      - whisperx_whisperx

networks:
  whisperx_whisperx:
    external: true

Utiliser Tika (OCR/parsing)

import requests

# Tika auto-démarre via Sablier
response = requests.put(
    "https://tika.srv759970.hstgr.cloud/tika",
    data=file_bytes,
    headers={"Accept": "text/plain"}
)
text = response.text

Utiliser MemVid (semantic search vidéo)

response = requests.post(
    "https://memvid.srv759970.hstgr.cloud/search",
    json={"query": "How does it work?", "top_k": 5}
)
results = response.json()

🛠️ Maintenance

Backups

À venir : Script automatique /usr/local/bin/backup-vps.sh - Databases : MongoDB, PostgreSQL, MySQL - Configs : /opt/*/docker-compose.yml, /etc/nginx/ - Uploads : WordPress, Nextcloud

Updates

Containers :

cd /opt/<service>
docker-compose pull
docker-compose up -d

Système :

apt update && apt upgrade -y

Nginx :

nginx -t && systemctl reload nginx


📞 Support & Documentation

  • Grafana : https://monitoring.srv759970.hstgr.cloud
  • Prometheus : https://prometheus.srv759970.hstgr.cloud
  • Dashy : https://dashy.srv759970.hstgr.cloud
  • Docs : https://docs.srv759970.hstgr.cloud
  • Logs : https://dozzle.srv759970.hstgr.cloud

⚠️ Points d'attention pour LLMs

À TOUJOURS vérifier avant déploiement

  1. Port disponible : Vérifier liste ports ci-dessus
  2. Réseau Docker : Créer réseau isolé ou rejoindre existant
  3. Nginx vhost : Template standard + SSL
  4. Healthcheck : Endpoint /health recommandé
  5. Logs : JSON format si possible (meilleur parsing Loki)
  6. Monitoring : Exposer /metrics si Prometheus pertinent
  7. Dashy : Ajouter dans dashboard
  8. Documentation : Créer /docs/services/<nom>.md

À NE PAS faire

  • ❌ Réutiliser port déjà assigné
  • ❌ Créer MySQL mutualisé pour WordPress (problèmes plugins)
  • ❌ Oublier SSL (Certbot facile)
  • ❌ Ignorer healthchecks (monitoring blind)
  • ❌ Hardcoder credentials (utiliser .env)

Dernière mise à jour : Octobre 2025 Version : 1.0