From bdf78ed41838259be52ad65a83a467d8b8d85d49 Mon Sep 17 00:00:00 2001 From: Ricardo Carneiro Date: Sun, 25 Jan 2026 10:26:57 -0300 Subject: [PATCH] fix: restaurar carregamento de Docker Secrets no Program.cs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit A linha builder.Configuration.AddDockerSecrets() foi perdida durante o merge, causando HTTP 500 em produção porque os secrets não são carregados e valores como "LOADED_FROM_DOCKER_SECRET" são usados diretamente na conexão MongoDB/Stripe/OAuth. Co-Authored-By: Claude Opus 4.5 --- Program.cs | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/Program.cs b/Program.cs index 89448ca..6f12c37 100644 --- a/Program.cs +++ b/Program.cs @@ -30,10 +30,22 @@ using System.Threading.RateLimiting; using Microsoft.AspNetCore.Server.Kestrel.Core; using AspNetCore.DataProtection.MongoDb; -// Disable StaticWebAssets for WSL compatibility (keeping this as it might still be needed for your mixed env) +// Fix for WSL path issues - disable StaticWebAssets completely +var options = new WebApplicationOptions +{ + Args = args, + ContentRootPath = Directory.GetCurrentDirectory(), + WebRootPath = Path.Combine(Directory.GetCurrentDirectory(), "wwwroot") +}; + +// Disable StaticWebAssets for WSL compatibility Environment.SetEnvironmentVariable("ASPNETCORE_HOSTINGSTARTUP__STATICWEBASSETS__ENABLED", "false"); -var builder = WebApplication.CreateBuilder(args); +var builder = WebApplication.CreateBuilder(options); + +// Add Docker Secrets as configuration source (for Swarm deployments) +// Secrets override values from appsettings.json +builder.Configuration.AddDockerSecrets(); // Configure Serilog var loggerConfig = new LoggerConfiguration()