mirror of
https://github.com/wabbajack-tools/wabbajack.git
synced 2024-08-30 18:42:17 +00:00
commit
ba2d1878b9
@ -1,5 +1,10 @@
|
||||
### Changelog
|
||||
|
||||
#### Version - 2.3.0.0 - ???
|
||||
* Rewrote the file extraction routines. New code uses less memory, less disk space, and performs less thrashing on HDDs
|
||||
* Reworked IPS4 integration to reduce download failures
|
||||
|
||||
|
||||
#### Version - 2.2.2.0 - 8/31/2020
|
||||
* Route CDN requests through a reverse proxy to improve reliability
|
||||
|
||||
|
@ -86,7 +86,7 @@ namespace Compression.BSA
|
||||
|
||||
if (BSA.HeaderType == VersionType.SSE)
|
||||
{
|
||||
if (Compressed)
|
||||
if (Compressed && size.Size != size.OnDisk)
|
||||
{
|
||||
using var r = LZ4Stream.Decode(rdr.BaseStream);
|
||||
await r.CopyToLimitAsync(output, size.Original).ConfigureAwait(false);
|
||||
|
@ -131,6 +131,8 @@ namespace Wabbajack.Common
|
||||
public static AbsolutePath SettingsFile => LocalAppDataPath.Combine("settings.json");
|
||||
public static RelativePath SettingsIni = (RelativePath)"settings.ini";
|
||||
public static byte SettingsVersion => 2;
|
||||
public static bool IsServer = false;
|
||||
|
||||
public static string CompressedBodyHeader = "x-compressed-body";
|
||||
|
||||
public static AbsolutePath CefCacheLocation = @"CEF".RelativeTo(LocalAppDataPath);
|
||||
|
@ -329,6 +329,7 @@ namespace Wabbajack.Common
|
||||
{
|
||||
await using var fs = await Create();
|
||||
await data.CopyToAsync(fs);
|
||||
await data.FlushAsync();
|
||||
if (disposeDataAfter) await data.DisposeAsync();
|
||||
}
|
||||
|
||||
|
@ -13,8 +13,9 @@ using System.Threading.Tasks;
|
||||
using Wabbajack.Common.Exceptions;
|
||||
using Wabbajack.Common.Serialization.Json;
|
||||
using Wabbajack.Lib.Downloaders;
|
||||
using Wabbajack.Lib.LibCefHelpers;
|
||||
|
||||
namespace Wabbajack.Lib
|
||||
namespace Wabbajack.Lib
|
||||
{
|
||||
public static class BuildServerStatus
|
||||
{
|
||||
@ -254,5 +255,12 @@ namespace Wabbajack.Lib
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public static async Task<Helpers.Cookie[]> GetAuthInfo<T>(string key)
|
||||
{
|
||||
var client = await GetClient();
|
||||
return await client.GetJsonAsync<Helpers.Cookie[]>(
|
||||
$"{Consts.WabbajackBuildServerUri}site-integration/auth-info/{key}");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -86,18 +86,24 @@ namespace Wabbajack.Lib.Downloaders
|
||||
return cookies;
|
||||
}
|
||||
|
||||
public async Task<Wabbajack.Lib.Http.Client> GetAuthedClient()
|
||||
public async Task<Http.Client> GetAuthedClient()
|
||||
{
|
||||
Helpers.Cookie[] cookies;
|
||||
try
|
||||
if (Consts.IsServer)
|
||||
{
|
||||
cookies = await Utils.FromEncryptedJson<Helpers.Cookie[]>(_encryptedKeyName);
|
||||
if (cookies != null)
|
||||
return Helpers.GetClient(cookies, SiteURL.ToString());
|
||||
}
|
||||
catch (FileNotFoundException) { }
|
||||
try
|
||||
{
|
||||
cookies = await Utils.FromEncryptedJson<Helpers.Cookie[]>(_encryptedKeyName);
|
||||
if (cookies != null)
|
||||
return Helpers.GetClient(cookies, SiteURL.ToString());
|
||||
}
|
||||
catch (FileNotFoundException) { }
|
||||
|
||||
cookies = await Utils.Log(new RequestSiteLogin(this)).Task;
|
||||
cookies = await Utils.Log(new RequestSiteLogin(this)).Task;
|
||||
return Helpers.GetClient(cookies, SiteURL.ToString());
|
||||
}
|
||||
|
||||
cookies = await ClientAPI.GetAuthInfo<Helpers.Cookie[]>(_encryptedKeyName);
|
||||
return Helpers.GetClient(cookies, SiteURL.ToString());
|
||||
}
|
||||
|
||||
|
@ -56,8 +56,13 @@ namespace Wabbajack.Lib.Downloaders
|
||||
if (state != null)
|
||||
return state;
|
||||
}
|
||||
return null;
|
||||
|
||||
var meta = string.Join("\n", new string[]
|
||||
{
|
||||
"[General]",
|
||||
$"directURL={uri}"
|
||||
});
|
||||
return (AbstractDownloadState)(await ResolveArchive(meta.LoadIniString()));
|
||||
}
|
||||
|
||||
public static T GetInstance<T>() where T : IDownloader
|
||||
|
@ -17,7 +17,9 @@
|
||||
<Version>3.1.0</Version>
|
||||
</PackageReference>
|
||||
<PackageReference Include="Fody">
|
||||
<Version>6.2.4</Version>
|
||||
<Version>6.2.5</Version>
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="Genbox.AlphaFS">
|
||||
<Version>2.2.2.1</Version>
|
||||
|
38
Wabbajack.Server/Controllers/SiteIntegration.cs
Normal file
38
Wabbajack.Server/Controllers/SiteIntegration.cs
Normal file
@ -0,0 +1,38 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Wabbajack.Common;
|
||||
using Wabbajack.Lib.Downloaders;
|
||||
|
||||
namespace Wabbajack.BuildServer.Controllers
|
||||
{
|
||||
[ApiController]
|
||||
[Authorize(Roles = "User")]
|
||||
[Route("/site-integration")]
|
||||
public class SiteIntegration : ControllerBase
|
||||
{
|
||||
private ILogger<SiteIntegration> _logger;
|
||||
|
||||
public SiteIntegration(ILogger<SiteIntegration> logger)
|
||||
{
|
||||
_logger = logger;
|
||||
}
|
||||
|
||||
private HashSet<string> Allowed = new HashSet<string>
|
||||
{ "loverslabcookies", "deadlystream", "tesall", "tesalliance", "vectorplexus"};
|
||||
[Route("auth-info/{site}")]
|
||||
public async Task<IActionResult> GetAuthInfo(string site)
|
||||
{
|
||||
if (!Allowed.Contains(site))
|
||||
{
|
||||
return BadRequest("No key found");
|
||||
}
|
||||
|
||||
return Ok(Encoding.UTF8.GetString(await Utils.FromEncryptedData(site)));
|
||||
}
|
||||
}
|
||||
}
|
@ -4,6 +4,7 @@ using System.Net;
|
||||
using System.Security.Cryptography.X509Certificates;
|
||||
using Microsoft.AspNetCore.Hosting;
|
||||
using Microsoft.Extensions.Hosting;
|
||||
using Wabbajack.Common;
|
||||
|
||||
namespace Wabbajack.Server
|
||||
{
|
||||
@ -11,6 +12,7 @@ namespace Wabbajack.Server
|
||||
{
|
||||
public static void Main(string[] args)
|
||||
{
|
||||
Consts.IsServer = true;
|
||||
bool testMode = args.Contains("TESTMODE");
|
||||
CreateHostBuilder(args, testMode).Build().Run();
|
||||
}
|
||||
|
@ -18,7 +18,7 @@
|
||||
<PackageReference Include="Dapper" Version="2.0.35" />
|
||||
<PackageReference Include="FluentFTP" Version="32.4.4" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Authentication.Core" Version="2.2.0" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="3.1.7" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="3.1.8" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.StaticFiles" Version="2.2.0" />
|
||||
<PackageReference Include="Nettle" Version="1.3.0" />
|
||||
<PackageReference Include="Swashbuckle.AspNetCore" Version="5.5.1" />
|
||||
|
@ -56,9 +56,9 @@
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="CefSharp.Wpf" Version="84.4.10" />
|
||||
<PackageReference Include="DynamicData" Version="6.16.8" />
|
||||
<PackageReference Include="DynamicData" Version="6.16.9" />
|
||||
<PackageReference Include="Extended.Wpf.Toolkit" Version="4.0.1" />
|
||||
<PackageReference Include="Fody" Version="6.2.4">
|
||||
<PackageReference Include="Fody" Version="6.2.5">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
</PackageReference>
|
||||
|
Loading…
Reference in New Issue
Block a user