- Change default port to 4001 across all configuration files (server.js, docker-compose.yml, .env, Dockerfile) - Update frontend API URL to use new port 4001 - Fix circular dependency issues in route files by using process.env.SERVER_DIR instead of importing from server.js - Apply to all routes: auth.js, backup.js, logs.js, players.js, rcon.js, server.js, whitelist.js - Fix environment variable loading in start.sh to properly handle paths with spaces - Quote SERVER_DIR path in .env to preserve spaces in directory paths - Update all documentation references from port 3000 to 4001 (README, QUICKSTART, CONFIGURATION, INDEX) - Remove debug console.log statements from auth.js - Remove test utility file test-ops.js Fixes: Port conflict issues, circular dependency warnings, environment variable parsing
42 lines
1.2 KiB
Bash
Executable File
42 lines
1.2 KiB
Bash
Executable File
#!/bin/bash
|
||
|
||
# Configuration pour l'interface web du serveur Minecraft NationsGlory
|
||
# ====================================================================
|
||
|
||
echo "🚀 Installation de l'interface web NationsGlory Admin..."
|
||
|
||
# Vérifier que Node.js est installé
|
||
if ! command -v node &> /dev/null; then
|
||
echo "❌ Node.js n'est pas installé. Veuillez l'installer d'abord."
|
||
exit 1
|
||
fi
|
||
|
||
echo "✓ Node.js détecté: $(node --version)"
|
||
|
||
# Créer le fichier .env
|
||
if [ ! -f backend/.env ]; then
|
||
echo "Création du fichier .env..."
|
||
cp backend/.env.example backend/.env
|
||
echo "✓ Fichier .env créé. À personnaliser dans backend/.env"
|
||
fi
|
||
|
||
# Installer les dépendances du backend
|
||
echo ""
|
||
echo "📦 Installation des dépendances backend..."
|
||
cd backend
|
||
npm install
|
||
cd ..
|
||
|
||
echo ""
|
||
echo "✅ Installation terminée!"
|
||
echo ""
|
||
echo "📝 Prochaines étapes:"
|
||
echo "1. Modifiez backend/.env avec la bonne configuration"
|
||
echo "2. Lancez le serveur: cd backend && npm start"
|
||
echo "3. Accédez à l'interface: http://localhost:4001"
|
||
echo ""
|
||
echo "ℹ️ IMPORTANT: Activez RCON dans le server.properties du serveur MC:"
|
||
echo " - enable-rcon=true"
|
||
echo " - rcon.port=25575"
|
||
echo " - rcon.password=votre_mdp"
|