module.exports = {
  port: process.env.PORT || 3001,
  jwtSecret: process.env.JWT_SECRET || 'manus-dashboard-secret-2026',
  jwtExpiry: '24h',
  // Authentification
  auth: {
    username: process.env.ADMIN_USERNAME || 'adminItinova',
    password: process.env.ADMIN_PASSWORD || 'Itinova69!',
  },
  // Gitea
  gitea: {
    url: process.env.GITEA_URL || 'http://gitea:3000',
    username: process.env.GITEA_USERNAME || 'manus-admin',
    password: process.env.GITEA_PASSWORD || 'Itinova69!',
  },
  // Applications config
  appsBasePath: process.env.APPS_BASE_PATH || '/opt/manus-deploy/apps',
  infrastructurePath: process.env.INFRA_BASE_PATH || '/opt/manus-deploy/infrastructure',
  // Health check interval (ms)
  healthCheckInterval: parseInt(process.env.HEALTH_CHECK_INTERVAL) || 30000,
  // Apps configuration
  apps: [
    {
      id: 'itinova-contacts',
      name: 'Itinova Contacts',
      description: 'Application de gestion des contacts Itinova',
      directory: 'itinova-contacts',
      giteaRepo: 'itinova-contacts',
      giteaOwner: 'manus-admin',
      urls: {
        recette: 'https://contacts.recette.santinova-soft.org',
        prod: 'https://contacts.santinova-soft.org',
      },
      containerName: 'itinova-contacts',
      healthCheckUrl: 'https://contacts.recette.santinova-soft.org',
      port: 3000,
      category: 'ITINOVA',
      status: 'production',
    },
    {
      id: 'itinova-podcasts',
      name: 'Itinova Podcasts',
      description: 'Gestionnaire de podcasts pour les établissements Itinova',
      directory: 'itinova-podcasts',
      giteaRepo: 'itinova-podcasts',
      giteaOwner: 'manus-admin',
      urls: {
        recette: 'https://podcasts.recette.santinova-soft.org',
        prod: 'https://podcasts.santinova-soft.org',
      },
      containerName: 'itinova-podcasts',
      healthCheckUrl: 'https://podcasts.recette.santinova-soft.org',
      port: 3000,
      category: 'ITINOVA',
      status: 'production',
    },
    {
      id: 'veille-reglementaire',
      name: 'Veille Réglementaire',
      description: 'Application de veille réglementaire et appels à projets',
      directory: 'veille-reglementaire',
      giteaRepo: 'veille-reglementaire',
      giteaOwner: 'manus-admin',
      urls: {
        recette: 'https://veille.recette.santinova-soft.org',
        prod: 'https://veille.santinova-soft.org',
      },
      containerName: 'veille-reglementaire',
      healthCheckUrl: 'https://veille.recette.santinova-soft.org',
      port: 3000,
      category: 'ITINOVA',
      status: 'production',
    },
    {
      id: 'itinova-vehicle-exchange',
      name: 'Itinova Gestion de Flotte',
      description: 'Bourse de véhicules Itinova — Partage et échange de véhicules entre établissements',
      directory: 'itinova-vehicle-exchange',
      giteaRepo: 'itinova-vehicle-exchange',
      giteaOwner: 'manus-admin',
      urls: {
        recette: 'https://flotte.recette.santinova-soft.org',
        prod: 'https://flotte.santinova-soft.org',
      },
      containerName: 'itinova-vehicle-exchange',
      healthCheckUrl: 'https://flotte.recette.santinova-soft.org',
      port: 3000,
      category: 'ITINOVA',
      status: 'production',
    },
    {
      id: 'sonum',
      name: 'SONUM',
      description: 'Cartographie des Solutions Numériques FEHAP',
      directory: 'sonum',
      giteaRepo: 'sonum',
      giteaOwner: 'manus-admin',
      urls: {
        recette: 'https://sonum.recette.santinova-soft.org',
        prod: 'https://sonum.santinova-soft.org',
      },
      containerName: 'sonum',
      healthCheckUrl: 'https://sonum.recette.santinova-soft.org',
      port: 3000,
      category: 'SANTINOVA',
      status: 'production',
    },
    {
      id: 'demat-facturation-dsi',
      name: 'Démat. Facturation DSI',
      description: 'Dématérialisation des factures DSI — Import email/dossier, analyse IA, export SharePoint/PDF, validation BAP',
      directory: 'demat-facturation-dsi',
      giteaRepo: 'demat-facturation-dsi',
      giteaOwner: 'manus-admin',
      urls: {
        recette: 'https://demat-facturation.recette.santinova-soft.org',
        prod: 'https://demat-facturation.santinova-soft.org',
      },
      containerName: 'demat-facturation-app',
      healthCheckUrl: 'https://demat-facturation.recette.santinova-soft.org',
      port: 3000,
      category: 'SANTINOVA',
      status: 'production',
    },
    {
      id: 'facturation-santinova',
      name: 'Facturation Santinova',
      description: 'Application de gestion de la facturation Santinova',
      directory: 'facturation-santinova',
      giteaRepo: 'facturation-santinova',
      giteaOwner: 'manus-admin',
      urls: {
        recette: 'https://facturation.recette.santinova-soft.org',
        prod: 'https://facturation.santinova-soft.org',
      },
      containerName: 'facturation-santinova-app',
      healthCheckUrl: 'https://facturation.recette.santinova-soft.org',
      port: 3001,
      category: 'SANTINOVA',
      status: 'recette',
    },
    {
      id: 'formation-manager-itinova',
      name: 'Formation Manager',
      description: 'Gestion des Formations Itinova',
      directory: 'formation-manager-itinova',
      giteaRepo: 'formation-manager-itinova',
      giteaOwner: 'manus-admin',
      urls: {
        recette: 'https://formations.recette.santinova-soft.org',
        prod: 'https://formations.itinova.org',
      },
      containerName: 'formation-manager-itinova',
      healthCheckUrl: 'https://formations.recette.santinova-soft.org',
      port: 3000,
      category: 'ITINOVA',
      status: 'production',
    },
    {
      id: 'portail-santinova',
      name: 'Portail Applicatif',
      description: 'Portail applicatif Santinova — accès centralisé aux applications',
      directory: 'portail-santinova',
      giteaRepo: 'portail-santinova',
      giteaOwner: 'manus-admin',
      urls: {
        recette: 'https://portail.recette.santinova-soft.org',
        prod: 'https://portail.santinova-soft.org',
      },
      containerName: 'portail-santinova',
      healthCheckUrl: 'https://portail.recette.santinova-soft.org',
      port: 3000,
      category: 'SANTINOVA',
      status: 'production',
    },
    {
      id: 'manus-dashboard',
      name: 'Dashboard Recette',
      description: 'Dashboard de gestion de l\'infrastructure Manus',
      directory: 'manus-dashboard',
      giteaRepo: 'manus-dashboard',
      giteaOwner: 'manus-admin',
      urls: {
        recette: 'https://dashboard.recette.santinova-soft.org',
        prod: 'https://dashboard.santinova-soft.org',
      },
      containerName: 'manus-dashboard',
      healthCheckUrl: 'https://dashboard.recette.santinova-soft.org',
      port: 3001,
      category: 'INFRA',
      status: 'production',
    },
  ],
};
