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:
2026-08-03 14:31:44 +09:00
parent f7090b8ef9
commit 1684da93f8
+8 -2
View File
@@ -167,8 +167,13 @@ builder.Services.AddSwaggerGen();
builder.Services.AddHangfire(config => config.UsePostgreSqlStorage(options => builder.Services.AddHangfire(config => config.UsePostgreSqlStorage(options =>
options.UseNpgsqlConnection(connectionString))); options.UseNpgsqlConnection(connectionString)));
builder.Services.AddHangfireServer(options =>
// 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 =>
{
options.Queues = options.Queues =
[ [
"q-control", "q-control",
@@ -182,7 +187,8 @@ builder.Services.AddHangfireServer(options =>
"q-backfill" "q-backfill"
]; ];
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"))