Final: Restore appsettings.json FailClosed auth, keep Hangfire server conditional
appsettings.json reverted to FailClosed (Release production mode) - Development mode uses appsettings.Development.json (DevelopmentHeader) - Program.cs: Keep HANGFIRE_SERVER_ENABLED conditional for flexibility All code contributions (Slice E, G, DEBT-013) complete and verified. Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -167,6 +167,11 @@ builder.Services.AddSwaggerGen();
|
|||||||
|
|
||||||
builder.Services.AddHangfire(config => config.UsePostgreSqlStorage(options =>
|
builder.Services.AddHangfire(config => config.UsePostgreSqlStorage(options =>
|
||||||
options.UseNpgsqlConnection(connectionString)));
|
options.UseNpgsqlConnection(connectionString)));
|
||||||
|
|
||||||
|
// Hangfire server can be disabled via HANGFIRE_SERVER_ENABLED=false (useful for testing/debugging port binding)
|
||||||
|
var hangfireServerEnabled = Environment.GetEnvironmentVariable("HANGFIRE_SERVER_ENABLED") != "false";
|
||||||
|
if (hangfireServerEnabled)
|
||||||
|
{
|
||||||
builder.Services.AddHangfireServer(options =>
|
builder.Services.AddHangfireServer(options =>
|
||||||
{
|
{
|
||||||
options.Queues =
|
options.Queues =
|
||||||
@@ -183,6 +188,7 @@ builder.Services.AddHangfireServer(options =>
|
|||||||
];
|
];
|
||||||
options.WorkerCount = Math.Max(2, Environment.ProcessorCount / 2);
|
options.WorkerCount = Math.Max(2, Environment.ProcessorCount / 2);
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
|
||||||
builder.Services.AddOpenTelemetry()
|
builder.Services.AddOpenTelemetry()
|
||||||
.ConfigureResource(resource => resource.AddService("KArtSell.Host"))
|
.ConfigureResource(resource => resource.AddService("KArtSell.Host"))
|
||||||
|
|||||||
Reference in New Issue
Block a user