# 🎼 NationsGlory - Infrastructure UnifiĂ© Serveur Minecraft 1.6.4 modĂ© + Interface Web Admin en dĂ©ploiement centralisĂ©. ## 📁 Structure ``` Serveur NationsGlory/ ├── NationsGlory_ServeurBuild_Red/ # Serveur Minecraft (repo Git) ├── WebNationsGlory_ServeurBuild_Red/ # App Web Admin (repo Git) ├── deploy.sh # DĂ©marrer les services ├── stop.sh # ArrĂȘter les services ├── check-config.sh # VĂ©rifier + sync Git ├── shared.env # Config centralisĂ©e └── repos.conf # URLs Git ``` ## 🚀 DĂ©marrage Rapide ### PrĂ©requis - Git, Docker, Docker Compose - Ports: 25565, 25575, 4001 ### Installation (5 min) ```bash # 1. Synchroniser les repositories ./check-config.sh # 2. Configurer les secrets cp shared.env.example shared.env nano shared.env # Modifiez RCON_PASSWORD et SESSION_SECRET # 3. DĂ©ployer ./deploy.sh # 4. AccĂšs # Minecraft: votre-ip:25565 # Web Admin: http://votre-ip:4001 ``` ## đŸ› ïž Commandes Courantes ```bash # DĂ©ployer ./deploy.sh # ArrĂȘter ./stop.sh # VĂ©rifier config + sync Git ./check-config.sh # Logs Minecraft docker logs -f mc-nationsglory # Logs Web Admin docker logs -f webnationsglory-admin # RedĂ©marrer tout ./stop.sh && ./deploy.sh ``` ## 📋 Configuration ## 📋 Configuration ### shared.env (Configuration centralisĂ©e) Variables appliquĂ©es aux deux services automatiquement : ```bash RCON_PASSWORD=minecraft # Mot de passe RCON SESSION_SECRET=votre-secret # ClĂ© session web SERVER_PORT=25565 # Port Minecraft RCON_PORT=25575 # Port RCON PORT=4001 # Port Web Admin MEMORY=2G # RAM Minecraft ONLINE_MODE=false # Mode online NODE_ENV=production # Environnement ``` Voir [SHARED_ENV.md](SHARED_ENV.md) pour documentation complĂšte. ## 📡 AccĂšs Ă  Distance L'application fonctionne nativement avec : - Localhost : `http://localhost:4001` - IP locale : `http://192.168.1.X:4001` - IP publique : `http://votre-ip-publique:4001` - Domaine : `http://votre-domaine.com:4001` Le frontend dĂ©tecte automatiquement l'hĂŽte et configure l'API. ## 🔐 SĂ©curitĂ© ### À faire pour la production 1. **Changez RCON_PASSWORD** dans shared.env 2. **GĂ©nĂ©rez SESSION_SECRET** : ```bash openssl rand -base64 32 ``` 3. **Ouvrez les ports** dans le pare-feu : ```bash sudo ufw allow 25565/tcp # Minecraft sudo ufw allow 25575/tcp # RCON sudo ufw allow 4001/tcp # Web ``` 4. **(RecommandĂ©) HTTPS** : Configurez nginx/Caddy avec SSL ## 🔄 Mises Ă  Jour ```bash # VĂ©rifier et appliquer les mises Ă  jour ./check-config.sh # RedĂ©ployer ./stop.sh ./deploy.sh ``` ## 🐛 DĂ©pannage ### ProblĂšme : "Cannot connect to API" - VĂ©rifiez le port 4001 ouvert - VĂ©rifiez RCON_PASSWORD identique dans shared.env - Testez : `curl http://localhost:4001/api/health` ### ProblĂšme : "Minecraft ne dĂ©marre pas" ```bash docker logs mc-nationsglory ``` ### ProblĂšme : Git ne synchronise pas ```bash ./check-config.sh ``` ## 📚 Documentation ComplĂšte - [SHARED_ENV.md](SHARED_ENV.md) - Configuration centralisĂ©e - [GIT_SYNC.md](GIT_SYNC.md) - Synchronisation automatique Git - [CHEATSHEET.txt](CHEATSHEET.txt) - Commandes rapides ## ✅ CaractĂ©ristiques - ✅ Chemins 100% relatifs (portable) - ✅ Config centralisĂ©e (shared.env) - ✅ DĂ©tection auto IP/domaine - ✅ Sync Git automatique - ✅ DĂ©ploiement en une commande