Add Rider launch profiles, fix DI and migrations for dev startup

- Rider launch profiles: "ScadaLink Central" and "ScadaLink Site"
- appsettings.Central.json: correct test_infra credentials (ScadaLink_Dev1#,
  scadalink_app user, GLAuth on 3893, Mailpit on 1025)
- Fix HealthMonitoring DI: split site vs central registration to avoid
  missing IHealthReportTransport on central
- Regenerate single clean EF migration (InitialSchema) covering all entities
- Suppress PendingModelChangesWarning in dev mode
- Fix isDevelopment check for ASPNETCORE_ENVIRONMENT propagation

Verified: Host starts, connects to SQL Server, applies migrations, boots
Akka.NET cluster, LDAP auth works (admin/password via GLAuth), health
endpoint returns Healthy.
This commit is contained in:
Joseph Doherty
2026-03-17 03:01:21 -04:00
parent 2b2cc0a151
commit 121983fd66
11 changed files with 1721 additions and 1187 deletions

View File

@@ -65,6 +65,7 @@ try
builder.Services.AddClusterInfrastructure();
builder.Services.AddCommunication();
builder.Services.AddHealthMonitoring();
builder.Services.AddCentralHealthAggregation();
builder.Services.AddExternalSystemGateway();
builder.Services.AddNotificationService();
@@ -98,7 +99,8 @@ try
// Apply or validate database migrations (skip when running in test harness)
if (!string.Equals(configuration["ScadaLink:Database:SkipMigrations"], "true", StringComparison.OrdinalIgnoreCase))
{
var isDevelopment = app.Environment.IsDevelopment();
var isDevelopment = app.Environment.IsDevelopment()
|| string.Equals(Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT"), "Development", StringComparison.OrdinalIgnoreCase);
using (var scope = app.Services.CreateScope())
{
var dbContext = scope.ServiceProvider.GetRequiredService<ScadaLinkDbContext>();

View File

@@ -0,0 +1,24 @@
{
"profiles": {
"ScadaLink Central": {
"commandName": "Project",
"dotnetRunMessages": true,
"launchBrowser": true,
"launchUrl": "",
"applicationUrl": "https://localhost:5001;http://localhost:5000",
"environmentVariables": {
"DOTNET_ENVIRONMENT": "Central",
"ASPNETCORE_ENVIRONMENT": "Development"
}
},
"ScadaLink Site": {
"commandName": "Project",
"dotnetRunMessages": true,
"launchBrowser": false,
"environmentVariables": {
"DOTNET_ENVIRONMENT": "Site",
"ASPNETCORE_ENVIRONMENT": "Development"
}
}
}
}

View File

@@ -2,13 +2,13 @@
"ScadaLink": {
"Node": {
"Role": "Central",
"NodeHostname": "central-node1",
"NodeHostname": "localhost",
"RemotingPort": 8081
},
"Cluster": {
"SeedNodes": [
"akka.tcp://scadalink@central-node1:8081",
"akka.tcp://scadalink@central-node2:8081"
"akka.tcp://scadalink@localhost:8081",
"akka.tcp://scadalink@localhost:8082"
],
"SplitBrainResolverStrategy": "keep-oldest",
"StableAfter": "00:00:15",
@@ -17,8 +17,8 @@
"MinNrOfMembers": 1
},
"Database": {
"ConfigurationDb": "Server=localhost,1433;Database=ScadaLink_Config;User Id=sa;Password=YourPassword;TrustServerCertificate=True",
"MachineDataDb": "Server=localhost,1433;Database=ScadaLink_MachineData;User Id=sa;Password=YourPassword;TrustServerCertificate=True"
"ConfigurationDb": "Server=localhost,1433;Database=ScadaLinkConfig;User Id=scadalink_app;Password=ScadaLink_Dev1#;TrustServerCertificate=true",
"MachineDataDb": "Server=localhost,1433;Database=ScadaLinkMachineData;User Id=scadalink_app;Password=ScadaLink_Dev1#;TrustServerCertificate=true"
},
"Security": {
"LdapServer": "localhost",
@@ -26,7 +26,7 @@
"LdapUseTls": false,
"AllowInsecureLdap": true,
"LdapSearchBase": "dc=scadalink,dc=local",
"JwtSigningKey": "CHANGE-ME-development-signing-key-at-least-32-chars",
"JwtSigningKey": "scadalink-dev-jwt-signing-key-must-be-at-least-32-characters-long",
"JwtExpiryMinutes": 15,
"IdleTimeoutMinutes": 30
},
@@ -44,7 +44,12 @@
"InboundApi": {
"DefaultMethodTimeout": "00:00:30"
},
"Notification": {},
"Notification": {
"SmtpServer": "localhost",
"SmtpPort": 1025,
"AuthMode": "None",
"FromAddress": "scada-notifications@company.com"
},
"Logging": {
"MinimumLevel": "Information"
}

File diff suppressed because it is too large Load Diff