Add comprehensive project wiki
This commit is contained in:
parent
c207d45839
commit
468e8b2b2a
1 changed files with 224 additions and 0 deletions
224
docs/WIKI.md
Normal file
224
docs/WIKI.md
Normal file
|
|
@ -0,0 +1,224 @@
|
|||
# WingsEmu Server Master – Wiki
|
||||
|
||||
> Praktische Gesamtdoku für Setup, Betrieb, Docker, Troubleshooting und Dev-Workflow.
|
||||
|
||||
---
|
||||
|
||||
## 1) Überblick
|
||||
|
||||
Dieses Repository enthält einen verteilten WingsEmu-Server-Stack mit mehreren Diensten:
|
||||
|
||||
- **Core**: `master`, `login`, `gamechannel`
|
||||
- **Feature/Domain Services**: `database`, `bazaar`, `family`, `relation`, `mail`, `translation`, `logs`, `scheduler`
|
||||
- **Infra**: `postgres`, `redis`, `mongodb`, `mqtt`
|
||||
|
||||
Der Stack läuft lokal vollständig via **Docker Compose** (Windows + Linux kompatibel).
|
||||
|
||||
---
|
||||
|
||||
## 2) Voraussetzungen
|
||||
|
||||
- Docker Desktop / Docker Engine
|
||||
- Git
|
||||
- Für lokale Builds: .NET SDK (wenn du ohne Docker baust)
|
||||
|
||||
Benötigte Daten/Ordner:
|
||||
|
||||
- `resources/dat/*` (mindestens `Item.dat`, idealerweise vollständige Datensätze)
|
||||
- `translations/*`
|
||||
- `config/*` (falls featurespezifische Konfigurationen benötigt werden)
|
||||
|
||||
---
|
||||
|
||||
## 3) Schnellstart (Docker)
|
||||
|
||||
1. `.env` anlegen (von `.env.example` ableiten)
|
||||
2. Services starten:
|
||||
|
||||
```bash
|
||||
docker compose up -d --build
|
||||
```
|
||||
|
||||
3. Status prüfen:
|
||||
|
||||
```bash
|
||||
docker compose ps
|
||||
```
|
||||
|
||||
4. Logs prüfen:
|
||||
|
||||
```bash
|
||||
docker compose logs -f --tail=200
|
||||
```
|
||||
|
||||
Details siehe auch: `docs/docker-run.md`
|
||||
|
||||
---
|
||||
|
||||
## 4) Wichtige Ports
|
||||
|
||||
### App Services
|
||||
- `20500` Master
|
||||
- `4004` Login
|
||||
- `8000` GameChannel
|
||||
- `17500` GameChannel HTTP
|
||||
- `29999` Database
|
||||
- `25555` Bazaar
|
||||
- `26666` Family
|
||||
- `21111` Relation
|
||||
- `27777` Mail
|
||||
- `28888` Logs
|
||||
- `19999` Translation
|
||||
|
||||
### Infrastruktur
|
||||
- `5432` PostgreSQL
|
||||
- `6379` Redis
|
||||
- `27017` MongoDB
|
||||
- `1883` MQTT
|
||||
- `18083` EMQX Dashboard
|
||||
|
||||
---
|
||||
|
||||
## 5) Architektur (vereinfacht)
|
||||
|
||||
1. **master** als zentrale Koordination
|
||||
2. **login** registriert/kommuniziert mit master
|
||||
3. **gamechannel** (World) kommuniziert mit:
|
||||
- master
|
||||
- database
|
||||
- bazaar/family/relation/mail/translation
|
||||
- redis/mqtt/mongo je nach Feature
|
||||
4. Persistenz:
|
||||
- Postgres (Core DB)
|
||||
- Redis (Cache/Bus)
|
||||
- Mongo (Logs/zusätzliche Daten)
|
||||
|
||||
---
|
||||
|
||||
## 6) Konfiguration
|
||||
|
||||
### Env-Variablen (Auszug)
|
||||
|
||||
- `POSTGRES_USER`
|
||||
- `POSTGRES_PASSWORD`
|
||||
- `POSTGRES_DB`
|
||||
- `MONGO_ROOT_USERNAME`
|
||||
- `MONGO_ROOT_PASSWORD`
|
||||
- `JWT_PRIVATE_KEY`
|
||||
- `HEALTHCHECK_API_KEY`
|
||||
|
||||
### Laufzeitdaten
|
||||
|
||||
- `resources/` → ingame Ressourcen
|
||||
- `translations/` → Übersetzungen
|
||||
- `config/` → Feature-Konfigurationen und Scripts
|
||||
|
||||
---
|
||||
|
||||
## 7) Docker-Dateien
|
||||
|
||||
- `docker-compose.yml` – Full-Stack Orchestrierung
|
||||
- `docker/Dockerfile.service` – generisches Runtime-Image für Service-DLLs
|
||||
- `docker/.dockerignore`
|
||||
- `scripts/docker-up.sh` / `scripts/docker-down.sh`
|
||||
|
||||
---
|
||||
|
||||
## 8) Betrieb (Operations)
|
||||
|
||||
### Start
|
||||
```bash
|
||||
docker compose up -d --build
|
||||
```
|
||||
|
||||
### Stop
|
||||
```bash
|
||||
docker compose down
|
||||
```
|
||||
|
||||
### Voller Reset (Achtung: löscht Volumes)
|
||||
```bash
|
||||
docker compose down -v --remove-orphans
|
||||
docker compose up -d --build
|
||||
```
|
||||
|
||||
### Einzelnen Dienst neu bauen/starten
|
||||
```bash
|
||||
docker compose up -d --build gamechannel
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 9) Troubleshooting
|
||||
|
||||
### A) `gamechannel` crasht beim Start
|
||||
- Prüfe `resources/dat` (mind. `Item.dat`)
|
||||
- Prüfe `translations/*`
|
||||
- Prüfe `config/scripts/*`
|
||||
- Logs:
|
||||
```bash
|
||||
docker logs --tail 200 wingsemu-gamechannel
|
||||
```
|
||||
|
||||
### B) DB-Auth schlägt fehl
|
||||
- `.env` Werte für Postgres prüfen
|
||||
- Bei Altlasten in Volumes: Hard Reset ausführen
|
||||
|
||||
### C) Services starten, aber Feature fehlt
|
||||
- Prüfen ob benötigte YAML/Config-Dateien unter `config/` existieren
|
||||
- Service-Logs und Stack-Logs vergleichen
|
||||
|
||||
### D) MQTT/Infra unhealthy
|
||||
- `docker compose ps`
|
||||
- gezielte Logs:
|
||||
- `wingsemu-mqtt`
|
||||
- `wingsemu-postgres`
|
||||
- `wingsemu-redis`
|
||||
- `wingsemu-mongodb`
|
||||
|
||||
---
|
||||
|
||||
## 10) Security & Hardening (bereits umgesetzt)
|
||||
|
||||
- Unsichere Defaults für Secrets/Passwörter reduziert/entfernt
|
||||
- Healthcheck-Key-Verifikation korrigiert
|
||||
- Secret-Leaks in `ToString()` maskiert
|
||||
- Paket-Updates für bekannte Vulnerabilities (u. a. JWT/Mongo)
|
||||
- Docker-Setup als reproduzierbarer Full Stack
|
||||
|
||||
---
|
||||
|
||||
## 11) Dev-Workflow
|
||||
|
||||
### Build lokal
|
||||
```bash
|
||||
dotnet build WingsEmu.sln -c Debug
|
||||
```
|
||||
|
||||
### Standard-Checks
|
||||
- Build grün
|
||||
- Docker stack läuft
|
||||
- Port-Checks grün
|
||||
- Keine frischen `Unhandled/Exception/FAIL_ADD` in Logs
|
||||
|
||||
### Git
|
||||
- Lokale Runtime-Daten sind ignoriert (`.env`, `resources/`, `translations/`)
|
||||
- Relevante Config-Templates und Docs werden committed
|
||||
|
||||
---
|
||||
|
||||
## 12) Empfohlene nächste Schritte
|
||||
|
||||
1. Optional: net5 → LTS Migration (langfristig)
|
||||
2. Optional: Healthchecks für alle App-Services weiter schärfen
|
||||
3. Optional: CI-Job für Docker Smoke-Test + Log-Sanity
|
||||
4. Optional: `docs/` in einzelne Kapitel splitten (Architecture, Ops, Security)
|
||||
|
||||
---
|
||||
|
||||
## 13) TL;DR
|
||||
|
||||
- Full-Stack ist dockerisiert und lauffähig.
|
||||
- Kernservices + Infra starten zusammen.
|
||||
- Wiki + Runbook vorhanden (`docs/WIKI.md`, `docs/docker-run.md`).
|
||||
- Für Probleme zuerst `docker compose ps` + `docker logs` nutzen.
|
||||
Loading…
Reference in a new issue