# Configuration de déploiement O2switch pour DonShare API
# Ce fichier est utilisé par l'outil de setup d'O2switch

deployment:
  name: "donshare-api"
  version: "1.0.0"
  description: "API DonShare - Plateforme de dons et partage"

# Configuration du serveur
server:
  type: "shared"
  python_version: "3.11"
  domain: "api.votre-domaine.com"
  ssl: true
  ssl_certificate: "auto"

# Configuration de l'application
application:
  type: "python"
  framework: "fastapi"
  entry_point: "app.main:app"
  port: 8000
  workers: 2
  timeout: 30

# Configuration de la base de données
database:
  type: "postgresql"
  name: "donshare_db"
  user: "donshare_user"
  password: "donshare_password"
  host: "localhost"
  port: 5432

# Configuration des services
services:
  redis:
    enabled: true
    port: 6379
  nginx:
    enabled: true
    proxy_pass: "http://127.0.0.1:8000"

# Configuration des fichiers
files:
  upload_dir: "uploads"
  max_file_size: "10MB"
  static_dir: "static"

# Configuration de l'environnement
environment:
  DEBUG: "False"
  CORS_ORIGINS: "https://votre-domaine.com,https://www.votre-domaine.com"
  API_V1_PREFIX: "/api/v1"
  PROJECT_NAME: "DonShare API"
  VERSION: "1.0.0"

# Configuration des variables d'environnement sensibles
secrets:
  SECRET_KEY: "generate_random"
  DATABASE_URL: "postgresql://donshare_user:donshare_password@localhost:5432/donshare_db"
  ALGORITHM: "HS256"
  ACCESS_TOKEN_EXPIRE_MINUTES: "30"

# Configuration des dépendances
dependencies:
  system:
    - "python3.11"
    - "python3.11-venv"
    - "python3.11-dev"
    - "postgresql"
    - "postgresql-contrib"
    - "nginx"
    - "redis-server"
  python:
    - "fastapi==0.104.1"
    - "uvicorn[standard]==0.24.0"
    - "sqlalchemy==2.0.23"
    - "alembic==1.12.1"
    - "psycopg2-binary==2.9.9"
    - "python-multipart==0.0.6"
    - "python-jose[cryptography]==3.3.0"
    - "passlib[bcrypt]==1.7.4"
    - "python-dotenv==1.0.0"
    - "pydantic==2.5.0"
    - "pydantic-settings==2.1.0"
    - "email-validator==2.1.0"
    - "pillow==10.1.0"
    - "redis==5.0.1"

# Configuration des tâches de déploiement
deployment_tasks:
  pre_deploy:
    - "create_database"
    - "install_dependencies"
    - "run_migrations"
  post_deploy:
    - "restart_services"
    - "health_check"

# Configuration des sauvegardes
backup:
  enabled: true
  frequency: "daily"
  retention: "7"
  include:
    - "database"
    - "uploads"
    - "logs"

# Configuration des logs
logging:
  level: "INFO"
  file: "logs/app.log"
  max_size: "10MB"
  backup_count: "5"

# Configuration de la sécurité
security:
  firewall:
    enabled: true
    allowed_ports: [22, 80, 443, 8000]
  ssl:
    enabled: true
    certificate_type: "letsencrypt"
  headers:
    - "X-Frame-Options: DENY"
    - "X-Content-Type-Options: nosniff"
    - "X-XSS-Protection: 1; mode=block"

# Configuration du monitoring
monitoring:
  health_check_url: "/api/v1/health"
  uptime_monitoring: true
  error_notifications: true
