josedario87 51767ff0d3
All checks were successful
build-and-deploy / build (push) Successful in 8s
build-and-deploy / deploy (push) Successful in 3s
Add /api/auth/status to public routes
Make the session status check endpoint publicly accessible so it can
respond even when there's no Authentik session. This allows the
endpoint to return {"authenticated": false} instead of being
redirected to login.

Without this, Authentik intercepts the request and returns HTML
login page instead of JSON response.
2025-10-13 01:31:41 -06:00

Plantilla Nuxt + Authentik Proxy

Plantilla base para aplicaciones Nuxt 4 con autenticación mediante Authentik Proxy Outpost.

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 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

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:

    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

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

Variables (valores públicos):

  • REGISTRY_URL - URL del registro Docker (ej: gitea.nucleoriofrio.com)
    • El owner del repositorio se agrega automáticamente
    • Imagen final: REGISTRY_URL/owner/APP_NAME:latest
  • 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_PUBLIC_APP_URL - URL pública de la app (ej: https://miapp.ejemplo.com)

📄 Ver ejemplo completo en .env.example

Configuración de Authentik Proxy Outpost

Esta plantilla requiere un Authentik Proxy Outpost ya configurado en Traefik.

Requisitos previos:

  • Red traefik-network creada y Traefik corriendo en ella
  • Authentik Forward Auth middleware configurado en Traefik (ej: en dynamic/middlewares.yml)
  • Proxy Provider de tipo Forward Auth en Authentik

Pasos:

  1. En Authentik:

    • Crea una aplicación para tu dominio
    • Crea/usa un Proxy Provider de tipo Forward auth (single application)
    • Asocia la aplicación al Outpost
  2. Redes requeridas:

    • principal - Red de tu infraestructura
    • traefik-network - Red donde corre Traefik
  3. Middleware en Traefik:

    • El docker-compose.yml usa authentik-forward-auth@file
    • Verifica que este middleware esté definido en tu configuración de Traefik
    • Si tu middleware tiene otro nombre, actualiza el docker-compose.yml
  4. 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

Description
No description provided
Readme 1,002 KiB
Languages
Vue 43.5%
TypeScript 31.1%
Shell 15.6%
HTML 8%
Dockerfile 1.4%
Other 0.4%