Fixes for the build server

This commit is contained in:
Timothy Baldridge 2020-02-24 06:04:54 -07:00
parent 7d1812a955
commit 45fabc41db
4 changed files with 37 additions and 6 deletions

View File

@ -1,9 +1,12 @@
### Changelog
#### Version - 0.9.21.0
#### Version - 0.9.22.0
* Server side fixes for CORS support and FTP uploads
#### Version - 0.9.21.0 - 2/23/2020
* Fix never ending hash issue
#### Version - 0.9.20.0
#### Version - 0.9.20.0 - 2/21/2020
* Don't reuse HTTP request objects (#532)
* Block popups in the in-app browser (#535)
* Don't print API keys in logs (#533)
@ -13,7 +16,7 @@
* Only retain the most recent 50 log files
#### Version - 0.9.19.0
#### Version - 0.9.19.0 - 2/14/2020
* Disable server-side indexing of all mods from the Nexus
* Accept download states from clients and index the mods we haven't seen
* Fixes for Skyrin VR USSEP patch

View File

@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Reflection;
using System.Text.Json;
@ -111,6 +112,27 @@ namespace Wabbajack.BuildServer
app.UseJobManager();
app.UseAuthentication();
app.UseAuthorization();
app.Use(next =>
{
return async context =>
{
var stopWatch = new Stopwatch();
stopWatch.Start();
context.Response.OnStarting(() =>
{
stopWatch.Stop();
var headers = context.Response.Headers;
headers.Add("Access-Control-Allow-Origin", "*");
headers.Add("Access-Control-Allow-Methods", "POST, GET");
headers.Add("Access-Control-Allow-Headers", "Accept, Origin, Content-type");
headers.Add("X-ResponseTime-Ms", stopWatch.ElapsedMilliseconds.ToString());
return Task.CompletedTask;
});
await next(context);
};
});
app.UseFileServer(new FileServerOptions
{
FileProvider = new PhysicalFileProvider(

View File

@ -7,8 +7,12 @@
<PublishReadyToRun>true</PublishReadyToRun>
<PublishSingleFile>true</PublishSingleFile>
<RuntimeIdentifier>win10-x64</RuntimeIdentifier>
<AssemblyName>Wabbajack</AssemblyName>
<RootNamespace>Wabbajack</RootNamespace>
<AssemblyVersion>0.9.21.0</AssemblyVersion>
<FileVersion>0.9.21.0</FileVersion>
<Copyright>Copyright © 2019-2020</Copyright>
<Description>Server component for Wabbajack</Description>
<AssemblyName>BuildServer</AssemblyName>
<RootNamespace>BuildServer</RootNamespace>
</PropertyGroup>
<ItemGroup>

View File

@ -98,7 +98,9 @@ namespace Wabbajack.Lib.LibCefHelpers
{
public static void Initialize()
{
Helpers.Init();
var es = Assembly.GetEntryAssembly();
if (es != null && es.Location != null && Path.GetFileNameWithoutExtension(es.Location) == "Wabbajack")
Helpers.Init();
}
}
}