- Parse VITE_FEATURE_* from env with fallback to current defaults - Add all flags to .env.example and ENV_CONFIG.md - parseFeatureEnv accepts true/1/yes for enabled Co-authored-by: Cursor <cursoragent@cursor.com>
103 lines
2.9 KiB
Markdown
103 lines
2.9 KiB
Markdown
# 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
|
|
|
|
# Security
|
|
JWT_SECRET=your-secret-key-here-change-in-production
|
|
CORS_ALLOWED_ORIGINS=http://localhost:3000
|
|
|
|
# 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 |
|