154 lines
3.5 KiB
Markdown
154 lines
3.5 KiB
Markdown
# 🎮 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
|