# Configuration des Variables d'Environnement ## Connexion Backend ↔ Infra Docker Pour `make infra-up`, Postgres, Redis et RabbitMQ sont exposés sur des ports décalés pour éviter les conflits : | Service | Port host | Port interne | Connexion depuis host | |-----------|-----------|--------------|-----------------------------------| | PostgreSQL| 15432 | 5432 | `postgres://veza:password@veza.fr:15432/veza` | | Redis | 16379 | 6379 | `redis://veza.fr:16379` | | RabbitMQ | 15672 (AMQP), 25672 (UI) | 5672, 15672 | `amqp://veza:password@veza.fr:15672/` | Le backend **dans Docker** utilise les noms de service internes (`postgres:5432`, `redis:6379`, `rabbitmq:5672`). Le backend **sur la machine hôte** doit utiliser les ports mappés ci-dessus. Copiez `veza-backend-api/.env.template` vers `veza-backend-api/.env` et adaptez selon votre cas. ## Backend API Pour activer le logging centralisé vers `/var/log/veza`, ajoutez ces variables à votre fichier `.env` : ```bash # Logging Configuration LOG_DIR=/var/log/veza LOG_LEVEL=INFO ``` Variables complètes recommandées : ```bash # Application APP_ENV=development APP_PORT=8080 LOG_LEVEL=INFO LOG_DIR=/var/log/veza # Database DATABASE_URL=postgresql://veza:password@localhost:5432/veza # Redis REDIS_URL=redis://localhost:6379 REDIS_ENABLE=true # RabbitMQ RABBITMQ_URL=amqp://veza:password@localhost:5672/%2f RABBITMQ_ENABLE=true # ClamAV (v0.101 - virus scanning for uploads) # Dev (Docker): ENABLE_CLAMAV=true, CLAMAV_REQUIRED=false (accepts uploads if ClamAV slow/down) # Prod: CLAMAV_REQUIRED=true (startup fails if ClamAV unavailable) ENABLE_CLAMAV=true CLAMAV_REQUIRED=false CLAMAV_ADDRESS=clamav:3310 # Security JWT_SECRET=your-secret-key-here-change-in-production CORS_ALLOWED_ORIGINS=http://localhost:3000 # Rate limiting (P1.6): Use DISABLE_RATE_LIMIT_FOR_TESTS=true ONLY for automated test runners. # Never set in production. When set, bypasses rate limiting for E2E/integration tests. # Services STREAM_SERVER_URL=http://localhost:8082 CHAT_SERVER_URL=http://localhost:8081 ``` ## Chat Server Pour le serveur de chat, ajoutez : ```bash LOG_DIR=/var/log/veza LOG_LEVEL=INFO ``` ## Stream Server Pour le serveur de streaming, ajoutez : ```bash LOG_DIR=/var/log/veza LOG_LEVEL=INFO ``` ## Docker Production Les variables sont déjà configurées dans `docker-compose.prod.yml`. Assurez-vous de définir : ```bash export DB_PASSWORD=your-db-password export RABBITMQ_PASSWORD=your-rabbitmq-password export JWT_SECRET=your-jwt-secret ``` Avant de lancer : ```bash docker-compose -f docker-compose.prod.yml up -d ``` ## Feature Flags (Frontend) Les feature flags sont configurables via les variables `VITE_FEATURE_*` (voir `apps/web/.env.example`). Valeurs acceptées : `true`, `1`, `yes` = activé ; sinon désactivé. | Variable | Défaut | Description | |----------|--------|--------------| | VITE_FEATURE_TWO_FACTOR_AUTH | true | Authentification 2FA | | VITE_FEATURE_PLAYLIST_COLLABORATION | true | Collaboration sur les playlists | | VITE_FEATURE_PLAYLIST_SEARCH | false | Recherche dans les playlists | | VITE_FEATURE_PLAYLIST_SHARE | false | Partage de playlists | | VITE_FEATURE_PLAYLIST_RECOMMENDATIONS | false | Recommandations de playlists | | VITE_FEATURE_HLS_STREAMING | false | Streaming HLS | | VITE_FEATURE_ROLE_MANAGEMENT | false | Gestion des rôles | | VITE_FEATURE_NOTIFICATIONS | false | Notifications |