chore: update
This commit is contained in:
@@ -1,26 +1,26 @@
|
||||
# 📚 Documentation API - Plateforme de Gestion de Commandes
|
||||
|
||||
**Version:** 5.3.0
|
||||
**Date:** 2026-05-15
|
||||
**Version:** 5.4.0
|
||||
**Date:** 2026-06-11
|
||||
**Base URL prod:** `https://mln-uber.club` (HTTPS via WAF nginx + ModSecurity)
|
||||
**Base URL dev:** `http://localhost:8080`
|
||||
**Technologies:** Go 1.24, Gin, PostgreSQL 16, Redis 7, React 19 + Vite, Expo 54 (React Native), TomTom API
|
||||
|
||||
---
|
||||
|
||||
## 📋 Table des Matières
|
||||
|
||||
1. [Vue d'ensemble](#vue-densemble)
|
||||
2. [Déploiement Production](#-déploiement-production)
|
||||
3. [Authentication](#authentication)
|
||||
4. [API Client (v1)](#api-client-v1)
|
||||
5. [API Admin (v2)](#api-admin-v2)
|
||||
6. [API Cabine (v1)](#api-cabine-v1)
|
||||
7. [API Livreur (v1)](#api-livreur-v1)
|
||||
8. [Notifications Push & Telegram](#-notifications-push--telegram)
|
||||
9. [Paiements Crypto](#-paiements-crypto)
|
||||
10. [Systeme GPS Integre](#-systeme-gps-integre)
|
||||
11. [Codes d'Erreur](#codes-derreur)
|
||||
2. [Infrastructure Serveurs](#-infrastructure-serveurs)
|
||||
3. [Déploiement Production](#-déploiement-production)
|
||||
4. [Authentication](#authentication)
|
||||
5. [API Client (v1)](#api-client-v1)
|
||||
6. [API Admin (v2)](#api-admin-v2)
|
||||
7. [API Cabine (v1)](#api-cabine-v1)
|
||||
8. [API Livreur (v1)](#api-livreur-v1)
|
||||
9. [Notifications Push & Telegram](#-notifications-push--telegram)
|
||||
10. [Paiements Crypto](#-paiements-crypto)
|
||||
11. [Systeme GPS Integre](#-systeme-gps-integre)
|
||||
12. [Codes d'Erreur](#codes-derreur)
|
||||
|
||||
---
|
||||
|
||||
@@ -657,6 +657,86 @@ graph LR
|
||||
|
||||
---
|
||||
|
||||
## 🖥️ Infrastructure Serveurs
|
||||
|
||||
### Réseau VPN (WireGuard)
|
||||
|
||||
Tous les serveurs backend communiquent via un réseau WireGuard privé `10.0.0.0/24`. Le SSH est restreint à l'IP VPN uniquement sur les serveurs sensibles — il faut être connecté au VPN pour s'y connecter.
|
||||
|
||||
| Serveur | IP Publique | IP VPN | Rôle |
|
||||
|---------|-------------|--------|------|
|
||||
| **vpn-uber** | `45.150.111.158` | `10.0.0.1` | Serveur WireGuard — point d'entrée VPN et jump host SSH |
|
||||
| **monitoring-uber** | `185.103.167.138` | `10.0.0.2` | Wazuh · Dozzle · Beszel hub · SSH via VPN uniquement |
|
||||
| **backup-mln** | `85.121.176.241` | `10.0.0.4` | MinIO S3 · ClamAV · Beszel agent · SSH via VPN uniquement |
|
||||
| **bdd-redis-prod** | `132.243.162.62` | `10.0.0.5` | PostgreSQL 16 · Redis 7 · Beszel agent · SSH via VPN uniquement |
|
||||
| **prod-uber** | `185.103.166.119` | `10.0.0.6` | Backend Go + WAF nginx · accessible publiquement sur 80/443 |
|
||||
| **pre-prod-uber** | `185.103.166.112` | — | Environnement de pré-production |
|
||||
| **s3-uber** | `80.96.58.164` | — | Stockage S3 externe · Dozzle agent |
|
||||
|
||||
### Architecture DMZ / LAN
|
||||
|
||||
```
|
||||
Internet
|
||||
│
|
||||
▼
|
||||
prod-uber (DMZ — 185.103.166.119)
|
||||
│ 80/443 public
|
||||
│ ──── VPN (10.0.0.6) ────► bdd-redis-prod (LAN — 10.0.0.5)
|
||||
│ ├── PostgreSQL :5432
|
||||
│ └── Redis :6379
|
||||
│
|
||||
vpn-uber (10.0.0.1) — jump host SSH pour accès aux autres serveurs
|
||||
```
|
||||
|
||||
L'application prod-uber se connecte à PostgreSQL et Redis via les IP VPN :
|
||||
- `DB_HOST=10.0.0.5` (PostgreSQL sur bdd-redis-prod)
|
||||
- `REDIS_HOST=10.0.0.5` (Redis sur bdd-redis-prod)
|
||||
|
||||
### Monitoring
|
||||
|
||||
Toutes les ressources monitoring sont accessibles via VPN (`10.0.0.2`) :
|
||||
|
||||
| Outil | URL | Description |
|
||||
|-------|-----|-------------|
|
||||
| **Wazuh** | `https://10.0.0.2` | SIEM — alertes sécurité, logs agents |
|
||||
| **Dozzle** | `https://10.0.0.2:8080` | Logs Docker de tous les serveurs en temps réel |
|
||||
| **Beszel** | `https://10.0.0.2:8090` | Métriques système (CPU, RAM, disque, réseau) |
|
||||
|
||||
Dozzle agrège les logs de : `pre-prod-uber`, `prod-uber`, `backup-mln (VPN)`, `s3-uber`.
|
||||
Beszel surveille : `monitoring-uber`, `backup-mln` (agent Docker port 10001), `bdd-redis-prod` (agent binaire systemd port 10001).
|
||||
|
||||
Nettoyage automatique des logs Wazuh : cron tous les dimanches à 3h00 sur monitoring-uber (`/usr/local/bin/clean-wazuh-logs.sh`).
|
||||
|
||||
### Sécurité réseau
|
||||
|
||||
- **UFW** activé sur monitoring-uber et backup-mln : SSH bloqué depuis IP publique, accessible uniquement via VPN
|
||||
- **UFW** activé sur bdd-redis-prod : SSH, PostgreSQL et Redis accessibles uniquement depuis le réseau VPN (`10.0.0.0/24`)
|
||||
- Ports Docker liés à l'IP VPN (`10.0.0.4:port:port`) pour ne pas bypasser UFW
|
||||
- **ClamAV** sur backup-mln : scan antivirus quotidien de `/mnt/data`
|
||||
|
||||
### Accès SSH aux serveurs VPN-only
|
||||
|
||||
```bash
|
||||
# Via le jump host vpn-uber
|
||||
ssh -J root@45.150.111.158 root@10.0.0.2 # monitoring-uber
|
||||
ssh -J root@45.150.111.158 root@10.0.0.4 # backup-mln
|
||||
ssh -J root@45.150.111.158 root@10.0.0.5 # bdd-redis-prod
|
||||
```
|
||||
|
||||
### Sauvegarde S3 (backup-mln)
|
||||
|
||||
MinIO S3 tourne sur backup-mln avec nginx SSL proxy :
|
||||
|
||||
| Endpoint | Adresse |
|
||||
|----------|---------|
|
||||
| API S3 | `https://10.0.0.4:9000` (via VPN) |
|
||||
| Console MinIO | `https://10.0.0.4:9001` (via VPN) |
|
||||
| Console nginx | `https://10.0.0.4:8080` (via VPN) |
|
||||
|
||||
Les données sont montées sur `/mnt/data`.
|
||||
|
||||
---
|
||||
|
||||
## 🚀 Déploiement Production
|
||||
|
||||
### Prérequis
|
||||
@@ -703,31 +783,44 @@ docker compose -f docker/docker-compose-prod.yml up -d --build
|
||||
docker compose -f docker/docker-compose-prod.yml logs -f waf
|
||||
```
|
||||
|
||||
### Services Docker
|
||||
### Services Docker (prod-uber)
|
||||
|
||||
| Service | Image | Rôle |
|
||||
|---------|-------|------|
|
||||
| `waf` | owasp/modsecurity-crs:nginx-alpine | Point d'entrée HTTPS (ports 80/443) |
|
||||
| `backend` | Go 1.24 alpine | API REST (port 8080 interne) |
|
||||
| `frontend` | nginx:alpine | SPA React (port 80 interne) |
|
||||
| `postgres` | postgres:16-alpine | Base de données |
|
||||
| `redis` | redis:7-alpine | Cache + sessions + queues |
|
||||
|
||||
> PostgreSQL et Redis **ne tournent plus sur prod-uber**. Ils sont hébergés sur le serveur dédié `bdd-redis-prod` (`10.0.0.5`) et accessibles via le VPN WireGuard. Voir la section [Infrastructure Serveurs](#-infrastructure-serveurs).
|
||||
|
||||
### Variables d'environnement requises
|
||||
|
||||
```bash
|
||||
# Base de données (bdd-redis-prod via VPN)
|
||||
DB_HOST=10.0.0.5 # IP VPN de bdd-redis-prod
|
||||
DB_PORT=5432
|
||||
DB_PASSWORD= # Mot de passe PostgreSQL
|
||||
|
||||
# Redis (bdd-redis-prod via VPN)
|
||||
REDIS_HOST=10.0.0.5 # IP VPN de bdd-redis-prod
|
||||
REDIS_PORT=6379
|
||||
REDIS_PASSWORD= # Mot de passe Redis
|
||||
|
||||
# JWT
|
||||
USER_JWT_SECRET= # Secret JWT clients (min 32 chars)
|
||||
ADMIN_JWT_SECRET= # Secret JWT admin/livreur/cabine (min 32 chars)
|
||||
REDIS_PASSWORD= # Mot de passe Redis
|
||||
TOMTOM_API_KEY= # Clé API TomTom (principale / legacy)
|
||||
TOMTOM_API_KEY_1= # Clé TomTom #1 (rotation automatique)
|
||||
TOMTOM_API_KEY_2= # Clé TomTom #2 (rotation automatique)
|
||||
TOMTOM_API_KEY_3= # Clé TomTom #3 (rotation automatique)
|
||||
SESSION_SECRET= # Secret sessions
|
||||
TELEGRAM_WEBHOOK_URL= # URL webhook Telegram
|
||||
TELEGRAM_WEBHOOK_SECRET= # Secret webhook Telegram
|
||||
NOWPAYMENTS_IPN_SECRET= # Secret IPN NowPayments
|
||||
|
||||
# TomTom (rotation automatique entre les 3 clés)
|
||||
TOMTOM_API_KEY= # Clé TomTom principale / legacy
|
||||
TOMTOM_API_KEY_1= # Clé TomTom #1
|
||||
TOMTOM_API_KEY_2= # Clé TomTom #2
|
||||
TOMTOM_API_KEY_3= # Clé TomTom #3
|
||||
|
||||
# Divers
|
||||
SESSION_SECRET= # Secret sessions
|
||||
TELEGRAM_WEBHOOK_URL= # URL webhook Telegram
|
||||
TELEGRAM_WEBHOOK_SECRET= # Secret webhook Telegram
|
||||
NOWPAYMENTS_IPN_SECRET= # Secret IPN NowPayments
|
||||
```
|
||||
|
||||
---
|
||||
@@ -3034,8 +3127,9 @@ Le système tente d'abord toutes les clés disponibles en rotation, puis bascule
|
||||
|
||||
---
|
||||
|
||||
**Documentation mise à jour le :** 2026-05-18
|
||||
**Documentation mise à jour le :** 2026-06-11
|
||||
**Version API :** 5.4.0
|
||||
**Technologies :** Go 1.24, Gin, PostgreSQL 16, Redis 7, React 19, Expo 54, TomTom API, ModSecurity WAF
|
||||
**Déploiement :** Docker Compose · Nginx + ModSecurity OWASP CRS · TLS 1.2/1.3
|
||||
**Base URL prod :** `https://mln-uber.club`
|
||||
**Base URL prod :** `https://mln-uber.club`
|
||||
**Infrastructure :** WireGuard VPN · Wazuh SIEM · Dozzle · Beszel · ClamAV · MinIO S3
|
||||
|
||||
Reference in New Issue
Block a user