decryptedPassword
This commit is contained in:
parent
31b5a4925b
commit
e50a90f0fc
@ -1,4 +1,4 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk.Worker">
|
<Project Sdk="Microsoft.NET.Sdk.Worker">
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<ImplicitUsings>enable</ImplicitUsings>
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
<Nullable>enable</Nullable>
|
<Nullable>enable</Nullable>
|
||||||
@ -12,7 +12,7 @@
|
|||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="CliWrap" Version="3.8.2" />
|
<PackageReference Include="CliWrap" Version="3.8.2" />
|
||||||
<PackageReference Include="DiscUtils.Iso9660" Version="0.16.13" />
|
<PackageReference Include="DiscUtils.Iso9660" Version="0.16.13" />
|
||||||
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.Server" Version="8.0.14" />
|
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.Server" Version="8.0.15" />
|
||||||
<PackageReference Include="Microsoft.Extensions.Configuration.UserSecrets" Version="8.0.1" />
|
<PackageReference Include="Microsoft.Extensions.Configuration.UserSecrets" Version="8.0.1" />
|
||||||
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="8.0.1" />
|
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="8.0.1" />
|
||||||
<PackageReference Include="Microsoft.Extensions.Hosting.WindowsServices" Version="8.0.1" />
|
<PackageReference Include="Microsoft.Extensions.Hosting.WindowsServices" Version="8.0.1" />
|
||||||
@ -20,7 +20,7 @@
|
|||||||
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="8.0.1" />
|
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="8.0.1" />
|
||||||
<PackageReference Include="Microsoft.Extensions.Logging.EventLog" Version="8.0.1" />
|
<PackageReference Include="Microsoft.Extensions.Logging.EventLog" Version="8.0.1" />
|
||||||
<PackageReference Include="Oracle.ManagedDataAccess.Core" Version="23.7.0" />
|
<PackageReference Include="Oracle.ManagedDataAccess.Core" Version="23.7.0" />
|
||||||
<PackageReference Include="runtime.win-x64.Microsoft.DotNet.ILCompiler" Version="8.0.14" />
|
<PackageReference Include="runtime.win-x64.Microsoft.DotNet.ILCompiler" Version="8.0.15" />
|
||||||
<PackageReference Include="ShellProgressBar" Version="5.2.0" />
|
<PackageReference Include="ShellProgressBar" Version="5.2.0" />
|
||||||
<PackageReference Include="System.Data.SqlClient" Version="4.8.6" />
|
<PackageReference Include="System.Data.SqlClient" Version="4.8.6" />
|
||||||
<PackageReference Include="System.Drawing.Common" Version="8.0.14" />
|
<PackageReference Include="System.Drawing.Common" Version="8.0.14" />
|
||||||
|
@ -17,7 +17,7 @@ internal static partial class HelperInfinityQS
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void RunMI()
|
private static void RunMI(string decryptedPassword)
|
||||||
{
|
{
|
||||||
#pragma warning disable CA1416
|
#pragma warning disable CA1416
|
||||||
string processName = "iispcmi.exe";
|
string processName = "iispcmi.exe";
|
||||||
@ -27,7 +27,7 @@ internal static partial class HelperInfinityQS
|
|||||||
Domain = "Infineon",
|
Domain = "Infineon",
|
||||||
UseShellExecute = false,
|
UseShellExecute = false,
|
||||||
UserName = "ecfisysadmin",
|
UserName = "ecfisysadmin",
|
||||||
PasswordInClearText = "j(1(P%xB=g}3w9db",
|
PasswordInClearText = decryptedPassword,
|
||||||
WorkingDirectory = "C:/Program Files (x86)/InfinityQS International/ProFicient/Applications"
|
WorkingDirectory = "C:/Program Files (x86)/InfinityQS International/ProFicient/Applications"
|
||||||
};
|
};
|
||||||
TimeSpan timeSpan = new(DateTime.Now.AddDays(7).Ticks - DateTime.Now.Ticks);
|
TimeSpan timeSpan = new(DateTime.Now.AddDays(7).Ticks - DateTime.Now.Ticks);
|
||||||
@ -36,10 +36,11 @@ internal static partial class HelperInfinityQS
|
|||||||
#pragma warning restore CA1416
|
#pragma warning restore CA1416
|
||||||
}
|
}
|
||||||
|
|
||||||
internal static bool Select(AppSettings appSettings, ILogger<Worker> logger)
|
internal static bool ProcessStart(AppSettings appSettings, ILogger<Worker> logger)
|
||||||
{
|
{
|
||||||
logger.LogInformation(appSettings.FileWatcherConfiguration.Company);
|
logger.LogInformation(appSettings.FileWatcherConfiguration.Company);
|
||||||
RunMI();
|
string decrypted = RijndaelEncryption.Decrypt(appSettings.InfinityQSConfiguration.EncryptedPassword, appSettings.FileWatcherConfiguration.Company);
|
||||||
|
RunMI(decrypted);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -14,6 +14,7 @@ internal partial class TestCollectionSourceGenerationContext : JsonSerializerCon
|
|||||||
|
|
||||||
public record InfinityQSConfiguration(string ConnectionString,
|
public record InfinityQSConfiguration(string ConnectionString,
|
||||||
string DestinationDirectory,
|
string DestinationDirectory,
|
||||||
|
string EncryptedPassword,
|
||||||
long SubGroupTime,
|
long SubGroupTime,
|
||||||
string TestsFile,
|
string TestsFile,
|
||||||
Test[] Tests)
|
Test[] Tests)
|
||||||
|
20
Worker.cs
20
Worker.cs
@ -1,4 +1,4 @@
|
|||||||
using File_Watcher.Models;
|
using File_Watcher.Models;
|
||||||
using Microsoft.Extensions.Hosting.WindowsServices;
|
using Microsoft.Extensions.Hosting.WindowsServices;
|
||||||
using System.Data;
|
using System.Data;
|
||||||
|
|
||||||
@ -7,7 +7,7 @@ namespace File_Watcher;
|
|||||||
public partial class Worker : BackgroundService
|
public partial class Worker : BackgroundService
|
||||||
{
|
{
|
||||||
|
|
||||||
private bool? _First;
|
private int _First;
|
||||||
private readonly bool _IsWindowsService;
|
private readonly bool _IsWindowsService;
|
||||||
private readonly ILogger<Worker> _Logger;
|
private readonly ILogger<Worker> _Logger;
|
||||||
private readonly AppSettings _AppSettings;
|
private readonly AppSettings _AppSettings;
|
||||||
@ -22,7 +22,6 @@ public partial class Worker : BackgroundService
|
|||||||
try
|
try
|
||||||
{ logger.LogInformation("<{folder}>", Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData)); }
|
{ logger.LogInformation("<{folder}>", Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData)); }
|
||||||
catch (Exception) { }
|
catch (Exception) { }
|
||||||
_First = null;
|
|
||||||
_IsWindowsService = collection.Contains(nameof(WindowsServiceLifetime));
|
_IsWindowsService = collection.Contains(nameof(WindowsServiceLifetime));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -35,6 +34,7 @@ public partial class Worker : BackgroundService
|
|||||||
|
|
||||||
protected override async Task ExecuteAsync(CancellationToken cancellationToken) =>
|
protected override async Task ExecuteAsync(CancellationToken cancellationToken) =>
|
||||||
await Body(cancellationToken);
|
await Body(cancellationToken);
|
||||||
|
|
||||||
private async Task Body(CancellationToken cancellationToken)
|
private async Task Body(CancellationToken cancellationToken)
|
||||||
{
|
{
|
||||||
if (!_IsWindowsService)
|
if (!_IsWindowsService)
|
||||||
@ -52,17 +52,21 @@ public partial class Worker : BackgroundService
|
|||||||
}
|
}
|
||||||
while (_IsWindowsService && !cancellationToken.IsCancellationRequested)
|
while (_IsWindowsService && !cancellationToken.IsCancellationRequested)
|
||||||
{
|
{
|
||||||
BodyInner(cancellationToken);
|
try
|
||||||
await Task.Delay(_AppSettings.FileWatcherConfiguration.MillisecondsDelay, cancellationToken);
|
{
|
||||||
|
BodyInner(cancellationToken);
|
||||||
|
await Task.Delay(_AppSettings.FileWatcherConfiguration.MillisecondsDelay, cancellationToken);
|
||||||
|
}
|
||||||
|
catch (Exception ex) { _Logger.LogError(ex, "Unexpected Error!"); }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void BodyInner(CancellationToken cancellationToken)
|
private void BodyInner(CancellationToken cancellationToken)
|
||||||
{
|
{
|
||||||
_Logger.LogInformation("A) Next execute will be at {date}", DateTime.Now.AddMilliseconds(_AppSettings.FileWatcherConfiguration.MillisecondsDelay).ToString("yyyy-MM-dd hh:mm:ss.fff tt"));
|
_Logger.LogInformation("A) Next execute will be at {date}", DateTime.Now.AddMilliseconds(_AppSettings.FileWatcherConfiguration.MillisecondsDelay).ToString("yyyy-MM-dd hh:mm:ss.fff tt"));
|
||||||
if (_First is null || _First.Value)
|
if (_First < 9)
|
||||||
{
|
{
|
||||||
_First = false;
|
_First += 1;
|
||||||
if (_AppSettings.FileWatcherConfiguration.Helper == nameof(Helpers.HelperCamstarOracle))
|
if (_AppSettings.FileWatcherConfiguration.Helper == nameof(Helpers.HelperCamstarOracle))
|
||||||
Helpers.HelperCamstarOracle.Heartbeat(_AppSettings, _HttpClientFactory, _Logger, Infineon.Monitoring.MonA.State.Up, cancellationToken);
|
Helpers.HelperCamstarOracle.Heartbeat(_AppSettings, _HttpClientFactory, _Logger, Infineon.Monitoring.MonA.State.Up, cancellationToken);
|
||||||
}
|
}
|
||||||
@ -78,7 +82,7 @@ public partial class Worker : BackgroundService
|
|||||||
nameof(Helpers.HelperCompass) => Helpers.HelperCompass.CopyFile(_AppSettings, _Logger),
|
nameof(Helpers.HelperCompass) => Helpers.HelperCompass.CopyFile(_AppSettings, _Logger),
|
||||||
nameof(Helpers.HelperStratus) => Helpers.HelperStratus.MoveFile(_AppSettings, _Logger),
|
nameof(Helpers.HelperStratus) => Helpers.HelperStratus.MoveFile(_AppSettings, _Logger),
|
||||||
nameof(Helpers.HelperEAFLog) => Helpers.HelperEAFLog.DeleteFiles(_AppSettings, _Logger),
|
nameof(Helpers.HelperEAFLog) => Helpers.HelperEAFLog.DeleteFiles(_AppSettings, _Logger),
|
||||||
nameof(Helpers.HelperInfinityQS) => Helpers.HelperInfinityQS.Select(_AppSettings, _Logger),
|
nameof(Helpers.HelperInfinityQS) => Helpers.HelperInfinityQS.ProcessStart(_AppSettings, _Logger),
|
||||||
nameof(Helpers.HelperEventLog) => Helpers.HelperEventLog.ClearEventLogs(_AppSettings, _Logger),
|
nameof(Helpers.HelperEventLog) => Helpers.HelperEventLog.ClearEventLogs(_AppSettings, _Logger),
|
||||||
nameof(Helpers.HelperWaferCounter) => Helpers.HelperWaferCounter.MoveFile(_AppSettings, _Logger),
|
nameof(Helpers.HelperWaferCounter) => Helpers.HelperWaferCounter.MoveFile(_AppSettings, _Logger),
|
||||||
nameof(Helpers.HelperSerial) => Helpers.HelperSerial.ReadWrite(_AppSettings, _Logger, cancellationToken),
|
nameof(Helpers.HelperSerial) => Helpers.HelperSerial.ReadWrite(_AppSettings, _Logger, cancellationToken),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user