Retry 2239
Some checks failed
Optimized Build and Deploy / remote-build-and-deploy (push) Failing after 1m40s

This commit is contained in:
2025-06-26 22:39:09 -03:00
parent 229f657685
commit 1456ccd723
3 changed files with 14 additions and 9 deletions

View File

@@ -112,9 +112,18 @@ builder.Services.AddHealthChecks()
// --- Configuración de Autenticación JWT ---
var jwtSettings = builder.Configuration.GetSection("Jwt");
// Lee la RUTA al archivo del secreto desde la variable de entorno
var jwtKeyFilePath = builder.Configuration["JWT_KEY_FILE"];
// Si la ruta existe (estamos en Docker Swarm), lee el contenido del archivo.
// Si no, vuelve a buscar la variable de entorno (para desarrollo local).
var jwtKey = !string.IsNullOrEmpty(jwtKeyFilePath) && File.Exists(jwtKeyFilePath)
? File.ReadAllText(jwtKeyFilePath).Trim()
: builder.Configuration["JWT_KEY"] ?? throw new ArgumentNullException("JWT Key not configured");
// Le decimos que busque la clave JWT en la raíz de la configuración (donde están las variables de entorno).
// Si no la encuentra, como respaldo, busca en la sección "Jwt" del appsettings.
var jwtKey = builder.Configuration["JWT_KEY"] ?? /*jwtSettings["Key"] ??*/ throw new ArgumentNullException("JWT_KEY or Jwt:Key not configured");
//var jwtKey = builder.Configuration["JWT_KEY"] ?? /*jwtSettings["Key"] ??*/ throw new ArgumentNullException("JWT_KEY or Jwt:Key not configured");
var keyBytes = Encoding.ASCII.GetBytes(jwtKey);

View File

@@ -6,7 +6,6 @@
}
},
"Jwt": {
"Key": "",
"Issuer": "GestionIntegralApi",
"Audience": "GestionIntegralClient",
"DurationInHours": 8