Switch from OAuth to Authentik Proxy Outpost
Some checks failed
build-and-deploy / build (push) Failing after 2m51s
build-and-deploy / deploy (push) Has been skipped

- Remove all OAuth configuration (no longer needed)
- Add Authentik Proxy Outpost middleware to Traefik
- Simplify environment variables (only 4 required now)
- Update documentation with proxy outpost setup
- Document available Authentik headers
- Cleaner and simpler deployment
This commit is contained in:
2025-10-12 17:37:19 -06:00
parent c00d0fb61a
commit 7120d723ad
4 changed files with 49 additions and 51 deletions

View File

@@ -1,6 +1,6 @@
# Plantilla Nuxt + Authentik Proxy
Plantilla base para aplicaciones Nuxt 4 con autenticación mediante Authentik OAuth.
Plantilla base para aplicaciones Nuxt 4 con autenticación mediante Authentik Proxy Outpost.
## Estructura del Proyecto
@@ -14,11 +14,12 @@ Plantilla base para aplicaciones Nuxt 4 con autenticación mediante Authentik OA
## Características
- ✅ Nuxt 4
- ✅ Autenticación OAuth con Authentik
- ✅ Autenticación con Authentik Proxy Outpost
- ✅ Docker y Docker Compose
- ✅ CI/CD con Gitea Actions
- ✅ Traefik para proxy reverso y SSL
- ✅ Claude Code hooks para monitoreo de Actions
- ✅ Sin configuración OAuth necesaria (todo manejado por el proxy)
## Desarrollo Local
@@ -67,21 +68,36 @@ Para configurar el despliegue automático, ve a tu repositorio en Gitea:
**Secrets (valores sensibles):**
- `REGISTRY_USERNAME` - Usuario del registro Docker
- `REGISTRY_PASSWORD` - Contraseña del registro Docker
- `NUXT_OAUTH_AUTHENTIK_CLIENT_ID` - Client ID de Authentik
- `NUXT_OAUTH_AUTHENTIK_CLIENT_SECRET` - Client Secret de Authentik
- `NUXT_SESSION_PASSWORD` - Password para sesiones (generar con `openssl rand -base64 32`)
**Variables (valores públicos):**
- `REGISTRY_URL` - URL del registro Docker (ej: `registry.ejemplo.com`)
- `APP_NAME` - Nombre de la aplicación (ej: `mi-app`) - usado para container, imagen y Traefik
- `APP_DOMAIN` - Dominio de la aplicación (ej: `miapp.ejemplo.com`)
- `NUXT_OAUTH_AUTHENTIK_SERVER_URL` - URL pública de Authentik
- `NUXT_OAUTH_AUTHENTIK_SERVER_URL_INTERNAL` - URL interna de Authentik (para comunicación server-side)
- `NUXT_OAUTH_AUTHENTIK_REDIRECT_URL` - URL de callback OAuth (ej: `https://miapp.ejemplo.com/auth/callback`)
- `NUXT_PUBLIC_APP_URL` - URL pública de la app
- `NUXT_PUBLIC_APP_URL` - URL pública de la app (ej: `https://miapp.ejemplo.com`)
📄 Ver ejemplo completo en [`.env.example`](.env.example)
### Configuración de Authentik Proxy Outpost
Esta plantilla requiere un **Authentik Proxy Outpost** ya configurado en Traefik.
1. **En Authentik:**
- Crea una aplicación para tu dominio
- Crea/usa un Proxy Provider (Forward auth)
- Asocia la aplicación al Outpost
2. **En `docker-compose.yml`:**
- Actualiza el middleware `authentik-outpost@docker` con el nombre correcto de tu outpost
3. **Headers disponibles en la app:**
- `X-authentik-username`: nombre de usuario
- `X-authentik-email`: email del usuario
- `X-authentik-name`: nombre completo
- `X-authentik-groups`: grupos (separados por `|`)
- `X-authentik-uid`: ID único
Tu aplicación Nuxt puede leer estos headers para obtener información del usuario autenticado.
## Licencia
MIT