2020-01-09 00:04:57 +00:00
|
|
|
using System;
|
|
|
|
using System.Collections.Generic;
|
|
|
|
using System.Linq;
|
2020-01-18 22:09:32 +00:00
|
|
|
using System.Net;
|
|
|
|
using System.Security.Cryptography.X509Certificates;
|
2020-01-09 00:04:57 +00:00
|
|
|
using System.Threading.Tasks;
|
|
|
|
using Microsoft.AspNetCore.Hosting;
|
|
|
|
using Microsoft.Extensions.Configuration;
|
|
|
|
using Microsoft.Extensions.Hosting;
|
|
|
|
using Microsoft.Extensions.Logging;
|
|
|
|
|
|
|
|
namespace Wabbajack.BuildServer
|
|
|
|
{
|
|
|
|
public class Program
|
|
|
|
{
|
|
|
|
public static void Main(string[] args)
|
|
|
|
{
|
|
|
|
CreateHostBuilder(args).Build().Run();
|
|
|
|
}
|
2020-01-10 02:06:11 +00:00
|
|
|
|
2020-01-09 00:04:57 +00:00
|
|
|
public static IHostBuilder CreateHostBuilder(string[] args) =>
|
|
|
|
Host.CreateDefaultBuilder(args)
|
|
|
|
.ConfigureWebHostDefaults(webBuilder =>
|
|
|
|
{
|
2020-01-16 05:06:25 +00:00
|
|
|
webBuilder.UseStartup<Startup>()
|
|
|
|
.UseKestrel(options =>
|
|
|
|
{
|
2020-01-18 22:09:32 +00:00
|
|
|
options.Listen(IPAddress.Any, 80);
|
|
|
|
options.Listen(IPAddress.Any, 443, listenOptions =>
|
|
|
|
{
|
|
|
|
using (var store = new X509Store(StoreName.My))
|
|
|
|
{
|
|
|
|
store.Open(OpenFlags.ReadOnly);
|
|
|
|
var cert = store.Certificates.Find(X509FindType.FindBySubjectName, "build.wabbajack.org", true)[0];
|
|
|
|
listenOptions.UseHttps(cert);
|
|
|
|
|
|
|
|
}
|
|
|
|
});
|
2020-01-16 05:06:25 +00:00
|
|
|
options.Limits.MaxRequestBodySize = null;
|
|
|
|
});
|
2020-01-09 00:04:57 +00:00
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|