Merge remote-tracking branch 'origin/development' into feature/hub-integration

# Conflicts:
#	backend/.env.example
#	backend/api/v1/modules/core/auth/service.py
#	backend/api/v1/modules/core/users/service.py
#	backend/core/middleware.py
#	docker-compose.yml
#	frontend/src/lib/auth.ts
#	frontend/src/lib/components/help/HelpDrawer.svelte
#	scripts/backend-entrypoint.sh
This commit is contained in:
2026-04-29 13:11:44 -05:00
850 changed files with 70243 additions and 17462 deletions

View File

@@ -1,51 +0,0 @@
#!/bin/sh
set -e
# Script de inicialización para el Frontend SvelteKit
# Espera a que el backend esté disponible antes de iniciar
echo "=========================================="
echo "Frontend SvelteKit - Inicialización"
echo "=========================================="
# Función para esperar al backend
wait_for_backend() {
local url=$1
local max_attempts=30
local attempt=1
echo "Esperando a que el Backend esté disponible en ${url}..."
while [ $attempt -le $max_attempts ]; do
if wget -q -O /dev/null "${url}/health" 2>/dev/null; then
echo "✓ Backend está listo"
return 0
fi
echo "Backend no está listo aún... (intento $attempt/$max_attempts)"
attempt=$((attempt + 1))
sleep 3
done
echo "⚠ WARNING: Backend no estuvo disponible, continuando de todas formas"
return 0
}
# Esperar al backend
# En Docker, usamos el nombre del servicio. En desarrollo local, VITE_API_URL apunta a localhost
BACKEND_HEALTH_URL="${BACKEND_INTERNAL_URL:-http://backend:8000/api}"
wait_for_backend "${BACKEND_HEALTH_URL}"
echo "=========================================="
echo "Iniciando aplicación SvelteKit..."
echo "=========================================="
# Instalar dependencias nuevas si package.json ha cambiado
if [ "$NODE_ENV" = "development" ]; then
echo "Instalando dependencias (development mode)..."
# CI=true evita el error ERR_PNPM_ABORTED_REMOVE_MODULES_DIR_NO_TTY
CI=true pnpm install
fi
# Ejecutar el comando que se pasó al contenedor
exec "$@"

View File

@@ -1,31 +0,0 @@
#!/bin/bash
set -e
echo "=========================================="
echo "PostgreSQL App - Inicialización"
echo "=========================================="
# Este script es ejecutado por docker-entrypoint-initdb.d
# PostgreSQL ya está iniciado por el contenedor padre
echo "✓ PostgreSQL está listo (iniciado por contenedor)"
# La base de datos anexo76_core ya está creada por POSTGRES_DB
echo "✓ Base de datos 'anexo76_core' ya configurada"
# Crear extensiones y esquemas
echo "Creando extensiones y esquemas..."
psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" --dbname "$POSTGRES_DB" <<-EOSQL
CREATE EXTENSION IF NOT EXISTS "uuid-ossp";
CREATE EXTENSION IF NOT EXISTS "pg_trgm";
CREATE SCHEMA IF NOT EXISTS core;
CREATE SCHEMA IF NOT EXISTS a76;
CREATE SCHEMA IF NOT EXISTS a22;
CREATE SCHEMA IF NOT EXISTS a24;
CREATE SCHEMA IF NOT EXISTS a30;
EOSQL
echo "✓ Extensiones y esquemas creados correctamente"
echo "=========================================="
echo "PostgreSQL App - Inicialización completada"
echo "=========================================="

View File

@@ -1,14 +0,0 @@
#!/bin/bash
set -e
# Este script se ejecuta automáticamente en la primera inicialización de PostgreSQL
# cuando se coloca en /docker-entrypoint-initdb.d/
echo "Inicializando base de datos keycloak..."
psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" <<-EOSQL
-- Verificar que la base de datos existe
SELECT 'Base de datos keycloak lista' AS status;
EOSQL
echo "✓ Base de datos keycloak inicializada correctamente"

View File

@@ -0,0 +1,34 @@
#!/usr/bin/env bash
# Espera a que backend y frontend estén sirviendo tras `docker compose up`.
#
# Uso en Jenkins: el wait real corre dentro del contenedor Playwright con
# --network host (ver Jenkinsfile). Este script es para dev/local cuando los
# puertos 8000/5173 sí son alcanzables desde el shell que lo invoca.
set -euo pipefail
BACKEND_URL="${BACKEND_URL:-http://localhost:8000/api/health}"
FRONTEND_URL="${FRONTEND_URL:-http://localhost:5173/}"
BACKEND_MAX_SEC="${BACKEND_MAX_SEC:-900}"
FRONTEND_MAX_SEC="${FRONTEND_MAX_SEC:-300}"
STEP="${STEP:-5}"
wait_for() {
local url="$1" max="$2" label="$3"
echo "== wait: ${label} ${url} =="
local i=0
until curl -fsS --connect-timeout 3 --max-time 5 "$url" >/dev/null 2>&1; do
i=$((i + STEP))
if [ "$i" -ge "$max" ]; then
echo "ERROR: timeout esperando ${label} ${url} (${max}s)"
return 1
fi
if [ $((i % 30)) -eq 0 ]; then
echo " ...esperando ${label} (${i}/${max}s)"
fi
sleep "$STEP"
done
echo "== ${label} listo tras ${i}s =="
}
wait_for "$BACKEND_URL" "$BACKEND_MAX_SEC" "backend"
wait_for "$FRONTEND_URL" "$FRONTEND_MAX_SEC" "frontend"