Some checks failed
LANCommander Release / prep (push) Failing after 19s
LANCommander Release / build_server_linux_arm64 (push) Has been skipped
LANCommander Release / build_server_linux_x64 (push) Has been skipped
LANCommander Release / build_server_osx_arm64 (push) Has been skipped
LANCommander Release / build_server_osx_x64 (push) Has been skipped
LANCommander Release / build_server_win_arm64 (push) Has been skipped
LANCommander Release / build_server_win_x64 (push) Has been skipped
LANCommander Release / build_launcher_linux_arm64 (push) Has been skipped
LANCommander Release / build_launcher_linux_x64 (push) Has been skipped
LANCommander Release / build_launcher_osx_arm64 (push) Has been skipped
LANCommander Release / build_launcher_osx_x64 (push) Has been skipped
LANCommander Release / build_launcher_win_arm64 (push) Has been skipped
LANCommander Release / build_launcher_win_x64 (push) Has been skipped
LANCommander Release / build_release (push) Has been skipped
42 lines
No EOL
1.5 KiB
C#
42 lines
No EOL
1.5 KiB
C#
using System.Net;
|
|
using LANCommander.Server.Services.Models;
|
|
using Microsoft.AspNetCore.Http.Features;
|
|
|
|
namespace LANCommander.Server.Startup;
|
|
|
|
public static class Kestrel
|
|
{
|
|
public static WebApplicationBuilder ConfigureKestrel(this WebApplicationBuilder builder)
|
|
{
|
|
var settings = builder.Configuration.Get<Settings.Settings>();
|
|
|
|
if (settings?.Server.Http.UseSSL ?? false)
|
|
builder.WebHost.UseUrls($"http://*:{settings.Server.Http.Port}", $"https://*:{settings.Server.Http.SSLPort}");
|
|
else
|
|
builder.WebHost.UseUrls($"http://*:{settings.Server.Http.Port}");
|
|
|
|
builder.WebHost.ConfigureKestrel(options =>
|
|
{
|
|
options.Limits.MaxRequestBodySize = long.MaxValue;
|
|
options.Limits.MaxResponseBufferSize = null; // Unlimited; avoids throttling large file downloads (e.g. game archives)
|
|
options.Limits.RequestHeadersTimeout = TimeSpan.FromMinutes(5);
|
|
|
|
if (settings.Server.Http.UseSSL)
|
|
{
|
|
options.Listen(IPAddress.Any, settings.Server.Http.SSLPort, listenOptions =>
|
|
{
|
|
listenOptions.UseHttps(settings.Server.Http.CertificatePath, settings.Server.Http.CertificatePassword);
|
|
});
|
|
}
|
|
});
|
|
|
|
builder.Services.Configure<FormOptions>(options =>
|
|
{
|
|
options.MultipartBodyLengthLimit = long.MaxValue;
|
|
});
|
|
|
|
builder.WebHost.UseStaticWebAssets();
|
|
|
|
return builder;
|
|
}
|
|
} |