fix: restaurar carregamento de Docker Secrets no Program.cs
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:
parent
dbd3c8851b
commit
bdf78ed418
16
Program.cs
16
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()
|
||||
|
||||
Loading…
Reference in New Issue
Block a user