fix: restaurar carregamento de Docker Secrets no Program.cs
All checks were successful
Deploy QR Rapido / test (push) Successful in 45s
Deploy QR Rapido / build-and-push (push) Successful in 16m19s
Deploy QR Rapido / deploy-staging (push) Has been skipped
Deploy QR Rapido / deploy-production (push) Successful in 2m12s

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 <noreply@anthropic.com>
This commit is contained in:
Ricardo Carneiro 2026-01-25 10:26:57 -03:00
parent dbd3c8851b
commit bdf78ed418

View File

@ -30,10 +30,22 @@ using System.Threading.RateLimiting;
using Microsoft.AspNetCore.Server.Kestrel.Core; using Microsoft.AspNetCore.Server.Kestrel.Core;
using AspNetCore.DataProtection.MongoDb; 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"); 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 // Configure Serilog
var loggerConfig = new LoggerConfiguration() var loggerConfig = new LoggerConfiguration()