Some checks failed
deploy-meshcentral / deploy (push) Failing after 1m37s
Configuración completa de MeshCentral con: - Integración OIDC con Authentik - Docker Compose para deployment - Gitea Actions workflow para CI/CD - Traefik labels para routing y SSL - Separación de rutas de usuario y agentes
192 lines
4.7 KiB
Markdown
192 lines
4.7 KiB
Markdown
# MeshCentral - Nucleo Rio Frio
|
|
|
|
Sistema de gestión remota de dispositivos basado en MeshCentral, integrado con Authentik para autenticación SSO.
|
|
|
|
## Características
|
|
|
|
- ✅ **Acceso remoto completo**: Terminal, RDP, transferencia de archivos
|
|
- ✅ **Autenticación SSO**: Integrado con Authentik via OIDC
|
|
- ✅ **Multi-tenancy**: Gestión de múltiples clientes/grupos
|
|
- ✅ **Deployment automatizado**: CI/CD con Gitea Actions
|
|
- ✅ **Seguridad**: Forward Auth de Authentik en rutas de usuario
|
|
|
|
## Arquitectura
|
|
|
|
```
|
|
Cliente (PC remota)
|
|
↓
|
|
MeshAgent (servicio Windows/Linux)
|
|
↓
|
|
Conexión WSS saliente → mesh.nucleoriofrio.com
|
|
↓
|
|
Traefik (reverse proxy + SSL)
|
|
↓
|
|
MeshCentral (contenedor Docker)
|
|
```
|
|
|
|
## Deployment
|
|
|
|
### Requisitos previos
|
|
|
|
1. **Servidor con Docker** y `docker-compose`
|
|
2. **Traefik** configurado con:
|
|
- Red `principal`
|
|
- Red `traefik-network`
|
|
- Middleware `authentik-forward-auth@file`
|
|
3. **Authentik** con Provider OIDC configurado
|
|
|
|
### Variables de entorno en Gitea
|
|
|
|
Configurar en **Settings > Actions > Secrets and Variables**:
|
|
|
|
#### Variables (`vars`):
|
|
```
|
|
APP_NAME=meshcentral
|
|
APP_DOMAIN=mesh.nucleoriofrio.com
|
|
MESH_PORT=4430
|
|
AUTHENTIK_ISSUER=https://authentik.nucleoriofrio.com/application/o/meshcentral/
|
|
```
|
|
|
|
#### Secrets (`secrets`):
|
|
```
|
|
AUTHENTIK_CLIENT_ID=<obtenido de Authentik>
|
|
AUTHENTIK_CLIENT_SECRET=<obtenido de Authentik>
|
|
```
|
|
|
|
### Configuración de Authentik
|
|
|
|
1. **Crear OAuth2/OIDC Provider**:
|
|
- Name: `meshcentral-oidc`
|
|
- Client Type: `Confidential`
|
|
- Redirect URIs: `https://mesh.nucleoriofrio.com/auth-oidc-callback`
|
|
- Signing Key: `authentik Self-signed Certificate`
|
|
|
|
2. **Crear Application**:
|
|
- Name: `MeshCentral`
|
|
- Slug: `meshcentral`
|
|
- Provider: `meshcentral-oidc`
|
|
- Launch URL: `https://mesh.nucleoriofrio.com`
|
|
|
|
3. **Obtener credenciales**:
|
|
- Client ID: Copiar desde el Provider
|
|
- Client Secret: Copiar desde el Provider
|
|
|
|
### Deployment automático
|
|
|
|
```bash
|
|
git push origin main
|
|
```
|
|
|
|
Gitea Actions se encargará de:
|
|
1. Generar `config.json` con configuración OIDC
|
|
2. Crear directorios necesarios
|
|
3. Bajar el stack anterior (si existe)
|
|
4. Levantar MeshCentral con docker-compose
|
|
5. Exponer via Traefik
|
|
|
|
### Acceso
|
|
|
|
1. **Web UI**: `https://mesh.nucleoriofrio.com`
|
|
2. **Primer login**: Usar "Login with Authentik"
|
|
3. **Crear grupos de dispositivos**: Organizar por cliente/ubicación
|
|
|
|
## Instalación de agentes
|
|
|
|
### Windows
|
|
|
|
1. Ir a `https://mesh.nucleoriofrio.com`
|
|
2. Login con Authentik
|
|
3. Click en el grupo de dispositivos
|
|
4. Click en "Add Agent"
|
|
5. Descargar el instalador Windows
|
|
6. Ejecutar en la PC del cliente (requiere admin)
|
|
|
|
### Linux
|
|
|
|
```bash
|
|
wget -O meshagent https://mesh.nucleoriofrio.com/meshagents?id=XXXX
|
|
chmod +x meshagent
|
|
sudo ./meshagent -install
|
|
```
|
|
|
|
## Seguridad
|
|
|
|
### Protección con Authentik
|
|
|
|
- **Rutas de usuario**: Protegidas con Forward Auth de Authentik
|
|
- **Rutas de agentes**: Sin autenticación (los agentes usan certificados propios)
|
|
|
|
### Rutas protegidas vs. públicas
|
|
|
|
**Protegidas** (requieren login en Authentik):
|
|
- `/` - Panel principal
|
|
- `/login` - Login (si no se usa OIDC)
|
|
- `/admin` - Administración
|
|
- Todo lo demás no especificado abajo
|
|
|
|
**Públicas** (para agentes):
|
|
- `/agent.ashx` - Comunicación de agentes
|
|
- `/meshrelay.ashx` - Relay P2P
|
|
- `/devicefile.ashx` - Transferencia de archivos
|
|
- `/amtactivate` - Activación Intel AMT
|
|
- `/meshsettings` - Configuración de agentes
|
|
- `/devicepower.ashx` - Control de energía
|
|
|
|
## Mantenimiento
|
|
|
|
### Ver logs
|
|
|
|
```bash
|
|
docker logs meshcentral
|
|
```
|
|
|
|
### Backup manual
|
|
|
|
Los datos importantes están en:
|
|
- `./meshcentral-data` - Base de datos y configuración
|
|
- `./meshcentral-files` - Archivos compartidos
|
|
- `./meshcentral-backup` - Backups automáticos
|
|
|
|
### Reiniciar servicio
|
|
|
|
```bash
|
|
docker compose --project-name meshcentral restart
|
|
```
|
|
|
|
### Actualizar
|
|
|
|
```bash
|
|
git pull origin main
|
|
git push origin main # Trigger deployment
|
|
```
|
|
|
|
## Troubleshooting
|
|
|
|
### Los agentes no se conectan
|
|
|
|
1. Verificar que las rutas de agentes no estén bloqueadas por Authentik
|
|
2. Revisar prioridad de routers en Traefik (agentes debe ser > 200)
|
|
3. Verificar certificados SSL
|
|
|
|
### Login OIDC no funciona
|
|
|
|
1. Verificar `AUTHENTIK_ISSUER` termina con `/`
|
|
2. Verificar Redirect URI en Authentik coincide exactamente
|
|
3. Revisar logs: `docker logs meshcentral`
|
|
|
|
### No puedo acceder al panel
|
|
|
|
1. Verificar Forward Auth de Authentik está configurado
|
|
2. Verificar DNS apunta correctamente
|
|
3. Verificar certificados SSL de Traefik
|
|
|
|
## Documentación oficial
|
|
|
|
- [MeshCentral Docs](https://ylianst.github.io/MeshCentral/)
|
|
- [MeshCentral GitHub](https://github.com/Ylianst/MeshCentral)
|
|
- [Authentik Docs](https://docs.goauthentik.io/)
|
|
|
|
## Soporte
|
|
|
|
Para problemas o consultas: claudeCode0@nucleoriofrio.com
|