Skip to content

Commit

Permalink
fix doctor command
Browse files Browse the repository at this point in the history
  • Loading branch information
volllly committed Jan 23, 2024
1 parent 85721d9 commit 2ef8441
Showing 1 changed file with 26 additions and 2 deletions.
28 changes: 26 additions & 2 deletions src/fiskaltrust.Launcher/Commands/DoctorCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
using fiskaltrust.ifPOS.v1.de;
using fiskaltrust.ifPOS.v1;
using Microsoft.AspNetCore.Server.Kestrel.Core;
using fiskaltrust.Launcher.Factories;

namespace fiskaltrust.Launcher.Commands
{
Expand Down Expand Up @@ -156,7 +157,26 @@ public static async Task<int> HandleAsync(CommonOptions commonOptions, CommonPro

checkUp.Check("Setup monarch ProcessHostService", () =>
{
monarchBuilder.WebHost.ConfigureBinding(new Uri($"http://[::1]:{launcherConfiguration.LauncherServiceUri}"), protocols: HttpProtocols.Http2);
if (OperatingSystem.IsWindows())
{
monarchBuilder.WebHost.UseKestrel(serverOptions =>
{
serverOptions.ListenNamedPipe(commonProperties.LauncherConfiguration.LauncherServiceUri!, listenOptions =>
{
listenOptions.Protocols = HttpProtocols.Http2;
});
});
}
else
{
monarchBuilder.WebHost.UseKestrel(serverOptions =>
{
serverOptions.ListenUnixSocket(commonProperties.LauncherConfiguration.LauncherServiceUri!, listenOptions =>
{
listenOptions.Protocols = HttpProtocols.Http2;
});
});
}

monarchBuilder.Services.AddCodeFirstGrpc();
}, throws: true);
Expand Down Expand Up @@ -185,7 +205,11 @@ public static async Task<int> HandleAsync(CommonOptions commonOptions, CommonPro
Version = "1.0.0"
};

IProcessHostService? processHostService = checkUp.Check("Start plebeian processhostservice client", () => GrpcChannel.ForAddress($"http://localhost:{launcherConfiguration.LauncherServiceUri}").CreateGrpcService<IProcessHostService>());
IProcessHostService? processHostService = checkUp.Check("Start plebeian processhostservice client", () =>
{
var handler = new SocketsHttpHandler { ConnectCallback = new IpcConnectionFactory(launcherConfiguration).ConnectAsync };
return GrpcChannel.ForAddress("http://localhost", new GrpcChannelOptions { HttpHandler = handler }).CreateGrpcService<IProcessHostService>();
});

var plebeianBuilder = Host.CreateDefaultBuilder()
.UseSerilog(new LoggerConfiguration().CreateLogger())
Expand Down

0 comments on commit 2ef8441

Please sign in to comment.