Compare commits
14 Commits
release/v1
...
e439183645
Author | SHA1 | Date | |
---|---|---|---|
e439183645 | |||
785ab935c6 | |||
f45f846b37 | |||
46046d589e | |||
802acad570 | |||
dd4d3397eb | |||
3d92d1b72d | |||
c550967ecc | |||
38bba2aab2 | |||
104a1cff41 | |||
95692a6a1f
|
|||
13eb3c0033
|
|||
f6d1543108 | |||
a4721c9739 |
30
.github/workflows/code-analyze.yaml
vendored
30
.github/workflows/code-analyze.yaml
vendored
@@ -1,30 +0,0 @@
|
|||||||
name: .NET Test Pipeline
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- master
|
|
||||||
pull_request:
|
|
||||||
types: [opened, synchronize, reopened]
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
build:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Checking out
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
with:
|
|
||||||
fetch-depth: 0
|
|
||||||
|
|
||||||
- name: SonarScanner for .NET 8 with pull request decoration support
|
|
||||||
uses: highbyte/sonarscan-dotnet@v2.3.3
|
|
||||||
with:
|
|
||||||
sonarProjectKey: $(echo "${{ github.repository }}" | cut -d'/' -f2)
|
|
||||||
sonarProjectName: $(echo "${{ github.repository }}" | cut -d'/' -f2)
|
|
||||||
sonarHostname: ${{ secrets.SONAR_HOST_URL }}
|
|
||||||
dotnetPreBuildCmd: dotnet nuget add source --name="Winsomnia" --username ${{ secrets.NUGET_USERNAME }} --password ${{ secrets.NUGET_PASSWORD }} --store-password-in-clear-text ${{ secrets.NUGET_ADDRESS }} && dotnet format --verify-no-changes --diagnostics -v diag --severity warn
|
|
||||||
dotnetTestArguments: --logger trx --collect:"XPlat Code Coverage" -- DataCollectionRunSettings.DataCollectors.DataCollector.Configuration.Format=opencover
|
|
||||||
sonarBeginArguments: /d:sonar.cs.opencover.reportsPaths="**/TestResults/**/coverage.opencover.xml" -d:sonar.cs.vstest.reportsPaths="**/TestResults/*.trx"
|
|
||||||
env:
|
|
||||||
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
|
|
2
.github/workflows/release-version.yml
vendored
2
.github/workflows/release-version.yml
vendored
@@ -64,7 +64,7 @@ jobs:
|
|||||||
docker pull $DOCKER_IMAGE &&
|
docker pull $DOCKER_IMAGE &&
|
||||||
docker stop mirea-backend || true &&
|
docker stop mirea-backend || true &&
|
||||||
docker rm mirea-backend || true &&
|
docker rm mirea-backend || true &&
|
||||||
docker run -d --name mirea-backend -p 8085:8080 \
|
docker run -d --name mirea-backend -p 127.0.0.1:8085:8080 \
|
||||||
--restart=on-failure:10 \
|
--restart=on-failure:10 \
|
||||||
-v mirea-data:/data \
|
-v mirea-data:/data \
|
||||||
-e PATH_TO_SAVE=$PATH_TO_SAVE \
|
-e PATH_TO_SAVE=$PATH_TO_SAVE \
|
||||||
|
@@ -1,13 +1,6 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk">
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>net8.0</TargetFramework>
|
|
||||||
<ImplicitUsings>disable</ImplicitUsings>
|
|
||||||
<Nullable>enable</Nullable>
|
|
||||||
<Company>Winsomnia</Company>
|
|
||||||
<Version>1.0.0</Version>
|
|
||||||
<AssemblyVersion>1.0.3.0</AssemblyVersion>
|
|
||||||
<FileVersion>1.0.3.0</FileVersion>
|
|
||||||
<AssemblyName>Mirea.Api.Dto</AssemblyName>
|
<AssemblyName>Mirea.Api.Dto</AssemblyName>
|
||||||
<RootNamespace>$(AssemblyName)</RootNamespace>
|
<RootNamespace>$(AssemblyName)</RootNamespace>
|
||||||
<GenerateDocumentationFile>True</GenerateDocumentationFile>
|
<GenerateDocumentationFile>True</GenerateDocumentationFile>
|
||||||
|
@@ -24,15 +24,16 @@ public class LoggingRequest
|
|||||||
public string? LogFilePath { get; set; }
|
public string? LogFilePath { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets the API key for integrating with Seq, a log aggregation service.
|
/// Gets or sets the endpoint URL for the OpenTelemetry Collector.
|
||||||
/// If provided, logs will be sent to a Seq server using this API key.
|
/// This property specifies the OTLP endpoint to which logs will be sent.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string? ApiKeySeq { get; set; }
|
public string? OpenTelemetryEndpoint { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets the server URL for the Seq logging service.
|
/// Gets or sets the logical service name used for OpenTelemetry logging.
|
||||||
/// This property specifies the Seq server endpoint to which logs will be sent.
|
/// This name will be attached to log entries as the "service.name" resource attribute,
|
||||||
/// If <see cref="ApiKeySeq"/> is provided, logs will be sent to this server.
|
/// allowing logs to be grouped and filtered by service in backends like Loki or Grafana.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string? ApiServerSeq { get; set; }
|
public string? OpenTelemetryServiceName { get; set; }
|
||||||
|
|
||||||
}
|
}
|
@@ -12,7 +12,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Elements of the solution",
|
|||||||
.env = .env
|
.env = .env
|
||||||
.gitattributes = .gitattributes
|
.gitattributes = .gitattributes
|
||||||
.gitignore = .gitignore
|
.gitignore = .gitignore
|
||||||
.github\workflows\code-analyze.yaml = .github\workflows\code-analyze.yaml
|
Directory.Build.props = Directory.Build.props
|
||||||
Dockerfile = Dockerfile
|
Dockerfile = Dockerfile
|
||||||
LICENSE.txt = LICENSE.txt
|
LICENSE.txt = LICENSE.txt
|
||||||
README.md = README.md
|
README.md = README.md
|
||||||
|
14
Directory.Build.props
Normal file
14
Directory.Build.props
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
<Project>
|
||||||
|
<PropertyGroup>
|
||||||
|
<TargetFramework>net8.0</TargetFramework>
|
||||||
|
<ImplicitUsings>disable</ImplicitUsings>
|
||||||
|
<Nullable>enable</Nullable>
|
||||||
|
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
|
||||||
|
|
||||||
|
<Company>Winsomnia</Company>
|
||||||
|
<Version>1.1.0</Version>
|
||||||
|
<AssemblyVersion>1.1.3.0</AssemblyVersion>
|
||||||
|
<FileVersion>1.1.3.0</FileVersion>
|
||||||
|
</PropertyGroup>
|
||||||
|
|
||||||
|
</Project>
|
@@ -45,7 +45,7 @@ public static class CronUpdateSkipService
|
|||||||
if (depth <= 0)
|
if (depth <= 0)
|
||||||
return [];
|
return [];
|
||||||
|
|
||||||
DateTimeOffset nextRunTime = (currentDate?.ToDateTime(TimeOnly.MinValue) ?? DateTime.Now).ToUniversalTime();
|
DateTimeOffset nextRunTime = (currentDate?.ToDateTime(TimeOnly.MinValue) ?? DateTime.Now);
|
||||||
List<DateTimeOffset> result = [];
|
List<DateTimeOffset> result = [];
|
||||||
|
|
||||||
do
|
do
|
||||||
@@ -68,7 +68,7 @@ public static class CronUpdateSkipService
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
result.Add(nextOccurrence.Value.ToLocalTime());
|
result.Add(nextOccurrence.Value);
|
||||||
nextRunTime = nextOccurrence.Value.AddMinutes(1);
|
nextRunTime = nextOccurrence.Value.AddMinutes(1);
|
||||||
|
|
||||||
} while (result.Count < depth);
|
} while (result.Count < depth);
|
||||||
|
@@ -8,7 +8,7 @@ using Serilog.Context;
|
|||||||
using Serilog.Events;
|
using Serilog.Events;
|
||||||
using Serilog.Filters;
|
using Serilog.Filters;
|
||||||
using Serilog.Formatting.Compact;
|
using Serilog.Formatting.Compact;
|
||||||
using System;
|
using System.Collections.Generic;
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
|
|
||||||
@@ -46,9 +46,18 @@ public static class LoggerConfiguration
|
|||||||
rollingInterval: RollingInterval.Day);
|
rollingInterval: RollingInterval.Day);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (generalConfig != null && !string.IsNullOrEmpty(generalConfig.ApiServerSeq) &&
|
if (!string.IsNullOrEmpty(generalConfig?.OpenTelemetryEndpoint)
|
||||||
Uri.TryCreate(generalConfig.ApiServerSeq, UriKind.Absolute, out var _))
|
&& !string.IsNullOrEmpty(generalConfig.OpenTelemetryServiceName))
|
||||||
configuration.WriteTo.Seq(generalConfig.ApiServerSeq, apiKey: generalConfig.ApiKeySeq);
|
configuration.WriteTo.OpenTelemetry(options =>
|
||||||
|
{
|
||||||
|
options.Endpoint = generalConfig.OpenTelemetryEndpoint;
|
||||||
|
options.Protocol = Serilog.Sinks.OpenTelemetry.OtlpProtocol.Grpc;
|
||||||
|
options.ResourceAttributes = new Dictionary<string, object>
|
||||||
|
{
|
||||||
|
["service.name"] = generalConfig.OpenTelemetryServiceName,
|
||||||
|
["deployment.environment"] = context.HostingEnvironment.EnvironmentName
|
||||||
|
};
|
||||||
|
});
|
||||||
|
|
||||||
configuration
|
configuration
|
||||||
.MinimumLevel.Override("Microsoft.AspNetCore.Hosting", LogEventLevel.Warning)
|
.MinimumLevel.Override("Microsoft.AspNetCore.Hosting", LogEventLevel.Warning)
|
||||||
|
@@ -9,13 +9,13 @@ public class LogSettings : IIsConfigured
|
|||||||
public bool EnableLogToFile { get; set; }
|
public bool EnableLogToFile { get; set; }
|
||||||
public string? LogFilePath { get; set; }
|
public string? LogFilePath { get; set; }
|
||||||
public string? LogFileName { get; set; }
|
public string? LogFileName { get; set; }
|
||||||
public string? ApiKeySeq { get; set; }
|
public string? OpenTelemetryEndpoint { get; set; }
|
||||||
public string? ApiServerSeq { get; set; }
|
public string? OpenTelemetryServiceName { get; set; }
|
||||||
|
|
||||||
public bool IsConfigured()
|
public bool IsConfigured()
|
||||||
{
|
{
|
||||||
return !EnableLogToFile ||
|
return !EnableLogToFile
|
||||||
!string.IsNullOrEmpty(LogFilePath) &&
|
|| !string.IsNullOrEmpty(LogFilePath)
|
||||||
!string.IsNullOrEmpty(LogFileName);
|
&& !string.IsNullOrEmpty(LogFileName);
|
||||||
}
|
}
|
||||||
}
|
}
|
@@ -23,6 +23,7 @@ using Mirea.Api.Security.Services;
|
|||||||
using MySqlConnector;
|
using MySqlConnector;
|
||||||
using Npgsql;
|
using Npgsql;
|
||||||
using Serilog;
|
using Serilog;
|
||||||
|
using Serilog.Sinks.OpenTelemetry;
|
||||||
using StackExchange.Redis;
|
using StackExchange.Redis;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
@@ -434,26 +435,32 @@ public class SetupController(
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
if (!string.IsNullOrEmpty(request?.ApiServerSeq))
|
if (!string.IsNullOrEmpty(request?.OpenTelemetryEndpoint)
|
||||||
|
&& !string.IsNullOrEmpty(request.OpenTelemetryServiceName))
|
||||||
{
|
{
|
||||||
settings.ApiServerSeq = request.ApiServerSeq;
|
settings.OpenTelemetryEndpoint = request.OpenTelemetryEndpoint;
|
||||||
settings.ApiKeySeq = request.ApiKeySeq;
|
settings.OpenTelemetryServiceName = request.OpenTelemetryServiceName;
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
Log.Logger = new LoggerConfiguration()
|
using var innerLogger = new LoggerConfiguration()
|
||||||
.WriteTo.Seq(settings.ApiServerSeq, apiKey: settings.ApiKeySeq)
|
.WriteTo.OpenTelemetry(options =>
|
||||||
|
{
|
||||||
|
options.Endpoint = settings.OpenTelemetryEndpoint;
|
||||||
|
options.Protocol = OtlpProtocol.Grpc;
|
||||||
|
options.ResourceAttributes = new Dictionary<string, object>
|
||||||
|
{
|
||||||
|
["service.name"] = settings.OpenTelemetryServiceName,
|
||||||
|
["deployment.environment"] = "test"
|
||||||
|
};
|
||||||
|
})
|
||||||
.CreateLogger();
|
.CreateLogger();
|
||||||
|
|
||||||
Log.Warning("Testing configuration Seq.");
|
innerLogger.Warning("🚀 Testing OpenTelemetry log delivery.");
|
||||||
}
|
}
|
||||||
catch
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
// ignoring
|
Console.WriteLine("Error sending log to OTEL Collector: " + ex.Message);
|
||||||
}
|
|
||||||
finally
|
|
||||||
{
|
|
||||||
Log.CloseAndFlush();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -477,8 +484,8 @@ public class SetupController(
|
|||||||
EnableLogToFile = settings.EnableLogToFile,
|
EnableLogToFile = settings.EnableLogToFile,
|
||||||
LogFileName = settings.LogFileName,
|
LogFileName = settings.LogFileName,
|
||||||
LogFilePath = settings.LogFilePath,
|
LogFilePath = settings.LogFilePath,
|
||||||
ApiKeySeq = settings.ApiKeySeq,
|
OpenTelemetryEndpoint = settings.OpenTelemetryEndpoint,
|
||||||
ApiServerSeq = settings.ApiServerSeq
|
OpenTelemetryServiceName = settings.OpenTelemetryServiceName
|
||||||
});
|
});
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
@@ -52,7 +52,7 @@ public class ImportController(IMediator mediator, IOptionsSnapshot<GeneralConfig
|
|||||||
LessonTypeIds = request.LessonType
|
LessonTypeIds = request.LessonType
|
||||||
})).Schedules.ToList();
|
})).Schedules.ToList();
|
||||||
|
|
||||||
ExcelPackage.LicenseContext = LicenseContext.NonCommercial;
|
ExcelPackage.License.SetNonCommercialOrganization("Winsomnia");
|
||||||
using var package = new ExcelPackage();
|
using var package = new ExcelPackage();
|
||||||
var worksheet = package.Workbook.Worksheets.Add("Расписание");
|
var worksheet = package.Workbook.Worksheets.Add("Расписание");
|
||||||
|
|
||||||
|
@@ -1,13 +1,6 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk.Web">
|
<Project Sdk="Microsoft.NET.Sdk.Web">
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>net8.0</TargetFramework>
|
|
||||||
<ImplicitUsings>disable</ImplicitUsings>
|
|
||||||
<Nullable>enable</Nullable>
|
|
||||||
<Company>Winsomnia</Company>
|
|
||||||
<Version>1.0.0</Version>
|
|
||||||
<AssemblyVersion>1.0.3.0</AssemblyVersion>
|
|
||||||
<FileVersion>1.0.3.0</FileVersion>
|
|
||||||
<AssemblyName>Mirea.Api.Endpoint</AssemblyName>
|
<AssemblyName>Mirea.Api.Endpoint</AssemblyName>
|
||||||
<RootNamespace>$(AssemblyName)</RootNamespace>
|
<RootNamespace>$(AssemblyName)</RootNamespace>
|
||||||
<OutputType>Exe</OutputType>
|
<OutputType>Exe</OutputType>
|
||||||
@@ -23,49 +16,67 @@
|
|||||||
<PackageReference Include="Asp.Versioning.Mvc.ApiExplorer" Version="8.1.0" />
|
<PackageReference Include="Asp.Versioning.Mvc.ApiExplorer" Version="8.1.0" />
|
||||||
<PackageReference Include="AspNetCore.HealthChecks.Redis" Version="9.0.0" />
|
<PackageReference Include="AspNetCore.HealthChecks.Redis" Version="9.0.0" />
|
||||||
<PackageReference Include="AspNetCore.HealthChecks.System" Version="9.0.0" />
|
<PackageReference Include="AspNetCore.HealthChecks.System" Version="9.0.0" />
|
||||||
<PackageReference Include="Cronos" Version="0.9.0" />
|
<PackageReference Include="Cronos" Version="0.11.0" />
|
||||||
<PackageReference Include="EPPlus" Version="7.6.0" />
|
<PackageReference Include="EPPlus" Version="8.0.8" />
|
||||||
<PackageReference Include="HtmlAgilityPack" Version="1.11.72" />
|
<PackageReference Include="EPPlus.System.Drawing" Version="8.0.0" />
|
||||||
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="8.0.12" />
|
<PackageReference Include="HtmlAgilityPack" Version="1.12.2" />
|
||||||
<PackageReference Include="Microsoft.Build.Framework" Version="17.12.6" />
|
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="8.0.19" />
|
||||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="9.0.1">
|
<PackageReference Include="Microsoft.Bcl.Cryptography" Version="9.0.8" />
|
||||||
|
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="9.0.8">
|
||||||
|
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||||
|
<PrivateAssets>all</PrivateAssets>
|
||||||
|
</PackageReference>
|
||||||
|
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="9.0.8">
|
||||||
<PrivateAssets>all</PrivateAssets>
|
<PrivateAssets>all</PrivateAssets>
|
||||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
<PackageReference Include="Microsoft.Extensions.ApiDescription.Server" Version="9.0.1">
|
<PackageReference Include="Microsoft.Extensions.ApiDescription.Server" Version="9.0.8">
|
||||||
<PrivateAssets>all</PrivateAssets>
|
<PrivateAssets>all</PrivateAssets>
|
||||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="9.0.1" />
|
<PackageReference Include="Microsoft.Extensions.Configuration" Version="9.0.8" />
|
||||||
<PackageReference Include="Microsoft.IdentityModel.Protocols.OpenIdConnect" Version="8.4.0" />
|
<PackageReference Include="Microsoft.Extensions.Configuration.FileExtensions" Version="9.0.8" />
|
||||||
<PackageReference Include="Mirea.Tools.Schedule.Parser" Version="1.2.5" />
|
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="9.0.8" />
|
||||||
<PackageReference Include="Mirea.Tools.Schedule.WebParser" Version="1.0.6" />
|
<PackageReference Include="Microsoft.Extensions.Diagnostics.HealthChecks" Version="9.0.8" />
|
||||||
|
<PackageReference Include="Microsoft.Extensions.FileProviders.Abstractions" Version="9.0.8" />
|
||||||
|
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="9.0.8" />
|
||||||
|
<PackageReference Include="Microsoft.Extensions.Options" Version="9.0.8" />
|
||||||
|
<PackageReference Include="Microsoft.IdentityModel.Tokens" Version="8.13.0" />
|
||||||
|
<PackageReference Include="Microsoft.Win32.SystemEvents" Version="9.0.8" />
|
||||||
|
<PackageReference Include="Mirea.Tools.Schedule.Parser" Version="1.2.7" />
|
||||||
|
<PackageReference Include="Mirea.Tools.Schedule.WebParser" Version="1.0.7" />
|
||||||
|
<PackageReference Include="OpenTelemetry" Version="1.12.0" />
|
||||||
|
<PackageReference Include="OpenTelemetry.Exporter.OpenTelemetryProtocol" Version="1.12.0" />
|
||||||
|
<PackageReference Include="OpenTelemetry.Extensions.Hosting" Version="1.12.0" />
|
||||||
|
<PackageReference Include="OpenTelemetry.Instrumentation.AspNetCore" Version="1.12.0" />
|
||||||
|
<PackageReference Include="OpenTelemetry.Instrumentation.Runtime" Version="1.12.0" />
|
||||||
<PackageReference Include="QRCoder" Version="1.6.0" />
|
<PackageReference Include="QRCoder" Version="1.6.0" />
|
||||||
<PackageReference Include="Serilog" Version="4.2.0" />
|
<PackageReference Include="Serilog" Version="4.3.0" />
|
||||||
<PackageReference Include="Serilog.AspNetCore" Version="9.0.0" />
|
<PackageReference Include="Serilog.AspNetCore" Version="9.0.0" />
|
||||||
<PackageReference Include="Serilog.Formatting.Compact" Version="3.0.0" />
|
<PackageReference Include="Serilog.Formatting.Compact" Version="3.0.0" />
|
||||||
<PackageReference Include="Serilog.Sinks.Console" Version="6.0.0" />
|
<PackageReference Include="Serilog.Sinks.Console" Version="6.0.0" />
|
||||||
<PackageReference Include="Serilog.Sinks.Debug" Version="3.0.0" />
|
<PackageReference Include="Serilog.Sinks.Debug" Version="3.0.0" />
|
||||||
<PackageReference Include="Serilog.Sinks.File" Version="6.0.0" />
|
<PackageReference Include="Serilog.Sinks.File" Version="7.0.0" />
|
||||||
<PackageReference Include="Microsoft.Extensions.Caching.StackExchangeRedis" Version="9.0.1" />
|
<PackageReference Include="Microsoft.Extensions.Caching.StackExchangeRedis" Version="9.0.8" />
|
||||||
<PackageReference Include="Serilog.Sinks.Seq" Version="9.0.0" />
|
<PackageReference Include="Serilog.Sinks.OpenTelemetry" Version="4.2.0" />
|
||||||
<PackageReference Include="StackExchange.Redis" Version="2.8.24" />
|
<PackageReference Include="StackExchange.Redis" Version="2.8.58" />
|
||||||
<PackageReference Include="Swashbuckle.AspNetCore" Version="7.2.0" />
|
<PackageReference Include="Swashbuckle.AspNetCore" Version="9.0.3" />
|
||||||
<PackageReference Include="System.CodeDom" Version="[8.0.0, 9.0.0)" />
|
<PackageReference Include="Swashbuckle.AspNetCore.Swagger" Version="9.0.3" />
|
||||||
<PackageReference Include="System.Composition" Version="[8.0.0, 9.0.0)" />
|
<PackageReference Include="Swashbuckle.AspNetCore.SwaggerGen" Version="9.0.3" />
|
||||||
<PackageReference Include="System.Composition.AttributedModel" Version="9.0.1" />
|
<PackageReference Include="Swashbuckle.AspNetCore.SwaggerUI" Version="9.0.3" />
|
||||||
<PackageReference Include="System.Composition.Convention" Version="9.0.1" />
|
<PackageReference Include="System.Composition" Version="9.0.8" />
|
||||||
<PackageReference Include="System.Composition.Hosting" Version="9.0.1" />
|
<PackageReference Include="System.Composition.AttributedModel" Version="9.0.8" />
|
||||||
<PackageReference Include="System.Composition.Runtime" Version="9.0.1" />
|
<PackageReference Include="System.Composition.Convention" Version="9.0.8" />
|
||||||
<PackageReference Include="System.Composition.TypedParts" Version="9.0.1" />
|
<PackageReference Include="System.Composition.Hosting" Version="9.0.8" />
|
||||||
<PackageReference Include="System.Configuration.ConfigurationManager" Version="9.0.1" />
|
<PackageReference Include="System.Composition.Runtime" Version="9.0.8" />
|
||||||
<PackageReference Include="System.Drawing.Common" Version="9.0.1" />
|
<PackageReference Include="System.Composition.TypedParts" Version="9.0.8" />
|
||||||
<PackageReference Include="System.IdentityModel.Tokens.Jwt" Version="8.4.0" />
|
<PackageReference Include="System.Diagnostics.EventLog" Version="9.0.8" />
|
||||||
<PackageReference Include="System.Security.Cryptography.Pkcs" Version="9.0.1" />
|
<PackageReference Include="System.Formats.Asn1" Version="9.0.8" />
|
||||||
<PackageReference Include="System.ServiceProcess.ServiceController" Version="9.0.1" />
|
<PackageReference Include="System.IdentityModel.Tokens.Jwt" Version="8.13.0" />
|
||||||
<PackageReference Include="System.Text.Encoding.CodePages" Version="9.0.1" />
|
<PackageReference Include="System.Security.Cryptography.Pkcs" Version="9.0.8" />
|
||||||
<PackageReference Include="System.Threading.Channels" Version="[8.0.0, 9.0.0)" />
|
<PackageReference Include="System.Security.Cryptography.ProtectedData" Version="9.0.8" />
|
||||||
<PackageReference Include="Z.EntityFramework.Extensions.EFCore" Version="9.103.7" />
|
<PackageReference Include="System.Text.Json" Version="9.0.8" />
|
||||||
|
<PackageReference Include="Z.EntityFramework.Extensions.EFCore" Version="9.103.9.2" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
@@ -19,7 +19,12 @@ using Mirea.Api.Endpoint.Configuration.Model;
|
|||||||
using Mirea.Api.Endpoint.Configuration.Validation;
|
using Mirea.Api.Endpoint.Configuration.Validation;
|
||||||
using Mirea.Api.Endpoint.Configuration.Validation.Validators;
|
using Mirea.Api.Endpoint.Configuration.Validation.Validators;
|
||||||
using Mirea.Api.Security.Services;
|
using Mirea.Api.Security.Services;
|
||||||
|
using OfficeOpenXml;
|
||||||
|
using OpenTelemetry.Exporter;
|
||||||
|
using OpenTelemetry.Metrics;
|
||||||
|
using OpenTelemetry.Resources;
|
||||||
using System;
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
|
|
||||||
namespace Mirea.Api.Endpoint;
|
namespace Mirea.Api.Endpoint;
|
||||||
@@ -117,6 +122,34 @@ public class Program
|
|||||||
builder.Services.AddDataProtection()
|
builder.Services.AddDataProtection()
|
||||||
.PersistKeysToFileSystem(new DirectoryInfo(PathBuilder.Combine("DataProtection")));
|
.PersistKeysToFileSystem(new DirectoryInfo(PathBuilder.Combine("DataProtection")));
|
||||||
|
|
||||||
|
builder.Host.ConfigureServices((context, services) =>
|
||||||
|
{
|
||||||
|
var config = context.Configuration.Get<GeneralConfig>()?.LogSettings;
|
||||||
|
|
||||||
|
if (string.IsNullOrEmpty(config?.OpenTelemetryEndpoint)
|
||||||
|
|| string.IsNullOrEmpty(config.OpenTelemetryServiceName))
|
||||||
|
return;
|
||||||
|
|
||||||
|
services.AddOpenTelemetry()
|
||||||
|
.WithMetrics(metrics =>
|
||||||
|
{
|
||||||
|
metrics
|
||||||
|
.AddAspNetCoreInstrumentation()
|
||||||
|
.AddRuntimeInstrumentation()
|
||||||
|
.SetResourceBuilder(ResourceBuilder.CreateDefault()
|
||||||
|
.AddService(serviceName: config.OpenTelemetryServiceName)
|
||||||
|
.AddAttributes([
|
||||||
|
new KeyValuePair<string, object>("deployment.environment", context.HostingEnvironment.EnvironmentName),
|
||||||
|
new KeyValuePair<string, object>("host.name", Environment.MachineName)
|
||||||
|
]))
|
||||||
|
.AddOtlpExporter(options =>
|
||||||
|
{
|
||||||
|
options.Endpoint = new Uri(config.OpenTelemetryEndpoint);
|
||||||
|
options.Protocol = OtlpExportProtocol.Grpc;
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
var app = builder.Build();
|
var app = builder.Build();
|
||||||
|
|
||||||
app.UseForwardedHeaders();
|
app.UseForwardedHeaders();
|
||||||
@@ -158,6 +191,8 @@ public class Program
|
|||||||
|
|
||||||
app.MapControllers();
|
app.MapControllers();
|
||||||
|
|
||||||
|
ExcelPackage.License.SetNonCommercialOrganization("Winsomnia");
|
||||||
|
|
||||||
app.Run();
|
app.Run();
|
||||||
}
|
}
|
||||||
}
|
}
|
@@ -86,12 +86,11 @@ To set up the `redirect URL` when registering and logging in using OAuth 2, use
|
|||||||
|
|
||||||
**Where:**
|
**Where:**
|
||||||
|
|
||||||
- `{schema}` is the protocol you are using (`http` or `https').
|
- `{schema}` is the protocol you are using (`http` or `https`).
|
||||||
- `{domain}` is your domain (for example, `mydomain.com` or IP address).
|
- `{domain}` is your domain (for example, `mydomain.com` or IP address).
|
||||||
- `{portString}` is a port string that is only needed if your application is running on a non—standard port (for
|
- `{portString}` is a port string that is only needed if your application is running on a non-standard port (for
|
||||||
example, `:8080`). If you use standard ports (`80` for `http` and `443` for `https`), this parameter can be omitted.
|
example, `:8080`). If you use standard ports (`80` for `http` and `443` for `https`), this parameter can be omitted.
|
||||||
- `{ACTUAL_SUB_PATH}` is the path to your API that you specify in the settings. If it ends with `/api', then don't add `
|
- `{ACTUAL_SUB_PATH}` is the path to your API that you specify in the settings. If it ends with `/api`, then don't add `/api` at the end of the URL.
|
||||||
/api` at the end of the URL.
|
|
||||||
|
|
||||||
**Examples:**
|
**Examples:**
|
||||||
|
|
||||||
|
@@ -1,13 +1,6 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk.Web">
|
<Project Sdk="Microsoft.NET.Sdk.Web">
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>net8.0</TargetFramework>
|
|
||||||
<ImplicitUsings>disable</ImplicitUsings>
|
|
||||||
<Nullable>enable</Nullable>
|
|
||||||
<Company>Winsomnia</Company>
|
|
||||||
<Version>1.0.0</Version>
|
|
||||||
<AssemblyVersion>1.0.3.0</AssemblyVersion>
|
|
||||||
<FileVersion>1.0.3.0</FileVersion>
|
|
||||||
<AssemblyName>Mirea.Api.Security</AssemblyName>
|
<AssemblyName>Mirea.Api.Security</AssemblyName>
|
||||||
<RootNamespace>$(AssemblyName)</RootNamespace>
|
<RootNamespace>$(AssemblyName)</RootNamespace>
|
||||||
<OutputType>Library</OutputType>
|
<OutputType>Library</OutputType>
|
||||||
@@ -15,10 +8,9 @@
|
|||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Konscious.Security.Cryptography.Argon2" Version="1.3.1" />
|
<PackageReference Include="Konscious.Security.Cryptography.Argon2" Version="1.3.1" />
|
||||||
<PackageReference Include="Microsoft.Extensions.Configuration.Abstractions" Version="9.0.1" />
|
<PackageReference Include="Microsoft.Extensions.Configuration.Abstractions" Version="9.0.8" />
|
||||||
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="9.0.1" />
|
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="9.0.8" />
|
||||||
<PackageReference Include="Otp.NET" Version="1.4.0" />
|
<PackageReference Include="Otp.NET" Version="1.4.0" />
|
||||||
<PackageReference Include="System.Memory" Version="4.6.0" />
|
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
|
@@ -1,22 +1,18 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk">
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>net8.0</TargetFramework>
|
|
||||||
<ImplicitUsings>disable</ImplicitUsings>
|
|
||||||
<Nullable>enable</Nullable>
|
|
||||||
<Company>Winsomnia</Company>
|
|
||||||
<Version>1.0.0</Version>
|
|
||||||
<AssemblyVersion>1.0.3.0</AssemblyVersion>
|
|
||||||
<FileVersion>1.0.3.0</FileVersion>
|
|
||||||
<AssemblyName>Mirea.Api.DataAccess.Application</AssemblyName>
|
<AssemblyName>Mirea.Api.DataAccess.Application</AssemblyName>
|
||||||
<RootNamespace>$(AssemblyName)</RootNamespace>
|
<RootNamespace>$(AssemblyName)</RootNamespace>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="FluentValidation" Version="11.11.0" />
|
<PackageReference Include="FluentValidation" Version="12.0.0" />
|
||||||
<PackageReference Include="FluentValidation.DependencyInjectionExtensions" Version="11.11.0" />
|
<PackageReference Include="FluentValidation.DependencyInjectionExtensions" Version="12.0.0" />
|
||||||
<PackageReference Include="MediatR" Version="12.4.1" />
|
<PackageReference Include="MediatR" Version="13.0.0" />
|
||||||
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="9.0.1" />
|
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="9.0.8" />
|
||||||
|
<PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="9.0.8" />
|
||||||
|
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="9.0.8" />
|
||||||
|
<PackageReference Include="Microsoft.Extensions.Logging" Version="9.0.8" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
@@ -1,13 +1,6 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk">
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>net8.0</TargetFramework>
|
|
||||||
<ImplicitUsings>disable</ImplicitUsings>
|
|
||||||
<Nullable>enable</Nullable>
|
|
||||||
<Company>Winsomnia</Company>
|
|
||||||
<Version>1.0.0</Version>
|
|
||||||
<AssemblyVersion>1.0.3.0</AssemblyVersion>
|
|
||||||
<FileVersion>1.0.3.0</FileVersion>
|
|
||||||
<AssemblyName>Mirea.Api.DataAccess.Domain</AssemblyName>
|
<AssemblyName>Mirea.Api.DataAccess.Domain</AssemblyName>
|
||||||
<RootNamespace>$(AssemblyName)</RootNamespace>
|
<RootNamespace>$(AssemblyName)</RootNamespace>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
@@ -1,7 +1,6 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk">
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>net8.0</TargetFramework>
|
|
||||||
<BaseOutputPath>..\..\Persistence\bin\</BaseOutputPath>
|
<BaseOutputPath>..\..\Persistence\bin\</BaseOutputPath>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
|
@@ -1,7 +1,6 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk">
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>net8.0</TargetFramework>
|
|
||||||
<BaseOutputPath>..\..\Persistence\bin\</BaseOutputPath>
|
<BaseOutputPath>..\..\Persistence\bin\</BaseOutputPath>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
|
@@ -1,7 +1,6 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk">
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>net8.0</TargetFramework>
|
|
||||||
<BaseOutputPath>..\..\Persistence\bin\</BaseOutputPath>
|
<BaseOutputPath>..\..\Persistence\bin\</BaseOutputPath>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
|
@@ -1,13 +1,6 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk">
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>net8.0</TargetFramework>
|
|
||||||
<ImplicitUsings>disable</ImplicitUsings>
|
|
||||||
<Nullable>enable</Nullable>
|
|
||||||
<Company>Winsomnia</Company>
|
|
||||||
<Version>1.0.0</Version>
|
|
||||||
<AssemblyVersion>1.0.3.0</AssemblyVersion>
|
|
||||||
<FileVersion>1.0.3.0</FileVersion>
|
|
||||||
<AssemblyName>Mirea.Api.DataAccess.Persistence</AssemblyName>
|
<AssemblyName>Mirea.Api.DataAccess.Persistence</AssemblyName>
|
||||||
<RootNamespace>$(AssemblyName)</RootNamespace>
|
<RootNamespace>$(AssemblyName)</RootNamespace>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
@@ -16,14 +9,9 @@
|
|||||||
<PackageReference Include="AspNetCore.HealthChecks.MySql" Version="9.0.0" />
|
<PackageReference Include="AspNetCore.HealthChecks.MySql" Version="9.0.0" />
|
||||||
<PackageReference Include="AspNetCore.HealthChecks.NpgSql" Version="9.0.0" />
|
<PackageReference Include="AspNetCore.HealthChecks.NpgSql" Version="9.0.0" />
|
||||||
<PackageReference Include="AspNetCore.HealthChecks.Sqlite" Version="9.0.0" />
|
<PackageReference Include="AspNetCore.HealthChecks.Sqlite" Version="9.0.0" />
|
||||||
<PackageReference Include="Microsoft.Data.Sqlite" Version="9.0.1" />
|
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="9.0.8" />
|
||||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="9.0.1" />
|
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="9.0.4" />
|
||||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="9.0.1" />
|
<PackageReference Include="Pomelo.EntityFrameworkCore.MySql" Version="9.0.0-rc.1.efcore.9.0.0" />
|
||||||
<PackageReference Include="Microsoft.Extensions.Diagnostics.HealthChecks" Version="9.0.1" />
|
|
||||||
<PackageReference Include="MySqlConnector" Version="2.4.0" />
|
|
||||||
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="9.0.3" />
|
|
||||||
<PackageReference Include="Pomelo.EntityFrameworkCore.MySql" Version="9.0.0-preview.2.efcore.9.0.0" />
|
|
||||||
<PackageReference Include="SQLitePCLRaw.bundle_e_sqlite3" Version="2.1.10" />
|
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
Reference in New Issue
Block a user