Skip to content

Commit c7b9955

Browse files
committed
pass no auth variable through on Windows
1 parent ad67c4d commit c7b9955

File tree

2 files changed

+15
-2
lines changed

2 files changed

+15
-2
lines changed

src/SeqCli/Forwarder/Util/CaptiveProcess.cs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414

1515
using System;
1616
using System.Diagnostics;
17+
using System.Collections.Generic;
1718
using System.Threading;
1819

1920
namespace SeqCli.Forwarder.Util;
@@ -25,7 +26,8 @@ public static int Run(
2526
string? args = null,
2627
Action<string>? writeStdout = null,
2728
Action<string>? writeStderr = null,
28-
string? workingDirectory = null)
29+
string? workingDirectory = null,
30+
Dictionary<string, string>? environment = null)
2931
{
3032
if (fullExePath == null) throw new ArgumentNullException(nameof(fullExePath));
3133

@@ -48,6 +50,14 @@ public static int Run(
4850
if (!string.IsNullOrEmpty(workingDirectory))
4951
startInfo.WorkingDirectory = workingDirectory;
5052

53+
if (environment != null)
54+
{
55+
foreach (var (k, v) in environment)
56+
{
57+
startInfo.EnvironmentVariables.Add(k, v);
58+
}
59+
}
60+
5161
using var process = Process.Start(startInfo)!;
5262
using var outputComplete = new ManualResetEvent(false);
5363
using var errorComplete = new ManualResetEvent(false);

test/SeqCli.EndToEnd/Support/TestConfiguration.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,9 @@ public CaptiveProcess SpawnServerProcess(string storagePath)
5353
return new CaptiveProcess(containerRuntime, $"run --name {containerName} -d -e ACCEPT_EULA=Y -e SEQ_FIRSTRUN_NOAUTHENTICATION=True -p {_serverListenPort}:80 datalust/seq:{imageTag}", stopCommandFullExePath: containerRuntime, stopCommandArgs: $"rm -f {containerName}");
5454
}
5555

56-
return new CaptiveProcess("seq", commandWithArgs);
56+
return new CaptiveProcess("seq", commandWithArgs, environment: new Dictionary<string, string>
57+
{
58+
{ "SEQ_FIRSTRUN_NOAUTHENTICATION", "True" }
59+
});
5760
}
5861
}

0 commit comments

Comments
 (0)