Review
This commit is contained in:
parent
58020c81c9
commit
f61eba0fdd
1 changed files with 10 additions and 13 deletions
|
|
@ -60,11 +60,6 @@ builder.Services.Configure<SocketTransportOptions>(options =>
|
|||
|
||||
builder.WebHost.ConfigureKestrel((context, options) =>
|
||||
{
|
||||
if (context.Configuration.GetSection("PowerDns:Listener").Get<PowerDnsListenerOptions>() is { } pdnsOptions)
|
||||
{
|
||||
var path = PathEx.ExpandPath(pdnsOptions.Socket);
|
||||
FileInfo file = new(path);
|
||||
file.Directory!.Create();
|
||||
bool isSystemd = false;
|
||||
options.UseSystemd(options =>
|
||||
{
|
||||
|
|
@ -72,15 +67,17 @@ builder.WebHost.ConfigureKestrel((context, options) =>
|
|||
options.UseConnectionHandler<PowerDnsHandler>();
|
||||
});
|
||||
|
||||
if (!isSystemd)
|
||||
if (!isSystemd && context.Configuration.GetRequiredSection("PowerDns:Listener").Get<PowerDnsListenerOptions>() is { } pdnsOptions)
|
||||
{
|
||||
var path = PathEx.ExpandPath(pdnsOptions.Socket);
|
||||
FileInfo file = new(path);
|
||||
file.Directory!.Create();
|
||||
file.Delete();
|
||||
options.ListenUnixSocket(path, options =>
|
||||
{
|
||||
options.UseConnectionHandler<PowerDnsHandler>();
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
var app = builder.Build();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue