fix(aihitLoader): Добавлены параметры понижения версии TLS
This commit is contained in:
@@ -27,12 +27,14 @@ FROM base AS final
|
|||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
COPY --from=publish /app/publish .
|
COPY --from=publish /app/publish .
|
||||||
|
|
||||||
# Понижаем уровень безопасности OpenSSL до уровня 1 и разрешаем TLSv1
|
# 1. Принудительно настраиваем OpenSSL 3 на игнорирование непредвиденных EOF (UnsafeLegacyRenegotiation и IgnoreUnexpectedEOF)
|
||||||
#RUN sed -i 's/CipherString = DEFAULT:@SECLEVEL=2/CipherString = DEFAULT:@SECLEVEL=1/g' /etc/ssl/openssl.cnf && \
|
RUN sed -i 's/providers = provider_sect/providers = provider_sect\nssl_conf = ssl_sect/' /etc/ssl/openssl.cnf \
|
||||||
# sed -i 's/MinProtocol = TLSv1.2/MinProtocol = TLSv1/g' /etc/ssl/openssl.cnf
|
&& printf "\n[ssl_sect]\nsystem_default = system_default_sect\n" >> /etc/ssl/openssl.cnf \
|
||||||
|
&& printf "\n[system_default_sect]\nOptions = UnsafeLegacyRenegotiation,IgnoreUnexpectedEOF\nMinProtocol = TLSv1\nCipherString = DEFAULT@SECLEVEL=0\n" >> /etc/ssl/openssl.cnf
|
||||||
|
|
||||||
|
# 2. Оставляем глобальные переменные совместимости для самого рантайма .NET 9
|
||||||
|
ENV DOTNET_AppContext_Switch_System_Net_Security_UseUnsafeOldTlsRuntimeBehavior=true
|
||||||
|
ENV DOTNET_AppContext_Switch_Microsoft_Data_SqlClient_UseOldTlsValue=true
|
||||||
ENV DOTNET_SYSTEM_NET_SECURITY_ALLOWUNSECUREDEFAULTS=true
|
ENV DOTNET_SYSTEM_NET_SECURITY_ALLOWUNSECUREDEFAULTS=true
|
||||||
ENV OPENSSL_SYSTEM_DEFAULT_MIN_PROTOCOL=TLSv1
|
|
||||||
ENV OPENSSL_SYSTEM_DEFAULT_CIPHER_STRING=DEFAULT@SECLEVEL=0
|
|
||||||
|
|
||||||
ENTRYPOINT ["dotnet", "PARR.AIHITLoaderWorker.dll"]
|
ENTRYPOINT ["dotnet", "PARR.AIHITLoaderWorker.dll"]
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"ConnectionStrings": {
|
"ConnectionStrings": {
|
||||||
"AihitConnection": "Data Source=10.248.19.97; Initial Catalog=mao2;User ID=awhit-ipp-parr;pwd=ET3h$9y1LH#D;Encrypt=Optional;TrustServerCertificate=true;"
|
"AihitConnection": "Data Source=10.248.19.97; Initial Catalog=mao2;User ID=awhit-ipp-parr;pwd=ET3h$9y1LH#D;Encrypt=Optional;TrustServerCertificate=true;MultiSubnetFailover=True;"
|
||||||
},
|
},
|
||||||
"Logging": {
|
"Logging": {
|
||||||
"LogLevel": {
|
"LogLevel": {
|
||||||
|
|||||||
@@ -31,7 +31,6 @@ RUN dotnet publish "./PARR.AIHITRelationshipsSyncerWorker.csproj" -c $BUILD_CONF
|
|||||||
FROM base AS final
|
FROM base AS final
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
COPY --from=publish /app/publish .
|
COPY --from=publish /app/publish .
|
||||||
|
|
||||||
|
|
||||||
# 1. <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> OpenSSL 3 <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> EOF (UnsafeLegacyRenegotiation <20> IgnoreUnexpectedEOF)
|
# 1. <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> OpenSSL 3 <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> EOF (UnsafeLegacyRenegotiation <20> IgnoreUnexpectedEOF)
|
||||||
RUN sed -i 's/providers = provider_sect/providers = provider_sect\nssl_conf = ssl_sect/' /etc/ssl/openssl.cnf \
|
RUN sed -i 's/providers = provider_sect/providers = provider_sect\nssl_conf = ssl_sect/' /etc/ssl/openssl.cnf \
|
||||||
|
|||||||
@@ -25,8 +25,4 @@
|
|||||||
<ProjectReference Include="..\PARR.TemplateDistributor\PARR.TemplateDistributor.csproj" />
|
<ProjectReference Include="..\PARR.TemplateDistributor\PARR.TemplateDistributor.csproj" />
|
||||||
<ProjectReference Include="..\PARR.TemplateMatcher\PARR.TemplateMatcher.csproj" />
|
<ProjectReference Include="..\PARR.TemplateMatcher\PARR.TemplateMatcher.csproj" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<Folder Include="log\" />
|
|
||||||
</ItemGroup>
|
|
||||||
</Project>
|
</Project>
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
using PARR.Core.Common.Interfaces;
|
using PARR.Core.Common.Interfaces;
|
||||||
using PARR.Core.Repositories.Interfaces.Job;
|
using PARR.Core.Repositories.Interfaces.Job;
|
||||||
using PARR.Core.Services.UnitFilterService;
|
|
||||||
using PARR.Domain.Cache;
|
using PARR.Domain.Cache;
|
||||||
using PARR.Domain.Entities.Base.History;
|
using PARR.Domain.Entities.Base.History;
|
||||||
using PARR.Domain.Enums;
|
using PARR.Domain.Enums;
|
||||||
@@ -9,7 +8,6 @@ using PARR.EsppApi;
|
|||||||
using PARR.EsppApi.Constants;
|
using PARR.EsppApi.Constants;
|
||||||
using PARR.EsppApi.Models.Query;
|
using PARR.EsppApi.Models.Query;
|
||||||
using PARR.TemplateMatcher;
|
using PARR.TemplateMatcher;
|
||||||
using PARR.TemplateMatcher.Services.GroupedSync;
|
|
||||||
using PARR.TemplateMatcher.Services.Implementations;
|
using PARR.TemplateMatcher.Services.Implementations;
|
||||||
using PARR.TemplateMatcher.Services.Interfaces;
|
using PARR.TemplateMatcher.Services.Interfaces;
|
||||||
using PARR.Test.NextRun;
|
using PARR.Test.NextRun;
|
||||||
@@ -47,7 +45,7 @@ namespace PARR.Test
|
|||||||
|
|
||||||
|
|
||||||
//await TemplateMatcherTest();
|
//await TemplateMatcherTest();
|
||||||
await PreCommitValidationTest();
|
await SimpleSyncTest();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -167,19 +165,14 @@ namespace PARR.Test
|
|||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
}
|
}
|
||||||
#region PreCommitValidation
|
#region SimpleSyncTest
|
||||||
|
|
||||||
private async Task PreCommitValidationTest()
|
private async Task SimpleSyncTest()
|
||||||
{
|
{
|
||||||
_logger.LogInformation("=== НАЧАЛО PRE-COMMIT ВАЛИДАЦИИ ===");
|
|
||||||
|
|
||||||
await using var scope = serviceProvider.CreateAsyncScope();
|
await using var scope = serviceProvider.CreateAsyncScope();
|
||||||
|
|
||||||
// === 1. Проверка Simple Pipeline ===
|
var synchronizers = scope.ServiceProvider.GetRequiredService<IEnumerable<ITemplateSynchronizer>>();
|
||||||
_logger.LogInformation("--- Simple Pipeline ---");
|
var simpleSync = synchronizers.FirstOrDefault(s => s is SimpleTemplateSynchronizer);
|
||||||
var simpleSync = scope.ServiceProvider
|
|
||||||
.GetRequiredService<IEnumerable<ITemplateSynchronizer>>()
|
|
||||||
.FirstOrDefault(s => s is SimpleTemplateSynchronizer);
|
|
||||||
|
|
||||||
if (simpleSync == null)
|
if (simpleSync == null)
|
||||||
{
|
{
|
||||||
@@ -187,68 +180,52 @@ namespace PARR.Test
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Подставьте реальный JobId для Simple
|
var jobIds = new List<Guid>
|
||||||
var simpleJobId = Guid.Parse("6ff1de05-80c3-4b38-846b-0c793fd7fc8c");
|
|
||||||
|
|
||||||
try
|
|
||||||
{
|
{
|
||||||
var sw = Stopwatch.StartNew();
|
//Guid.Parse("cfb0d2dd-192a-4ed5-a29c-25f0abf61895"),//11010
|
||||||
await simpleSync.SyncTemplatesForJobAsync(simpleJobId, new HistoryInitiator
|
//Guid.Parse("79976eaf-be7b-42a0-a4e3-a89d7f68a18e"),//17
|
||||||
{
|
Guid.Parse("6ff1de05-80c3-4b38-846b-0c793fd7fc8c")//318
|
||||||
InitiatorIp = "127.0.0.1",
|
};
|
||||||
InitiatorParrComponentId = ParrComponentsEnum.Master,
|
|
||||||
InitiatorComment = "Pre-commit validation: Simple Pipeline"
|
|
||||||
});
|
|
||||||
sw.Stop();
|
|
||||||
_logger.LogInformation("[OK] Simple Pipeline: завершено за {Ms} мс", sw.ElapsedMilliseconds);
|
|
||||||
}
|
|
||||||
catch (Exception ex)
|
|
||||||
{
|
|
||||||
_logger.LogError(ex, "[FAIL] Simple Pipeline: исключение");
|
|
||||||
}
|
|
||||||
|
|
||||||
// === 2. Проверка Grouped Pipeline ===
|
if (!jobIds.Any())
|
||||||
_logger.LogInformation("--- Grouped Pipeline ---");
|
|
||||||
var groupedSync = scope.ServiceProvider
|
|
||||||
.GetRequiredService<IEnumerable<ITemplateSynchronizer>>()
|
|
||||||
.FirstOrDefault(s => s is GroupedTemplateSynchronizer);
|
|
||||||
|
|
||||||
if (groupedSync == null)
|
|
||||||
{
|
{
|
||||||
_logger.LogError("[FAIL] GroupedTemplateSynchronizer не найден в DI");
|
_logger.LogWarning("Список JobId пуст. Подставьте ID в код метода SimpleSyncTest.");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Подставьте реальный JobGroupId для Grouped
|
_logger.LogInformation("=== Тестовая синхронизация SimpleTemplateSynchronizer ({Count} Job) ===", jobIds.Count);
|
||||||
var groupedJobGroupId = Guid.Parse("51acaa95-08bf-425f-9a09-87b6a4cbc77e");
|
|
||||||
|
|
||||||
try
|
int passed = 0;
|
||||||
|
int failed = 0;
|
||||||
|
|
||||||
|
foreach (var jobId in jobIds)
|
||||||
{
|
{
|
||||||
var sw = Stopwatch.StartNew();
|
try
|
||||||
await groupedSync.SyncTemplatesForJobGroupAsync(groupedJobGroupId, new HistoryInitiator
|
|
||||||
{
|
{
|
||||||
InitiatorIp = "127.0.0.1",
|
var sw = Stopwatch.StartNew();
|
||||||
InitiatorParrComponentId = ParrComponentsEnum.Master,
|
|
||||||
InitiatorComment = "Pre-commit validation: Grouped Pipeline"
|
await simpleSync.SyncTemplatesForJobAsync(jobId, new HistoryInitiator
|
||||||
});
|
{
|
||||||
sw.Stop();
|
InitiatorIp = "127.0.0.1",
|
||||||
_logger.LogInformation("[OK] Grouped Pipeline: завершено за {Ms} мс", sw.ElapsedMilliseconds);
|
InitiatorParrComponentId = ParrComponentsEnum.Master,
|
||||||
}
|
InitiatorComment = "Тестовая синхронизация SimpleTemplateSynchronizer"
|
||||||
catch (Exception ex)
|
});
|
||||||
{
|
|
||||||
_logger.LogError(ex, "[FAIL] Grouped Pipeline: исключение");
|
sw.Stop();
|
||||||
|
passed++;
|
||||||
|
|
||||||
|
_logger.LogInformation("[OK] Job {JobId}: синхронизация завершена за {ElapsedMs} мс",
|
||||||
|
jobId, sw.ElapsedMilliseconds);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
failed++;
|
||||||
|
_logger.LogError(ex, "[FAIL] Job {JobId}: исключение при синхронизации", jobId);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// === 3. Проверка контрактных констант ===
|
_logger.LogInformation("=== Итого: {Passed} OK, {Failed} FAIL из {Total} ===",
|
||||||
_logger.LogInformation("--- Контрактные константы ---");
|
passed, failed, jobIds.Count);
|
||||||
var constantsType = typeof(PARR.TemplateMatcher.Constants.UnusedTemplateConstants);
|
|
||||||
var fields = constantsType.GetFields(System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.Static);
|
|
||||||
|
|
||||||
foreach (var field in fields)
|
|
||||||
{
|
|
||||||
var value = field.GetValue(null);
|
|
||||||
_logger.LogInformation("[OK] Константа {Name} = '{Value}'", field.Name, value);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|||||||
@@ -7,9 +7,13 @@
|
|||||||
"Default": "Debug",
|
"Default": "Debug",
|
||||||
"Override": {
|
"Override": {
|
||||||
"Microsoft": "Warning",
|
"Microsoft": "Warning",
|
||||||
|
"Microsoft.Hosting.Lifetime": "Debug",
|
||||||
|
"PARR.TemplateMatcher": "Debug",
|
||||||
"PARR.DAL": "Information",
|
"PARR.DAL": "Information",
|
||||||
"PARR.Infrastructure.Redis": "Information",
|
"PARR.Core": "Debug",
|
||||||
"PARR.TemplateMatcher.Services.GroupedSync.GroupedTemplateProcessor": "Information"
|
"PARR.Infrastructure": "Debug",
|
||||||
|
"PARR.TemplateMatcher.Services.Implementations.SimpleTemplateSynchronizer": "Debug",
|
||||||
|
"PARR.TemplateMatcher.Services.Implementations.GroupedTemplateSynchronizer": "Debug"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"WriteTo": [
|
"WriteTo": [
|
||||||
|
|||||||
Reference in New Issue
Block a user