feat(historian-host): bind TCP host/port/tls config
This commit is contained in:
@@ -94,7 +94,10 @@ if (hasDriver)
|
||||
builder.Services.AddAlarmHistorian(
|
||||
builder.Configuration,
|
||||
(opts, sp) => new WonderwareHistorianClient(
|
||||
new WonderwareHistorianClientOptions(opts.PipeName, opts.SharedSecret),
|
||||
new WonderwareHistorianClientOptions(opts.PipeName, opts.SharedSecret)
|
||||
{
|
||||
Host = opts.Host, Port = opts.Port, UseTls = opts.UseTls, ServerCertThumbprint = opts.ServerCertThumbprint,
|
||||
},
|
||||
sp.GetService<ILogger<WonderwareHistorianClient>>()));
|
||||
|
||||
// Bind every cross-platform driver factory before AddAkka resolves IDriverFactory — replaces
|
||||
|
||||
@@ -15,6 +15,10 @@
|
||||
"Enabled": false,
|
||||
"DatabasePath": "alarm-historian.db",
|
||||
"PipeName": "OtOpcUaHistorian",
|
||||
"Host": "localhost",
|
||||
"Port": 32569,
|
||||
"UseTls": false,
|
||||
"ServerCertThumbprint": null,
|
||||
"SharedSecret": "",
|
||||
"DrainIntervalSeconds": 5,
|
||||
"Capacity": 1000000,
|
||||
|
||||
@@ -28,6 +28,18 @@ public sealed class AlarmHistorianOptions
|
||||
/// <summary>Named-pipe name the Wonderware historian sidecar listens on.</summary>
|
||||
public string PipeName { get; init; } = "OtOpcUaHistorian";
|
||||
|
||||
/// <summary>TCP hostname or IP address the Wonderware historian sidecar listens on.</summary>
|
||||
public string Host { get; init; } = "localhost";
|
||||
|
||||
/// <summary>TCP port the Wonderware historian sidecar listens on.</summary>
|
||||
public int Port { get; init; } = 32569;
|
||||
|
||||
/// <summary>When <c>true</c>, the client connects over TLS.</summary>
|
||||
public bool UseTls { get; init; }
|
||||
|
||||
/// <summary>Expected TLS server certificate thumbprint (hex, no spaces). Null or empty disables pinning.</summary>
|
||||
public string? ServerCertThumbprint { get; init; }
|
||||
|
||||
/// <summary>Per-process shared secret the sidecar verifies in the Hello frame.</summary>
|
||||
public string SharedSecret { get; init; } = "";
|
||||
|
||||
|
||||
Reference in New Issue
Block a user