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 || 'https://git.santinova-soft.org',
    username: process.env.GITEA_USERNAME || 'manus-admin',
    password: process.env.GITEA_PASSWORD || 'ManusGitea2026!',
  },
  // 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 - can be extended
  apps: [
    {
      id: 'itinova-contacts',
      name: 'Itinova Contacts',
      description: 'Application de gestion des contacts',
      directory: 'itinova-contacts',
      giteaRepo: 'itinova-contacts',
      giteaOwner: 'manus-admin',
      urls: {
        recette: 'https://contacts.recette.santinova-soft.org',
        prod: null,
      },
      containerName: 'itinova-contacts',
      healthCheckUrl: 'https://contacts.recette.santinova-soft.org',
      port: 3000,
    },
    {
      id: 'itinova-podcasts',
      name: 'Itinova Podcasts',
      description: 'Application de gestion de podcasts',
      directory: 'itinova-podcasts',
      giteaRepo: 'itinova-podcasts',
      giteaOwner: 'manus-admin',
      urls: {
        recette: 'https://podcasts.recette.santinova-soft.org',
        prod: null,
      },
      containerName: 'itinova-podcasts',
      healthCheckUrl: 'https://podcasts.recette.santinova-soft.org',
      port: 3000,
    },
    {
      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: null,
      },
      containerName: 'veille-reglementaire',
      healthCheckUrl: 'https://veille.recette.santinova-soft.org',
      port: 3000,
    },
    {
      id: 'itinova-vehicle-exchange',
      name: 'Itinova Gestion de Flotte',
      description: 'Application de gestion de flotte de véhicules',
      directory: 'itinova-vehicle-exchange',
      giteaRepo: 'itinova-vehicle-exchange',
      giteaOwner: 'manus-admin',
      urls: {
        recette: 'https://flotte.recette.santinova-soft.org',
        prod: null,
      },
      containerName: 'itinova-vehicle-exchange',
      healthCheckUrl: 'https://flotte.recette.santinova-soft.org',
      port: 3000,
    },
    {
      id: 'sonum',
      name: 'Sonum',
      description: 'Application Sonum',
      directory: 'sonum',
      giteaRepo: 'sonum',
      giteaOwner: 'manus-admin',
      urls: {
        recette: 'https://sonum.recette.santinova-soft.org',
        prod: null,
      },
      containerName: 'sonum',
      healthCheckUrl: 'https://sonum.recette.santinova-soft.org',
      port: 3000,
    },
    {
      id: 'facturation-santinova',
      name: 'Facturation Santinova',
      description: 'Application de gestion de la facturation',
      directory: 'facturation-santinova',
      giteaRepo: 'facturation-santinova',
      giteaOwner: 'manus-admin',
      urls: {
        recette: 'https://facturation.recette.santinova-soft.org',
        prod: null,
      },
      containerName: 'facturation-santinova-app',
      healthCheckUrl: 'https://facturation.recette.santinova-soft.org',
      port: 3001,
    },
    {
      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: null,
      },
      containerName: 'demat-facturation-app',
      healthCheckUrl: 'https://demat-facturation.recette.santinova-soft.org',
      port: 3000,
    },
  ],
};
