fix(web): load connection string from config and default to local IP
WBS-9.3 - NULL Policy CI Gate / NULL Policy Validation (push) Failing after 3s

This commit is contained in:
2026-06-25 16:48:46 +09:00
parent add42ed292
commit 5bdbf17686
2 changed files with 6 additions and 2 deletions
+2 -1
View File
@@ -10,7 +10,8 @@ builder.Services.AddRazorComponents()
.AddInteractiveServerComponents(); .AddInteractiveServerComponents();
// PostgreSQL Dapper Setup // PostgreSQL Dapper Setup
var connectionString = "Host=178.104.200.7;Database=giteadb;Username=gitea;Password=C8RFlZ9fdQrBA1vyLhLDS4v70I8dJfRS2ERJW4+zsS4=;Search Path=quantengine;"; var connectionString = builder.Configuration.GetConnectionString("DefaultConnection")
?? "Host=127.0.0.1;Database=giteadb;Username=gitea;Password=C8RFlZ9fdQrBA1vyLhLDS4v70I8dJfRS2ERJW4+zsS4=;Search Path=quantengine;";
builder.Services.AddSingleton<IDbConnectionFactory>(new DbConnectionFactory(connectionString)); builder.Services.AddSingleton<IDbConnectionFactory>(new DbConnectionFactory(connectionString));
builder.Services.AddScoped<IWorkspaceRepository, WorkspaceRepository>(); builder.Services.AddScoped<IWorkspaceRepository, WorkspaceRepository>();
builder.Services.AddHttpClient(); builder.Services.AddHttpClient();
+4 -1
View File
@@ -5,5 +5,8 @@
"Microsoft.AspNetCore": "Warning" "Microsoft.AspNetCore": "Warning"
} }
}, },
"AllowedHosts": "*" "AllowedHosts": "*",
"ConnectionStrings": {
"DefaultConnection": "Host=127.0.0.1;Database=giteadb;Username=gitea;Password=C8RFlZ9fdQrBA1vyLhLDS4v70I8dJfRS2ERJW4+zsS4=;Search Path=quantengine;"
}
} }