Test commento sezione startup.cs

This commit is contained in:
Samuele Locatelli
2024-05-09 17:22:10 +02:00
parent f273aaaf5a
commit 4f4a0ec2b4
6 changed files with 52 additions and 43 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
<body>
<i>WebDoorCreator - Egalware</i>
<h4>Version: 0.9.2405.0916</h4>
<h4>Version: 0.9.2405.0917</h4>
<br /> Release note:
<ul>
<li>
+1 -1
View File
@@ -1 +1 @@
0.9.2405.0916
0.9.2405.0917
+1 -1
View File
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<item>
<version>0.9.2405.0916</version>
<version>0.9.2405.0917</version>
<url>http://nexus.steamware.net/repository/SWS/WDC/stable/WDC.UI.zip</url>
<changelog>http://nexus.steamware.net/repository/SWS/WDC/stable/ChangeLog.html</changelog>
<mandatory>false</mandatory>
+11 -9
View File
@@ -83,16 +83,18 @@ builder.Services.AddHealthChecks()
.AddAsyncCheck($"Doors Table", () => WebDoorCreator.API.Health.Checks.DoorsCount(configuration))
;
#if false
builder.Services
.AddHealthChecksUI(s =>
{
s.AddHealthCheckEndpoint("WDC_API_HC", "health");
s.SetEvaluationTimeInSeconds(60);
s.SetMinimumSecondsBetweenFailureNotifications(120);
s.SetApiMaxActiveRequests(5);
s.SetHeaderText("WDC.API Health Check Status");
})
.AddInMemoryStorage();
.AddHealthChecksUI(s =>
{
s.AddHealthCheckEndpoint("WDC_API_HC", "health");
s.SetEvaluationTimeInSeconds(60);
s.SetMinimumSecondsBetweenFailureNotifications(120);
s.SetApiMaxActiveRequests(5);
s.SetHeaderText("WDC.API Health Check Status");
})
.AddInMemoryStorage();
#endif
// abilitazione x email management con MailKit
//builder.Services.AddTransient<IEmailSender, MailKitEmailSender>();
+37 -30
View File
@@ -1,27 +1,21 @@
using Blazored.LocalStorage;
using Blazored.SessionStorage;
using HealthChecks.UI.Client;
using Microsoft.AspNetCore.Components;
using Microsoft.AspNetCore.Components.Authorization;
using Microsoft.AspNetCore.Components.Web;
using Microsoft.AspNetCore.Diagnostics.HealthChecks;
using Microsoft.AspNetCore.Identity;
using Microsoft.AspNetCore.Identity.UI;
using Microsoft.AspNetCore.Identity.UI.Services;
using Microsoft.AspNetCore.Localization;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Diagnostics.HealthChecks;
using Microsoft.Extensions.FileProviders;
using StackExchange.Redis;
using System.Configuration;
using System.Globalization;
using System.Text.Json.Serialization;
using WebDoorCreator.Data;
using WebDoorCreator.Data.Services;
using WebDoorCreator.UI;
using WebDoorCreator.UI.Areas.Identity;
using WebDoorCreator.UI.Data;
using static Org.BouncyCastle.Math.EC.ECCurve;
var builder = WebApplication.CreateBuilder(args);
// configuration setup
@@ -30,6 +24,10 @@ Microsoft.Extensions.Configuration.ConfigurationManager configuration = builder.
// REDIS setup
string connStringRedis = configuration.GetConnectionString("Redis");
if (string.IsNullOrEmpty(connStringRedis))
{
connStringRedis = "localhost:6379, DefaultDatabase=11, connectTimeout=5000, syncTimeout=5000, asyncTimeout=5000, abortConnect=false, ssl=false";
}
string redisSrvAddr = connStringRedis.Substring(0, connStringRedis.IndexOf(":"));
// avvio oggetto shared x redis...
var redisMultiplexer = ConnectionMultiplexer.Connect(connStringRedis);
@@ -37,27 +35,34 @@ var redisMultiplexer = ConnectionMultiplexer.Connect(connStringRedis);
// AspNetCore Identity setup
var connectionString = configuration.GetConnectionString("Identity.DB");
string dbServerAddr = "127.0.0.1";
if (connectionString.Contains("Server"))
if (string.IsNullOrEmpty(connectionString))
{
bool trovato = false;
var dbTokens = connectionString.Split(";");
int numTok = dbTokens.Count();
int idx = 0;
while (!trovato && idx < numTok)
connectionString = "Server=SQL2016DEV;Database=WebDoorCreator; User ID=sa;Password=keyhammer16; integrated security=False; MultipleActiveResultSets=True; App=WebDoorCreator.SRV;";
}
else
{
if (connectionString.Contains("Server"))
{
if (dbTokens[idx].StartsWith("Server="))
bool trovato = false;
var dbTokens = connectionString.Split(";");
int numTok = dbTokens.Count();
int idx = 0;
while (!trovato && idx < numTok)
{
// rimuovo la chaive Server...
dbServerAddr = dbTokens[idx].Replace("Server=", "");
// se ci fosse un nome (tipo \\sqlexpress) rimuovo...
if (dbServerAddr.Contains("\\"))
if (dbTokens[idx].StartsWith("Server="))
{
int sIdx = dbServerAddr.IndexOf("\\");
dbServerAddr = dbServerAddr.Substring(0, sIdx);
// rimuovo la chaive Server...
dbServerAddr = dbTokens[idx].Replace("Server=", "");
// se ci fosse un nome (tipo \\sqlexpress) rimuovo...
if (dbServerAddr.Contains("\\"))
{
int sIdx = dbServerAddr.IndexOf("\\");
dbServerAddr = dbServerAddr.Substring(0, sIdx);
}
trovato = true;
}
trovato = true;
idx++;
}
idx++;
}
}
// healthchecks
@@ -73,16 +78,18 @@ builder.Services.AddHealthChecks()
.AddAsyncCheck($"Doors Table", () => WebDoorCreator.UI.Health.Checks.DoorsCount(configuration))
;
#if false
builder.Services
.AddHealthChecksUI(s =>
{
s.AddHealthCheckEndpoint("WDC_UI_HC", "health");
s.SetEvaluationTimeInSeconds(60);
s.SetMinimumSecondsBetweenFailureNotifications(120);
s.SetApiMaxActiveRequests(5);
s.SetHeaderText("WDC.UI Health Check Status");
})
.AddInMemoryStorage();
.AddHealthChecksUI(s =>
{
s.AddHealthCheckEndpoint("WDC_UI_HC", "health");
s.SetEvaluationTimeInSeconds(60);
s.SetMinimumSecondsBetweenFailureNotifications(120);
s.SetApiMaxActiveRequests(5);
s.SetHeaderText("WDC.UI Health Check Status");
})
.AddInMemoryStorage();
#endif
// abilitazione x email management con MailKit
builder.Services.AddTransient<IEmailSender, MailKitEmailSender>();
+1 -1
View File
@@ -3,7 +3,7 @@
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<Nullable>enable</Nullable>
<Version>0.9.2405.0916</Version>
<Version>0.9.2405.0917</Version>
<ImplicitUsings>enable</ImplicitUsings>
<UserSecretsId>aspnet-WebDoorCreator.UI-dfe95fed-1398-4144-bd43-8b3a765d6608</UserSecretsId>
</PropertyGroup>