- Add proper Traefik labels with middleware support - Use APP_NAME variable for dynamic naming - Remove port mapping (Traefik handles routing) - Add .env.example with all required variables - Update README with complete variable documentation - Configure docker network to use 'principal' - Add X-Forwarded-Proto header middleware
88 lines
2.7 KiB
Markdown
88 lines
2.7 KiB
Markdown
# Plantilla Nuxt + Authentik Proxy
|
|
|
|
Plantilla base para aplicaciones Nuxt 4 con autenticación mediante Authentik OAuth.
|
|
|
|
## Estructura del Proyecto
|
|
|
|
```
|
|
.
|
|
├── nuxt4/ # Aplicación Nuxt 4
|
|
├── docker-compose.yml # Configuración de despliegue
|
|
└── .gitea/ # Gitea Actions CI/CD
|
|
```
|
|
|
|
## Características
|
|
|
|
- ✅ Nuxt 4
|
|
- ✅ Autenticación OAuth con Authentik
|
|
- ✅ Docker y Docker Compose
|
|
- ✅ CI/CD con Gitea Actions
|
|
- ✅ Traefik para proxy reverso y SSL
|
|
- ✅ Claude Code hooks para monitoreo de Actions
|
|
|
|
## Desarrollo Local
|
|
|
|
```bash
|
|
cd nuxt4
|
|
npm install
|
|
npm run dev
|
|
```
|
|
|
|
## Claude Code Hooks
|
|
|
|
Este proyecto incluye hooks de Claude Code para monitorear automáticamente las Gitea Actions.
|
|
|
|
### Configuración Rápida:
|
|
|
|
1. **Crear token de Gitea:**
|
|
- Ve a tu instancia de Gitea → Settings → Applications
|
|
- Genera un token con permisos `repo`
|
|
|
|
2. **Configurar token:**
|
|
```bash
|
|
echo "export GITEA_TOKEN='tu_token_aqui'" >> ~/.bashrc
|
|
source ~/.bashrc
|
|
```
|
|
|
|
3. **Listo!** Cuando Claude Code haga `git push`, automáticamente:
|
|
- Monitoreará la Gitea Action
|
|
- Te notificará cuando termine con información detallada
|
|
- Te mostrará un link directo a los logs
|
|
|
|
📖 Ver documentación completa en [`.claude/hooks/README.md`](.claude/hooks/README.md)
|
|
|
|
## Despliegue
|
|
|
|
El proyecto incluye Gitea Actions que automáticamente:
|
|
1. Construye la imagen Docker
|
|
2. La sube al registro
|
|
3. Despliega usando docker-compose
|
|
|
|
### Variables Requeridas en Gitea
|
|
|
|
Para configurar el despliegue automático, ve a tu repositorio en Gitea:
|
|
- **Secrets**: `Settings > Actions > Secrets`
|
|
- **Variables**: `Settings > Actions > Variables`
|
|
|
|
**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
|
|
|
|
📄 Ver ejemplo completo en [`.env.example`](.env.example)
|
|
|
|
## Licencia
|
|
|
|
MIT
|