feat: phase 3 redesign, game images, auth system, vm guides, service isolation
Some checks failed
Deploy Multi-VM / Deploy VM Web (push) Has been cancelled
Deploy Multi-VM / Deploy VM Auth (push) Has been cancelled
Deploy Multi-VM / Deploy Game Servers (docker-compose.fusionfall.yml, VM_FUSIONFALL_HOST, VM_FUSIONFALL_SSH_KEY, VM_FUSIONFALL_USER, fusionfall) (push) Has been cancelled
Deploy Multi-VM / Deploy Game Servers (docker-compose.maple2.yml, VM_MAPLE2_HOST, VM_MAPLE2_SSH_KEY, VM_MAPLE2_USER, maple2) (push) Has been cancelled
Deploy Multi-VM / Deploy Game Servers (docker-compose.minecraft.yml, VM_MINECRAFT_HOST, VM_MINECRAFT_SSH_KEY, VM_MINECRAFT_USER, minecraft) (push) Has been cancelled
Deploy Multi-VM / Deploy Game Servers (docker-compose.retro.yml, VM_RETRO_HOST, VM_RETRO_SSH_KEY, VM_RETRO_USER, retro) (push) Has been cancelled

- Redesign all internal pages to warm/gold aesthetic (catalog, game detail,
  documentary, about, donate, community, guides, contact, server-status,
  login, profile, admin, not-found)
- Add real cover images for all 4 games via Strapi CMS with getImageUrl helper
- Integrate NextAuth v5 with Authentik OIDC authentication
- Add new public pages: community, guides, contact, server-status
- Add new protected pages: login, profile, admin dashboard
- Remove legacy AFC/MercadoPago system entirely
- Add Docker Compose split files for service isolation (main, auth, fusionfall, nier)
- Add OpenFusion VM deployment configs (config.vm.ini, systemd service, README-VM)
- Add NieR Reincarnation server guide and desktop client guide
- Add architecture docs for multi-VM deployment
- Add healthcheck, SSE, contact, newsletter, admin API routes
- Add reusable UI components, skeleton loaders, activity feed, bookmark system
- Update deployment and game server documentation
This commit is contained in:
consultoria-as
2026-04-28 05:15:38 +00:00
parent ea142501fa
commit 449c02eadc
151 changed files with 10053 additions and 2312 deletions

277
docs/clean-install.md Normal file
View File

@@ -0,0 +1,277 @@
# Guía de Instalación Limpia — Project Afterlife (Soft Launch)
## Requisitos Previos
- **VM Principal**: Ubuntu 22.04 LTS, 8 GB RAM, 50 GB disco
- **VMs de Juegos**: Ubuntu 22.04 LTS, 2-4 GB RAM cada una, 20-50 GB disco
- Acceso SSH a todas las VMs
- Red privada entre VMs (VLAN/VPN) — recomendado `10.0.0.0/24`
- Dominio apuntando a la VM Principal (ej. `play.consultoria-as.com`)
---
## Arquitectura del Soft Launch
```
Internet
├─► vm-main (10.0.0.10) :80/443 → Web + Auth + CMS + Admin
├─► vm-nier (10.0.0.70) :80/443 → NieR Reincarnation
├─► vm-dbo (10.0.0.80) :22000+ → Dragon Ball Online
├─► vm-maple2 (10.0.0.40) :20001+ → MapleStory 2
└─► vm-fusion (10.0.0.30) :23000+ → FusionFall
```
---
## Paso 1: Preparar la VM Principal
### 1.1 Ejecutar setup automático
```bash
# Descargar el script de setup
wget https://raw.githubusercontent.com/consultoria-as/project-afterlife/main/scripts/setup-main.sh
chmod +x setup-main.sh
./setup-main.sh
```
Esto instalará:
- Docker y Docker Compose v2
- Git
- UFW (firewall) con puertos 80, 443 abiertos
- Generará secrets automáticamente
### 1.2 Clonar el repositorio
```bash
git clone https://git.consultoria-as.com/consultoria-as/project-afterlife.git /opt/project-afterlife
cd /opt/project-afterlife
```
### 1.3 Configurar variables de entorno
```bash
cp docker/.env.example docker/.env
nano docker/.env
```
Variables **obligatorias**:
```env
# Base de datos
DATABASE_NAME=afterlife
DATABASE_USERNAME=afterlife
DATABASE_PASSWORD=<GENERADO_POR_SETUP>
# Strapi secrets (generados por setup)
APP_KEYS=<GENERADO>
API_TOKEN_SALT=<GENERADO>
ADMIN_JWT_SECRET=<GENERADO>
TRANSFER_TOKEN_SALT=<GENERADO>
JWT_SECRET=<GENERADO>
# Authentik
AUTHENTIK_SECRET_KEY=<GENERADO_POR_SETUP>
AUTHENTIK_POSTGRES_PASSWORD=<GENERADO>
# MinIO
MINIO_ROOT_USER=afterlife
MINIO_ROOT_PASSWORD=<GENERADO>
# URLs públicas
PUBLIC_STRAPI_URL=https://play.consultoria-as.com
NEXT_PUBLIC_SITE_URL=https://play.consultoria-as.com
# IPs de servidores de juegos (para mostrar en la web)
NIER_PUBLIC_IP=play.consultoria-as.com
DBO_PUBLIC_IP=play.consultoria-as.com
MAPLE2_PUBLIC_IP=play.consultoria-as.com
FUSIONFALL_PUBLIC_IP=play.consultoria-as.com
```
### 1.4 Instalar
```bash
./scripts/install.sh main
```
### 1.5 Configurar Authentik (primer arranque)
```bash
# Obtener contraseña de bootstrap
docker exec -it main-authentik-server ak bootstrap
```
Accede a `http://TU_IP:9000` (o a través del proxy) y:
1. Crea el realm `afterlife-players`
2. Crea el realm `afterlife-admins`
3. Crea la aplicación `afterlife-web` (OIDC) con callback:
`https://play.consultoria-as.com/api/auth/callback/authentik`
4. Copia el Client ID y Client Secret al `.env`
### 1.6 Configurar Strapi
```bash
# Crear usuario admin
docker exec -it main-cms npm run strapi admin:create-user
# O accede a https://play.consultoria-as.com/admin
# Crea el primer usuario y luego genera el API Token
```
Añade el token a `docker/.env`:
```env
STRAPI_API_TOKEN=<token_generado>
```
Reinicia la web:
```bash
cd docker && docker compose -f docker-compose.main.yml restart web
```
---
## Paso 2: Preparar VMs de Juegos
### 2.1 NieR Reincarnation (`vm-nier`)
```bash
# En la VM de NieR
wget https://raw.githubusercontent.com/consultoria-as/project-afterlife/main/scripts/setup-game-vm.sh
chmod +x setup-game-vm.sh
./setup-game-vm.sh nier
git clone https://git.consultoria-as.com/consultoria-as/project-afterlife.git /opt/project-afterlife
cd /opt/project-afterlife
# Configurar .env
cp docker/.env.example docker/.env
# Edita: NIER_RESOURCES_BASE_URL, NIER_MASTER_DATA_VERSION
# Instalar
./scripts/install.sh nier
```
**Importante**: Debes extraer `AssetDatabase` y `MasterDatabase` del cliente original y colocarlos en el volumen Docker `nier_data`.
### 2.2 Dragon Ball Online (`vm-dbo`)
```bash
./setup-game-vm.sh dbo
# DBO Global requiere Windows para compilar.
# El docker-compose.dbo.yml es un placeholder.
# Considera usar una VM Windows dedicada o Wine.
```
### 2.3 MapleStory 2 (`vm-maple2`)
```bash
./setup-game-vm.sh maple2
# Sigue la guía en docs/game-servers.md para el setup completo
# Requiere descargar 14GB de datos del cliente
```
### 2.4 FusionFall (`vm-fusionfall`)
```bash
./setup-game-vm.sh fusionfall
```
---
## Paso 3: Configurar DNS y SSL
### 3.1 DNS
Apunta tu dominio a la IP pública de la **VM Principal**:
```
play.consultoria-as.com → IP_PUBLICA_VM_MAIN
```
Para los juegos, puedes usar subdominios o el mismo dominio con diferentes puertos:
```
nier.play.consultoria-as.com → IP_PUBLICA_VM_NIER
dbo.play.consultoria-as.com → IP_PUBLICA_VM_DBO
```
### 3.2 SSL (Let's Encrypt)
```bash
# En la VM Principal
cd /opt/project-afterlife/docker
docker compose -f docker-compose.main.yml run --rm certbot certonly \
--webroot --webroot-path=/var/www/certbot \
-d play.consultoria-as.com
# Reiniciar Nginx
docker compose -f docker-compose.main.yml restart nginx
```
---
## Paso 4: Verificar
### 4.1 VM Principal
```bash
# Health checks
curl -f http://localhost:3000 # Next.js
curl -f http://localhost:1337/admin # Strapi
curl -f http://localhost:9000 # Authentik
```
### 4.2 Conectividad entre VMs
```bash
# Desde vm-main, probar conexión a los juegos
nc -zv 10.0.0.70 80 # NieR
nc -zv 10.0.0.80 22000 # DBO
nc -zv 10.0.0.40 20001 # Maple2
nc -zv 10.0.0.30 23000 # FusionFall
```
---
## Troubleshooting
### "No se puede conectar a Authentik"
Verifica que el contenedor `main-authentik-server` esté corriendo:
```bash
docker logs main-authentik-server
docker logs main-authentik-postgres
```
### "Strapi no arranca"
Verifica que PostgreSQL esté healthy:
```bash
docker inspect --format='{{.State.Health.Status}}' main-postgres
```
### "La web muestra 502 Bad Gateway"
El contenedor de Next.js puede estar construyéndose. Espera y revisa:
```bash
docker logs main-web
```
---
## Backups
### VM Principal
```bash
# PostgreSQL (Strapi)
docker exec main-postgres pg_dump -U afterlife afterlife > backup_cms.sql
# PostgreSQL (Authentik)
docker exec main-authentik-postgres pg_dump -U authentik authentik > backup_auth.sql
# MinIO
mc mirror local/afterlife ./backup-minio/
```
### VMs de Juegos
Ver `docs/game-servers.md` para backups específicos de cada juego.