diff --git a/DEPLOYMENT-FIX.md b/DEPLOYMENT-FIX.md index d6ffc18..93e1cb5 100644 --- a/DEPLOYMENT-FIX.md +++ b/DEPLOYMENT-FIX.md @@ -26,8 +26,9 @@ curl -u admin:admin https://logiflow.ffnancy.fr/api/deliveries 3. L'API `/api/user` doit fonctionner après connexion ## Corrections incluses -- getUserWithGroups() utilise maintenant des requêtes SQL manuelles (plus de référence à userGroups.createdAt) -- Système d'authentification robuste avec support multi-format -- Endpoint d'urgence pour reset admin si nécessaire -- Routage amélioré pour la page principale (fix 502) -- Version compilée: $(date) \ No newline at end of file +- ✅ **Routes manquantes ajoutées** : /api/users, /api/roles, /api/deliveries maintenant disponibles en production +- ✅ getUserWithGroups() utilise des requêtes SQL manuelles (plus d'erreur userGroups.created_at) +- ✅ Système d'authentification robuste avec support multi-format +- ✅ Endpoint d'urgence pour reset admin si nécessaire +- ✅ Routage amélioré pour la page principale (fix 502) +- ✅ Taille bundle: 198.5kb (vs 85kb) - toutes les routes incluses \ No newline at end of file diff --git a/URGENT-DEPLOY.md b/URGENT-DEPLOY.md new file mode 100644 index 0000000..07bd1e6 --- /dev/null +++ b/URGENT-DEPLOY.md @@ -0,0 +1,32 @@ +# DÉPLOIEMENT URGENT - LogiFlow + +## Problème critique résolu +❌ **Avant** : Routes manquantes en production (/api/users, /api/deliveries, /api/roles retournaient 404) +✅ **Après** : Toutes les routes API disponibles + +## Action IMMÉDIATE +```bash +# Sur votre serveur de production +cd /path/to/logiflow +docker-compose up --build -d +``` + +## Vérification immédiate +Après déploiement, testez ces URLs qui échouaient avant : +- https://logiflow.ffnancy.fr/api/users (ne doit plus retourner 404) +- https://logiflow.ffnancy.fr/api/deliveries (ne doit plus retourner 404) +- https://logiflow.ffnancy.fr/api/roles (ne doit plus retourner 404) + +## Test automatique +```bash +node debug-deliveries-production.js https://logiflow.ffnancy.fr +``` + +## Résultat attendu +- ✅ Module Utilisateurs : Affiche les utilisateurs enregistrés +- ✅ Module Livraisons : Affiche les données de la base +- ✅ Module Tâches : Fonctionne normalement +- ✅ Module Commandes clients : Données visibles +- ✅ Plus d'erreurs 404 dans les logs + +**TEMPS ESTIMÉ** : 2-3 minutes de déploiement \ No newline at end of file diff --git a/attached_assets/Pasted--User-related-Environment-related-Registries-Logs-Notifications-Settings-New--1754928661164_1754928661164.txt b/attached_assets/Pasted--User-related-Environment-related-Registries-Logs-Notifications-Settings-New--1754928661164_1754928661164.txt new file mode 100644 index 0000000..e4f01bb --- /dev/null +++ b/attached_assets/Pasted--User-related-Environment-related-Registries-Logs-Notifications-Settings-New--1754928661164_1754928661164.txt @@ -0,0 +1,156 @@ + + +User-related + + +Environment-related + +Registries + +Logs + +Notifications + +Settings + +New version available 2.27.9 +DismissSee what's new +Community Edition +2.27.6 LTS +Containers>logiflow-logiflow-1>Logs +Container logs + + +admin +Log viewer settings +Auto-refresh logs +Wrap lines +Display timestamps +Fetch +All logs +Search +Filter... +Lines +100 +Actions + + + + +🔗 Database initialization: { + + NODE_ENV: 'production', + + isProduction: true, + + hasDbUrl: true, + + dbHost: 'logiflow-db' + +} + +🐳 PRODUCTION: Using standard PostgreSQL + +✅ PostgreSQL connection test successful + +🐳 PRODUCTION: Using PostgreSQL storage + +🐳 PRODUCTION: Local auth configured with PostgreSQL sessions + +🐳 PRODUCTION: Starting LogiFlow application + +🐳 Environment: { NODE_ENV: 'production', DATABASE_URL: 'Present', PORT: '3000' } + +🐳 Serving static files from: /app/dist/public + +🐳 PRODUCTION: LogiFlow serving on port 3000 + +✅ Production admin user found: { id: 'admin_local', username: 'admin', passwordFormat: 'present' } + +🔐 Production password comparison { suppliedLength: 5, storedFormat: '21ff482668...' } + +✅ Password matched with hash.salt format + +✅ Admin password works with current system + +HEAD /api/health 200 in 8ms + +📄 SPA: Serving index.html for /users + +GET /api/user 304 in 7ms + +GET /api/user 304 in 7ms + +GET /api/user 304 in 6ms + +GET /api/user 304 in 9ms + +GET /api/groups 304 in 15ms + +GET /api/users 404 in 37ms + +GET /api/roles 404 in 52ms + +GET /api/users 404 in 8ms + +GET /api/roles 404 in 6ms + +GET /api/user 401 in 2ms + +GET /api/user 401 in 2ms + +GET /api/default-credentials-check 200 in 2ms + +GET /api/user 304 in 8ms + +GET /api/deliveries 404 in 7ms + +GET /api/deliveries 404 in 5ms + +GET /api/deliveries 404 in 8ms + +🔐 Production password comparison { suppliedLength: 8, storedFormat: 'c81960e064...' } + +❌ No password format matched + +POST /api/login 400 in 5ms + +GET /api/deliveries 404 in 14ms + +🔐 Production password comparison { suppliedLength: 8, storedFormat: 'c81960e064...' } + +❌ No password format matched + +POST /api/login 400 in 4ms + +🔐 Production password comparison { suppliedLength: 8, storedFormat: 'c81960e064...' } + +❌ No password format matched + +POST /api/login 400 in 5ms + +🔐 Production password comparison { suppliedLength: 8, storedFormat: 'c81960e064...' } + +❌ No password format matched + +POST /api/login 400 in 6ms + +🔐 Production password comparison { suppliedLength: 8, storedFormat: 'c81960e064...' } + +❌ No password format matched + +POST /api/login 400 in 4ms + +🔐 Production password comparison { suppliedLength: 8, storedFormat: 'c81960e064...' } + +❌ No password format matched + +POST /api/login 400 in 4ms + +🔐 Production password comparison { suppliedLength: 8, storedFormat: 'c81960e064...' } + +❌ No password format matched + +POST /api/login 400 in 4ms + +HEAD /api/health 200 in 1ms \ No newline at end of file diff --git a/attached_assets/image_1754928646763.png b/attached_assets/image_1754928646763.png new file mode 100644 index 0000000..32c3453 Binary files /dev/null and b/attached_assets/image_1754928646763.png differ diff --git a/server/index.production.ts b/server/index.production.ts index 27f0d28..acc204b 100644 --- a/server/index.production.ts +++ b/server/index.production.ts @@ -98,7 +98,11 @@ async function registerProductionRoutes(app: Express): Promise { // Setup authentication setupLocalAuth(app); - // Basic API routes for production + // Import and register all routes from routes.ts instead of having limited routes + const { registerRoutes } = await import('./routes.js'); + await registerRoutes(app); + + // Additional health check route for Docker compatibility app.get('/api/groups', requireAuth, async (req: Request, res: Response) => { try { const groups = await storage.getGroups();