From 90f9df643689e131900cf04d91e01b61e039c4d2 Mon Sep 17 00:00:00 2001 From: Timothy Baldridge Date: Fri, 20 Oct 2023 20:11:08 +0100 Subject: [PATCH 1/5] Update to .net 8 --- Wabbajack.App.Wpf/Wabbajack.App.Wpf.csproj | 4 ++-- Wabbajack.CLI.Builder/Wabbajack.CLI.Builder.csproj | 2 +- Wabbajack.CLI/Wabbajack.CLI.csproj | 2 +- Wabbajack.Common/Wabbajack.Common.csproj | 2 +- .../Wabbajack.Compiler.Test.csproj | 2 +- Wabbajack.Compiler/Wabbajack.Compiler.csproj | 2 +- .../Wabbajack.Compression.BSA.Test.csproj | 2 +- .../Wabbajack.Compression.BSA.csproj | 2 +- .../Wabbajack.Compression.Zip.Test.csproj | 2 +- .../Wabbajack.Compression.Zip.csproj | 2 +- .../Wabbajack.Configuration.csproj | 2 +- .../Wabbajack.DTOs.ConverterGenerators.csproj | 2 +- Wabbajack.DTOs.Test/Wabbajack.DTOs.Test.csproj | 2 +- Wabbajack.DTOs/Wabbajack.DTOs.csproj | 2 +- .../Wabbajack.Downloaders.Bethesda.csproj | 2 +- .../Wabbajack.Downloaders.Dispatcher.Test.csproj | 2 +- .../Wabbajack.Downloaders.Dispatcher.csproj | 2 +- .../Wabbajack.Downloaders.GameFile.csproj | 2 +- .../Wabbajack.Downloaders.GoogleDrive.csproj | 2 +- .../Wabbajack.Downloaders.Http.csproj | 2 +- ...Wabbajack.Downloaders.IPS4OAuth2Downloader.csproj | 2 +- .../Wabbajack.Downloaders.Interfaces.csproj | 2 +- .../Wabbajack.Downloaders.Manual.csproj | 2 +- .../Wabbajack.Downloaders.MediaFire.csproj | 2 +- .../Wabbajack.Downloaders.Mega.csproj | 2 +- .../Wabbajack.Downloaders.ModDB.csproj | 2 +- .../Wabbajack.Downloaders.Nexus.csproj | 2 +- .../Wabbajack.Downloaders.VerificationCache.csproj | 2 +- .../Wabbajack.Downloaders.WabbajackCDN.csproj | 2 +- .../Wabbajack.FileExtractor.Test.csproj | 2 +- .../Wabbajack.FileExtractor.csproj | 2 +- .../Wabbajack.Hashing.PHash.Test.csproj | 2 +- .../Wabbajack.Hashing.PHash.csproj | 2 +- .../Wabbajack.Hashing.xxHash64.Benchmark.csproj | 2 +- .../Wabbajack.Hashing.xxHash64.Test.csproj | 2 +- .../Wabbajack.Hashing.xxHash64.csproj | 2 +- Wabbajack.IO.Async/Wabbajack.IO.Async.csproj | 2 +- .../Wabbajack.Installer.Test.csproj | 2 +- Wabbajack.Installer/Wabbajack.Installer.csproj | 2 +- Wabbajack.Launcher/Wabbajack.Launcher.csproj | 2 +- .../Wabbajack.Networking.BethesdaNet.csproj | 2 +- .../Wabbajack.Networking.Discord.csproj | 2 +- .../Wabbajack.Networking.GitHub.csproj | 2 +- .../Wabbajack.Networking.Http.Interfaces.csproj | 2 +- .../Wabbajack.Networking.Http.Test.csproj | 2 +- .../Wabbajack.Networking.Http.csproj | 2 +- .../Wabbajack.Networking.NexusApi.Test.csproj | 2 +- .../Wabbajack.Networking.NexusApi.csproj | 2 +- .../Wabbajack.Networking.Steam.Test.csproj | 2 +- .../Wabbajack.Networking.Steam.csproj | 2 +- .../Wabbajack.Networking.WabbajackClientApi.csproj | 2 +- .../Wabbajack.Paths.IO.Test.csproj | 2 +- Wabbajack.Paths.IO/Wabbajack.Paths.IO.csproj | 2 +- Wabbajack.Paths.Test/Wabbajack.Paths.Test.csproj | 2 +- Wabbajack.Paths/Wabbajack.Paths.csproj | 2 +- .../Wabbajack.RateLimiter.Test.csproj | 2 +- Wabbajack.RateLimiter/Wabbajack.RateLimiter.csproj | 2 +- Wabbajack.Server.Lib/Wabbajack.Server.Lib.csproj | 2 +- Wabbajack.Server/Wabbajack.Server.csproj | 2 +- .../Wabbajack.Services.OSIntegrated.csproj | 2 +- .../Wabbajack.VFS.Interfaces.csproj | 2 +- Wabbajack.VFS.Test/Wabbajack.VFS.Test.csproj | 2 +- Wabbajack.VFS/Wabbajack.VFS.csproj | 2 +- buildall.bat | 12 ++++++------ 64 files changed, 70 insertions(+), 70 deletions(-) diff --git a/Wabbajack.App.Wpf/Wabbajack.App.Wpf.csproj b/Wabbajack.App.Wpf/Wabbajack.App.Wpf.csproj index af71c310..31ef5b3a 100644 --- a/Wabbajack.App.Wpf/Wabbajack.App.Wpf.csproj +++ b/Wabbajack.App.Wpf/Wabbajack.App.Wpf.csproj @@ -2,10 +2,10 @@ WinExe - net7.0-windows + net8.0-windows true x64 - win10-x64 + win-x64 $(VERSION) $(VERSION) $(VERSION) diff --git a/Wabbajack.CLI.Builder/Wabbajack.CLI.Builder.csproj b/Wabbajack.CLI.Builder/Wabbajack.CLI.Builder.csproj index 87e50f36..2e823132 100644 --- a/Wabbajack.CLI.Builder/Wabbajack.CLI.Builder.csproj +++ b/Wabbajack.CLI.Builder/Wabbajack.CLI.Builder.csproj @@ -1,7 +1,7 @@ - net7.0 + net8.0 enable enable diff --git a/Wabbajack.CLI/Wabbajack.CLI.csproj b/Wabbajack.CLI/Wabbajack.CLI.csproj index fe9ebfc9..27c0da7c 100644 --- a/Wabbajack.CLI/Wabbajack.CLI.csproj +++ b/Wabbajack.CLI/Wabbajack.CLI.csproj @@ -13,7 +13,7 @@ CS8600 CS8601 CS8618 - net7.0 + net8.0 diff --git a/Wabbajack.Common/Wabbajack.Common.csproj b/Wabbajack.Common/Wabbajack.Common.csproj index a382ae26..0f0a7737 100644 --- a/Wabbajack.Common/Wabbajack.Common.csproj +++ b/Wabbajack.Common/Wabbajack.Common.csproj @@ -1,7 +1,7 @@ - net7.0 + net8.0 enable GPL-3.0-or-later $(VERSION) diff --git a/Wabbajack.Compiler.Test/Wabbajack.Compiler.Test.csproj b/Wabbajack.Compiler.Test/Wabbajack.Compiler.Test.csproj index b9b77692..ac61b703 100644 --- a/Wabbajack.Compiler.Test/Wabbajack.Compiler.Test.csproj +++ b/Wabbajack.Compiler.Test/Wabbajack.Compiler.Test.csproj @@ -1,7 +1,7 @@ - net7.0 + net8.0 false diff --git a/Wabbajack.Compiler/Wabbajack.Compiler.csproj b/Wabbajack.Compiler/Wabbajack.Compiler.csproj index 9ca4cf58..09c34ed7 100644 --- a/Wabbajack.Compiler/Wabbajack.Compiler.csproj +++ b/Wabbajack.Compiler/Wabbajack.Compiler.csproj @@ -1,7 +1,7 @@ - net7.0 + net8.0 enable $(VERSION) GPL-3.0-or-later diff --git a/Wabbajack.Compression.BSA.Test/Wabbajack.Compression.BSA.Test.csproj b/Wabbajack.Compression.BSA.Test/Wabbajack.Compression.BSA.Test.csproj index 270a509f..7e05fc46 100644 --- a/Wabbajack.Compression.BSA.Test/Wabbajack.Compression.BSA.Test.csproj +++ b/Wabbajack.Compression.BSA.Test/Wabbajack.Compression.BSA.Test.csproj @@ -1,7 +1,7 @@ - net7.0 + net8.0 false diff --git a/Wabbajack.Compression.BSA/Wabbajack.Compression.BSA.csproj b/Wabbajack.Compression.BSA/Wabbajack.Compression.BSA.csproj index d9d11284..4e1d94e7 100644 --- a/Wabbajack.Compression.BSA/Wabbajack.Compression.BSA.csproj +++ b/Wabbajack.Compression.BSA/Wabbajack.Compression.BSA.csproj @@ -1,7 +1,7 @@ - net7.0 + net8.0 enable true GPL-3.0-or-later diff --git a/Wabbajack.Compression.Zip.Test/Wabbajack.Compression.Zip.Test.csproj b/Wabbajack.Compression.Zip.Test/Wabbajack.Compression.Zip.Test.csproj index 6d15e005..db8aa67d 100644 --- a/Wabbajack.Compression.Zip.Test/Wabbajack.Compression.Zip.Test.csproj +++ b/Wabbajack.Compression.Zip.Test/Wabbajack.Compression.Zip.Test.csproj @@ -1,7 +1,7 @@ - net7.0 + net8.0 enable false diff --git a/Wabbajack.Compression.Zip/Wabbajack.Compression.Zip.csproj b/Wabbajack.Compression.Zip/Wabbajack.Compression.Zip.csproj index 01178a67..5a6bf79a 100644 --- a/Wabbajack.Compression.Zip/Wabbajack.Compression.Zip.csproj +++ b/Wabbajack.Compression.Zip/Wabbajack.Compression.Zip.csproj @@ -1,7 +1,7 @@ - net7.0 + net8.0 enable enable diff --git a/Wabbajack.Configuration/Wabbajack.Configuration.csproj b/Wabbajack.Configuration/Wabbajack.Configuration.csproj index cfadb03d..30402ac0 100644 --- a/Wabbajack.Configuration/Wabbajack.Configuration.csproj +++ b/Wabbajack.Configuration/Wabbajack.Configuration.csproj @@ -1,7 +1,7 @@ - net7.0 + net8.0 enable enable diff --git a/Wabbajack.DTOs.ConverterGenerators/Wabbajack.DTOs.ConverterGenerators.csproj b/Wabbajack.DTOs.ConverterGenerators/Wabbajack.DTOs.ConverterGenerators.csproj index 3831f9b2..1e804782 100644 --- a/Wabbajack.DTOs.ConverterGenerators/Wabbajack.DTOs.ConverterGenerators.csproj +++ b/Wabbajack.DTOs.ConverterGenerators/Wabbajack.DTOs.ConverterGenerators.csproj @@ -2,7 +2,7 @@ Exe - net7.0 + net8.0 GPL-3.0-or-later $(VERSION) CS8600 diff --git a/Wabbajack.DTOs.Test/Wabbajack.DTOs.Test.csproj b/Wabbajack.DTOs.Test/Wabbajack.DTOs.Test.csproj index 6bc36413..b0eeac6f 100644 --- a/Wabbajack.DTOs.Test/Wabbajack.DTOs.Test.csproj +++ b/Wabbajack.DTOs.Test/Wabbajack.DTOs.Test.csproj @@ -1,7 +1,7 @@ - net7.0 + net8.0 false diff --git a/Wabbajack.DTOs/Wabbajack.DTOs.csproj b/Wabbajack.DTOs/Wabbajack.DTOs.csproj index 04b1cc65..ad79c9a1 100644 --- a/Wabbajack.DTOs/Wabbajack.DTOs.csproj +++ b/Wabbajack.DTOs/Wabbajack.DTOs.csproj @@ -1,7 +1,7 @@ - net7.0 + net8.0 enable $(VERSION) GPL-3.0-or-later diff --git a/Wabbajack.Downloaders.Bethesda/Wabbajack.Downloaders.Bethesda.csproj b/Wabbajack.Downloaders.Bethesda/Wabbajack.Downloaders.Bethesda.csproj index 02afa7a1..1030ef69 100644 --- a/Wabbajack.Downloaders.Bethesda/Wabbajack.Downloaders.Bethesda.csproj +++ b/Wabbajack.Downloaders.Bethesda/Wabbajack.Downloaders.Bethesda.csproj @@ -1,7 +1,7 @@ - net7.0 + net8.0 enable enable diff --git a/Wabbajack.Downloaders.Dispatcher.Test/Wabbajack.Downloaders.Dispatcher.Test.csproj b/Wabbajack.Downloaders.Dispatcher.Test/Wabbajack.Downloaders.Dispatcher.Test.csproj index 9070839d..85f9a56f 100644 --- a/Wabbajack.Downloaders.Dispatcher.Test/Wabbajack.Downloaders.Dispatcher.Test.csproj +++ b/Wabbajack.Downloaders.Dispatcher.Test/Wabbajack.Downloaders.Dispatcher.Test.csproj @@ -1,7 +1,7 @@ - net7.0 + net8.0 false diff --git a/Wabbajack.Downloaders.Dispatcher/Wabbajack.Downloaders.Dispatcher.csproj b/Wabbajack.Downloaders.Dispatcher/Wabbajack.Downloaders.Dispatcher.csproj index 7cebb553..5dc9ecb4 100644 --- a/Wabbajack.Downloaders.Dispatcher/Wabbajack.Downloaders.Dispatcher.csproj +++ b/Wabbajack.Downloaders.Dispatcher/Wabbajack.Downloaders.Dispatcher.csproj @@ -1,7 +1,7 @@ - net7.0 + net8.0 enable $(VERSION) GPL-3.0-or-later diff --git a/Wabbajack.Downloaders.GameFile/Wabbajack.Downloaders.GameFile.csproj b/Wabbajack.Downloaders.GameFile/Wabbajack.Downloaders.GameFile.csproj index 598216a2..8f005484 100644 --- a/Wabbajack.Downloaders.GameFile/Wabbajack.Downloaders.GameFile.csproj +++ b/Wabbajack.Downloaders.GameFile/Wabbajack.Downloaders.GameFile.csproj @@ -1,7 +1,7 @@ - net7.0 + net8.0 enable enable diff --git a/Wabbajack.Downloaders.GoogleDrive/Wabbajack.Downloaders.GoogleDrive.csproj b/Wabbajack.Downloaders.GoogleDrive/Wabbajack.Downloaders.GoogleDrive.csproj index a4637175..c22e139b 100644 --- a/Wabbajack.Downloaders.GoogleDrive/Wabbajack.Downloaders.GoogleDrive.csproj +++ b/Wabbajack.Downloaders.GoogleDrive/Wabbajack.Downloaders.GoogleDrive.csproj @@ -1,7 +1,7 @@ - net7.0 + net8.0 enable $(VERSION) GPL-3.0-or-later diff --git a/Wabbajack.Downloaders.Http/Wabbajack.Downloaders.Http.csproj b/Wabbajack.Downloaders.Http/Wabbajack.Downloaders.Http.csproj index e0fbecdb..00088175 100644 --- a/Wabbajack.Downloaders.Http/Wabbajack.Downloaders.Http.csproj +++ b/Wabbajack.Downloaders.Http/Wabbajack.Downloaders.Http.csproj @@ -1,7 +1,7 @@ - net7.0 + net8.0 enable $(VERSION) GPL-3.0-or-later diff --git a/Wabbajack.Downloaders.IPS4OAuth2Downloader/Wabbajack.Downloaders.IPS4OAuth2Downloader.csproj b/Wabbajack.Downloaders.IPS4OAuth2Downloader/Wabbajack.Downloaders.IPS4OAuth2Downloader.csproj index 6fdce2ea..90fc1e29 100644 --- a/Wabbajack.Downloaders.IPS4OAuth2Downloader/Wabbajack.Downloaders.IPS4OAuth2Downloader.csproj +++ b/Wabbajack.Downloaders.IPS4OAuth2Downloader/Wabbajack.Downloaders.IPS4OAuth2Downloader.csproj @@ -1,7 +1,7 @@ - net7.0 + net8.0 enable diff --git a/Wabbajack.Downloaders.Interfaces/Wabbajack.Downloaders.Interfaces.csproj b/Wabbajack.Downloaders.Interfaces/Wabbajack.Downloaders.Interfaces.csproj index d3acee8e..3cd979ce 100644 --- a/Wabbajack.Downloaders.Interfaces/Wabbajack.Downloaders.Interfaces.csproj +++ b/Wabbajack.Downloaders.Interfaces/Wabbajack.Downloaders.Interfaces.csproj @@ -1,7 +1,7 @@ - net7.0 + net8.0 enable GPL-3.0-or-later $(VERSION) diff --git a/Wabbajack.Downloaders.Manual/Wabbajack.Downloaders.Manual.csproj b/Wabbajack.Downloaders.Manual/Wabbajack.Downloaders.Manual.csproj index 575e7e12..6eabc26a 100644 --- a/Wabbajack.Downloaders.Manual/Wabbajack.Downloaders.Manual.csproj +++ b/Wabbajack.Downloaders.Manual/Wabbajack.Downloaders.Manual.csproj @@ -1,7 +1,7 @@ - net7.0 + net8.0 enable enable diff --git a/Wabbajack.Downloaders.MediaFire/Wabbajack.Downloaders.MediaFire.csproj b/Wabbajack.Downloaders.MediaFire/Wabbajack.Downloaders.MediaFire.csproj index 883ad2d0..e30a6781 100644 --- a/Wabbajack.Downloaders.MediaFire/Wabbajack.Downloaders.MediaFire.csproj +++ b/Wabbajack.Downloaders.MediaFire/Wabbajack.Downloaders.MediaFire.csproj @@ -1,7 +1,7 @@ - net7.0 + net8.0 enable diff --git a/Wabbajack.Downloaders.Mega/Wabbajack.Downloaders.Mega.csproj b/Wabbajack.Downloaders.Mega/Wabbajack.Downloaders.Mega.csproj index 2c58d3a0..3c995fe8 100644 --- a/Wabbajack.Downloaders.Mega/Wabbajack.Downloaders.Mega.csproj +++ b/Wabbajack.Downloaders.Mega/Wabbajack.Downloaders.Mega.csproj @@ -1,7 +1,7 @@ - net7.0 + net8.0 enable diff --git a/Wabbajack.Downloaders.ModDB/Wabbajack.Downloaders.ModDB.csproj b/Wabbajack.Downloaders.ModDB/Wabbajack.Downloaders.ModDB.csproj index d32eb433..56aa86c5 100644 --- a/Wabbajack.Downloaders.ModDB/Wabbajack.Downloaders.ModDB.csproj +++ b/Wabbajack.Downloaders.ModDB/Wabbajack.Downloaders.ModDB.csproj @@ -1,7 +1,7 @@ - net7.0 + net8.0 enable diff --git a/Wabbajack.Downloaders.Nexus/Wabbajack.Downloaders.Nexus.csproj b/Wabbajack.Downloaders.Nexus/Wabbajack.Downloaders.Nexus.csproj index 6fc137e1..31c94a03 100644 --- a/Wabbajack.Downloaders.Nexus/Wabbajack.Downloaders.Nexus.csproj +++ b/Wabbajack.Downloaders.Nexus/Wabbajack.Downloaders.Nexus.csproj @@ -1,7 +1,7 @@ - net7.0 + net8.0 enable GPL-3.0-or-later $(VERSION) diff --git a/Wabbajack.Downloaders.VerificationCache/Wabbajack.Downloaders.VerificationCache.csproj b/Wabbajack.Downloaders.VerificationCache/Wabbajack.Downloaders.VerificationCache.csproj index 864b1a37..8be4fe8f 100644 --- a/Wabbajack.Downloaders.VerificationCache/Wabbajack.Downloaders.VerificationCache.csproj +++ b/Wabbajack.Downloaders.VerificationCache/Wabbajack.Downloaders.VerificationCache.csproj @@ -1,7 +1,7 @@ - net7.0 + net8.0 enable enable diff --git a/Wabbajack.Downloaders.WabbajackCDN/Wabbajack.Downloaders.WabbajackCDN.csproj b/Wabbajack.Downloaders.WabbajackCDN/Wabbajack.Downloaders.WabbajackCDN.csproj index c9a9c634..f0dd21e1 100644 --- a/Wabbajack.Downloaders.WabbajackCDN/Wabbajack.Downloaders.WabbajackCDN.csproj +++ b/Wabbajack.Downloaders.WabbajackCDN/Wabbajack.Downloaders.WabbajackCDN.csproj @@ -1,7 +1,7 @@ - net7.0 + net8.0 enable $(VERSION) GPL-3.0-or-later diff --git a/Wabbajack.FileExtractor.Test/Wabbajack.FileExtractor.Test.csproj b/Wabbajack.FileExtractor.Test/Wabbajack.FileExtractor.Test.csproj index 40378dd9..55d9b16f 100644 --- a/Wabbajack.FileExtractor.Test/Wabbajack.FileExtractor.Test.csproj +++ b/Wabbajack.FileExtractor.Test/Wabbajack.FileExtractor.Test.csproj @@ -1,7 +1,7 @@ - net7.0 + net8.0 false diff --git a/Wabbajack.FileExtractor/Wabbajack.FileExtractor.csproj b/Wabbajack.FileExtractor/Wabbajack.FileExtractor.csproj index 358a3e0a..0874c803 100644 --- a/Wabbajack.FileExtractor/Wabbajack.FileExtractor.csproj +++ b/Wabbajack.FileExtractor/Wabbajack.FileExtractor.csproj @@ -1,7 +1,7 @@ - net7.0 + net8.0 enable $(VERSION) GPL-3.0-or-later diff --git a/Wabbajack.Hashing.PHash.Test/Wabbajack.Hashing.PHash.Test.csproj b/Wabbajack.Hashing.PHash.Test/Wabbajack.Hashing.PHash.Test.csproj index 7119afd0..290a02ed 100644 --- a/Wabbajack.Hashing.PHash.Test/Wabbajack.Hashing.PHash.Test.csproj +++ b/Wabbajack.Hashing.PHash.Test/Wabbajack.Hashing.PHash.Test.csproj @@ -1,7 +1,7 @@ - net7.0 + net8.0 false diff --git a/Wabbajack.Hashing.PHash/Wabbajack.Hashing.PHash.csproj b/Wabbajack.Hashing.PHash/Wabbajack.Hashing.PHash.csproj index 78d738ce..520d2626 100644 --- a/Wabbajack.Hashing.PHash/Wabbajack.Hashing.PHash.csproj +++ b/Wabbajack.Hashing.PHash/Wabbajack.Hashing.PHash.csproj @@ -1,7 +1,7 @@ - net7.0 + net8.0 enable $(VERSION) GPL-3.0-or-later diff --git a/Wabbajack.Hashing.xxHash64.Benchmark/Wabbajack.Hashing.xxHash64.Benchmark.csproj b/Wabbajack.Hashing.xxHash64.Benchmark/Wabbajack.Hashing.xxHash64.Benchmark.csproj index 03dff657..ecd4d5b6 100644 --- a/Wabbajack.Hashing.xxHash64.Benchmark/Wabbajack.Hashing.xxHash64.Benchmark.csproj +++ b/Wabbajack.Hashing.xxHash64.Benchmark/Wabbajack.Hashing.xxHash64.Benchmark.csproj @@ -2,7 +2,7 @@ Exe - net7.0 + net8.0 Wabbajac.Hash.xxHash64.Benchmark true diff --git a/Wabbajack.Hashing.xxHash64.Test/Wabbajack.Hashing.xxHash64.Test.csproj b/Wabbajack.Hashing.xxHash64.Test/Wabbajack.Hashing.xxHash64.Test.csproj index 204f9d5f..3bd30960 100644 --- a/Wabbajack.Hashing.xxHash64.Test/Wabbajack.Hashing.xxHash64.Test.csproj +++ b/Wabbajack.Hashing.xxHash64.Test/Wabbajack.Hashing.xxHash64.Test.csproj @@ -1,7 +1,7 @@ - net7.0 + net8.0 false diff --git a/Wabbajack.Hashing.xxHash64/Wabbajack.Hashing.xxHash64.csproj b/Wabbajack.Hashing.xxHash64/Wabbajack.Hashing.xxHash64.csproj index f26d307e..dc80757e 100644 --- a/Wabbajack.Hashing.xxHash64/Wabbajack.Hashing.xxHash64.csproj +++ b/Wabbajack.Hashing.xxHash64/Wabbajack.Hashing.xxHash64.csproj @@ -1,7 +1,7 @@ - net7.0 + net8.0 enable $(VERSION) GPL-3.0-or-later diff --git a/Wabbajack.IO.Async/Wabbajack.IO.Async.csproj b/Wabbajack.IO.Async/Wabbajack.IO.Async.csproj index 6836c680..8a918319 100644 --- a/Wabbajack.IO.Async/Wabbajack.IO.Async.csproj +++ b/Wabbajack.IO.Async/Wabbajack.IO.Async.csproj @@ -1,7 +1,7 @@ - net7.0 + net8.0 enable enable diff --git a/Wabbajack.Installer.Test/Wabbajack.Installer.Test.csproj b/Wabbajack.Installer.Test/Wabbajack.Installer.Test.csproj index 590be299..6d27a0ff 100644 --- a/Wabbajack.Installer.Test/Wabbajack.Installer.Test.csproj +++ b/Wabbajack.Installer.Test/Wabbajack.Installer.Test.csproj @@ -1,7 +1,7 @@ - net7.0 + net8.0 false diff --git a/Wabbajack.Installer/Wabbajack.Installer.csproj b/Wabbajack.Installer/Wabbajack.Installer.csproj index 28277612..d76063bb 100644 --- a/Wabbajack.Installer/Wabbajack.Installer.csproj +++ b/Wabbajack.Installer/Wabbajack.Installer.csproj @@ -1,7 +1,7 @@ - net7.0 + net8.0 enable $(VERSION) GPL-3.0-or-later diff --git a/Wabbajack.Launcher/Wabbajack.Launcher.csproj b/Wabbajack.Launcher/Wabbajack.Launcher.csproj index a47fefab..5336e142 100644 --- a/Wabbajack.Launcher/Wabbajack.Launcher.csproj +++ b/Wabbajack.Launcher/Wabbajack.Launcher.csproj @@ -16,7 +16,7 @@ Resources\Icons\wabbajack.ico - net7.0-windows + net8.0-windows diff --git a/Wabbajack.Networking.BethesdaNet/Wabbajack.Networking.BethesdaNet.csproj b/Wabbajack.Networking.BethesdaNet/Wabbajack.Networking.BethesdaNet.csproj index 68bb36ab..ff322dc0 100644 --- a/Wabbajack.Networking.BethesdaNet/Wabbajack.Networking.BethesdaNet.csproj +++ b/Wabbajack.Networking.BethesdaNet/Wabbajack.Networking.BethesdaNet.csproj @@ -1,7 +1,7 @@ - net7.0 + net8.0 enable enable diff --git a/Wabbajack.Networking.Discord/Wabbajack.Networking.Discord.csproj b/Wabbajack.Networking.Discord/Wabbajack.Networking.Discord.csproj index c9ab6aab..c05b4024 100644 --- a/Wabbajack.Networking.Discord/Wabbajack.Networking.Discord.csproj +++ b/Wabbajack.Networking.Discord/Wabbajack.Networking.Discord.csproj @@ -1,7 +1,7 @@ - net7.0 + net8.0 enable GPL-3.0-or-later $(VERSION) diff --git a/Wabbajack.Networking.GitHub/Wabbajack.Networking.GitHub.csproj b/Wabbajack.Networking.GitHub/Wabbajack.Networking.GitHub.csproj index 40e65542..ebb07835 100644 --- a/Wabbajack.Networking.GitHub/Wabbajack.Networking.GitHub.csproj +++ b/Wabbajack.Networking.GitHub/Wabbajack.Networking.GitHub.csproj @@ -1,7 +1,7 @@ - net7.0 + net8.0 enable GPL-3.0-or-later $(VERSION) diff --git a/Wabbajack.Networking.Http.Interfaces/Wabbajack.Networking.Http.Interfaces.csproj b/Wabbajack.Networking.Http.Interfaces/Wabbajack.Networking.Http.Interfaces.csproj index 5037943c..603db214 100644 --- a/Wabbajack.Networking.Http.Interfaces/Wabbajack.Networking.Http.Interfaces.csproj +++ b/Wabbajack.Networking.Http.Interfaces/Wabbajack.Networking.Http.Interfaces.csproj @@ -1,7 +1,7 @@ - net7.0 + net8.0 enable $(VERSION) GPL-3.0-or-later diff --git a/Wabbajack.Networking.Http.Test/Wabbajack.Networking.Http.Test.csproj b/Wabbajack.Networking.Http.Test/Wabbajack.Networking.Http.Test.csproj index a20f6ab2..f0762e54 100644 --- a/Wabbajack.Networking.Http.Test/Wabbajack.Networking.Http.Test.csproj +++ b/Wabbajack.Networking.Http.Test/Wabbajack.Networking.Http.Test.csproj @@ -1,7 +1,7 @@ - net7.0 + net8.0 enable false diff --git a/Wabbajack.Networking.Http/Wabbajack.Networking.Http.csproj b/Wabbajack.Networking.Http/Wabbajack.Networking.Http.csproj index 2cf94a56..eb64f515 100644 --- a/Wabbajack.Networking.Http/Wabbajack.Networking.Http.csproj +++ b/Wabbajack.Networking.Http/Wabbajack.Networking.Http.csproj @@ -1,7 +1,7 @@ - net7.0 + net8.0 enable GPL-3.0-or-later $(VERSION) diff --git a/Wabbajack.Networking.NexusApi.Test/Wabbajack.Networking.NexusApi.Test.csproj b/Wabbajack.Networking.NexusApi.Test/Wabbajack.Networking.NexusApi.Test.csproj index fac1ed50..3b8e6b96 100644 --- a/Wabbajack.Networking.NexusApi.Test/Wabbajack.Networking.NexusApi.Test.csproj +++ b/Wabbajack.Networking.NexusApi.Test/Wabbajack.Networking.NexusApi.Test.csproj @@ -1,7 +1,7 @@ - net7.0 + net8.0 false diff --git a/Wabbajack.Networking.NexusApi/Wabbajack.Networking.NexusApi.csproj b/Wabbajack.Networking.NexusApi/Wabbajack.Networking.NexusApi.csproj index 500ad9fa..e2de94ee 100644 --- a/Wabbajack.Networking.NexusApi/Wabbajack.Networking.NexusApi.csproj +++ b/Wabbajack.Networking.NexusApi/Wabbajack.Networking.NexusApi.csproj @@ -1,7 +1,7 @@ - net7.0 + net8.0 enable GPL-3.0-or-later $(VERSION) diff --git a/Wabbajack.Networking.Steam.Test/Wabbajack.Networking.Steam.Test.csproj b/Wabbajack.Networking.Steam.Test/Wabbajack.Networking.Steam.Test.csproj index c7e6d73b..67e78994 100644 --- a/Wabbajack.Networking.Steam.Test/Wabbajack.Networking.Steam.Test.csproj +++ b/Wabbajack.Networking.Steam.Test/Wabbajack.Networking.Steam.Test.csproj @@ -1,7 +1,7 @@ - net7.0 + net8.0 enable false diff --git a/Wabbajack.Networking.Steam/Wabbajack.Networking.Steam.csproj b/Wabbajack.Networking.Steam/Wabbajack.Networking.Steam.csproj index ee840362..2a505ddb 100644 --- a/Wabbajack.Networking.Steam/Wabbajack.Networking.Steam.csproj +++ b/Wabbajack.Networking.Steam/Wabbajack.Networking.Steam.csproj @@ -1,7 +1,7 @@ - net7.0 + net8.0 enable enable diff --git a/Wabbajack.Networking.WabbajackClientApi/Wabbajack.Networking.WabbajackClientApi.csproj b/Wabbajack.Networking.WabbajackClientApi/Wabbajack.Networking.WabbajackClientApi.csproj index 55712888..8aaefb95 100644 --- a/Wabbajack.Networking.WabbajackClientApi/Wabbajack.Networking.WabbajackClientApi.csproj +++ b/Wabbajack.Networking.WabbajackClientApi/Wabbajack.Networking.WabbajackClientApi.csproj @@ -1,7 +1,7 @@ - net7.0 + net8.0 enable $(VERSION) GPL-3.0-or-later diff --git a/Wabbajack.Paths.IO.Test/Wabbajack.Paths.IO.Test.csproj b/Wabbajack.Paths.IO.Test/Wabbajack.Paths.IO.Test.csproj index 3948bc11..9283f503 100644 --- a/Wabbajack.Paths.IO.Test/Wabbajack.Paths.IO.Test.csproj +++ b/Wabbajack.Paths.IO.Test/Wabbajack.Paths.IO.Test.csproj @@ -1,7 +1,7 @@ - net7.0 + net8.0 false diff --git a/Wabbajack.Paths.IO/Wabbajack.Paths.IO.csproj b/Wabbajack.Paths.IO/Wabbajack.Paths.IO.csproj index 0cd88c4d..16988ee3 100644 --- a/Wabbajack.Paths.IO/Wabbajack.Paths.IO.csproj +++ b/Wabbajack.Paths.IO/Wabbajack.Paths.IO.csproj @@ -1,7 +1,7 @@ - net7.0 + net8.0 enable GPL-3.0-or-later $(VERSION) diff --git a/Wabbajack.Paths.Test/Wabbajack.Paths.Test.csproj b/Wabbajack.Paths.Test/Wabbajack.Paths.Test.csproj index a5d4fe49..71630d2e 100644 --- a/Wabbajack.Paths.Test/Wabbajack.Paths.Test.csproj +++ b/Wabbajack.Paths.Test/Wabbajack.Paths.Test.csproj @@ -1,7 +1,7 @@ - net7.0 + net8.0 false diff --git a/Wabbajack.Paths/Wabbajack.Paths.csproj b/Wabbajack.Paths/Wabbajack.Paths.csproj index 1ffbca14..17c403db 100644 --- a/Wabbajack.Paths/Wabbajack.Paths.csproj +++ b/Wabbajack.Paths/Wabbajack.Paths.csproj @@ -1,6 +1,6 @@ - net7.0 + net8.0 enable GPL-3.0-or-later $(VERSION) diff --git a/Wabbajack.RateLimiter.Test/Wabbajack.RateLimiter.Test.csproj b/Wabbajack.RateLimiter.Test/Wabbajack.RateLimiter.Test.csproj index 3db11fcf..d09b9b77 100644 --- a/Wabbajack.RateLimiter.Test/Wabbajack.RateLimiter.Test.csproj +++ b/Wabbajack.RateLimiter.Test/Wabbajack.RateLimiter.Test.csproj @@ -1,7 +1,7 @@ - net7.0 + net8.0 enable false diff --git a/Wabbajack.RateLimiter/Wabbajack.RateLimiter.csproj b/Wabbajack.RateLimiter/Wabbajack.RateLimiter.csproj index 444af79a..935ceab3 100644 --- a/Wabbajack.RateLimiter/Wabbajack.RateLimiter.csproj +++ b/Wabbajack.RateLimiter/Wabbajack.RateLimiter.csproj @@ -1,7 +1,7 @@ - net7.0 + net8.0 enable diff --git a/Wabbajack.Server.Lib/Wabbajack.Server.Lib.csproj b/Wabbajack.Server.Lib/Wabbajack.Server.Lib.csproj index 03942d81..351f19c5 100644 --- a/Wabbajack.Server.Lib/Wabbajack.Server.Lib.csproj +++ b/Wabbajack.Server.Lib/Wabbajack.Server.Lib.csproj @@ -1,7 +1,7 @@ - net7.0 + net8.0 enable diff --git a/Wabbajack.Server/Wabbajack.Server.csproj b/Wabbajack.Server/Wabbajack.Server.csproj index 25c8f48e..7f7cffad 100644 --- a/Wabbajack.Server/Wabbajack.Server.csproj +++ b/Wabbajack.Server/Wabbajack.Server.csproj @@ -1,7 +1,7 @@ - net7.0 + net8.0 enable enable Exe diff --git a/Wabbajack.Services.OSIntegrated/Wabbajack.Services.OSIntegrated.csproj b/Wabbajack.Services.OSIntegrated/Wabbajack.Services.OSIntegrated.csproj index 2223ea6d..0a61e5a8 100644 --- a/Wabbajack.Services.OSIntegrated/Wabbajack.Services.OSIntegrated.csproj +++ b/Wabbajack.Services.OSIntegrated/Wabbajack.Services.OSIntegrated.csproj @@ -1,7 +1,7 @@ - net7.0 + net8.0 enable $(VERSION) GPL-3.0-or-later diff --git a/Wabbajack.VFS.Interfaces/Wabbajack.VFS.Interfaces.csproj b/Wabbajack.VFS.Interfaces/Wabbajack.VFS.Interfaces.csproj index 5b854cb5..a7bbfd87 100644 --- a/Wabbajack.VFS.Interfaces/Wabbajack.VFS.Interfaces.csproj +++ b/Wabbajack.VFS.Interfaces/Wabbajack.VFS.Interfaces.csproj @@ -1,7 +1,7 @@ - net7.0 + net8.0 enable enable diff --git a/Wabbajack.VFS.Test/Wabbajack.VFS.Test.csproj b/Wabbajack.VFS.Test/Wabbajack.VFS.Test.csproj index 29e3421c..9a11a2dd 100644 --- a/Wabbajack.VFS.Test/Wabbajack.VFS.Test.csproj +++ b/Wabbajack.VFS.Test/Wabbajack.VFS.Test.csproj @@ -1,7 +1,7 @@ - net7.0 + net8.0 false diff --git a/Wabbajack.VFS/Wabbajack.VFS.csproj b/Wabbajack.VFS/Wabbajack.VFS.csproj index a4501f7c..50dd72e6 100644 --- a/Wabbajack.VFS/Wabbajack.VFS.csproj +++ b/Wabbajack.VFS/Wabbajack.VFS.csproj @@ -1,7 +1,7 @@ - net7.0 + net8.0 enable $(VERSION) GPL-3.0-or-later diff --git a/buildall.bat b/buildall.bat index 010056f8..f587ea41 100644 --- a/buildall.bat +++ b/buildall.bat @@ -7,12 +7,12 @@ mkdir c:\tmp\publish-wj dotnet clean dotnet restore -dotnet publish Wabbajack.App.Wpf\Wabbajack.App.Wpf.csproj --runtime win10-x64 --configuration Release /p:Platform=x64 -o c:\tmp\publish-wj\app /p:PublishReadyToRun=true /p:PublishSingleFile=true /p:IncludeNativeLibrariesForSelfExtract=true --self-contained /p:DebugType=embedded -dotnet publish Wabbajack.Launcher\Wabbajack.Launcher.csproj --runtime win10-x64 --configuration Release /p:Platform=x64 -o c:\tmp\publish-wj\launcher /p:PublishReadyToRun=true /p:PublishSingleFile=true /p:IncludeNativeLibrariesForSelfExtract=true --self-contained /p:DebugType=embedded -dotnet publish c:\oss\Wabbajack\Wabbajack.CLI\Wabbajack.CLI.csproj --runtime win10-x64 --configuration Release /p:Platform=x64 -o c:\tmp\publish-wj\app --self-contained /p:DebugType=embedded -"C:\Program Files (x86)\Windows Kits\10\bin\10.0.19041.0\x64\signtool.exe" sign /t http://timestamp.sectigo.com c:\tmp\publish-wj\app\Wabbajack.exe -"C:\Program Files (x86)\Windows Kits\10\bin\10.0.19041.0\x64\signtool.exe" sign /t http://timestamp.sectigo.com c:\tmp\publish-wj\launcher\Wabbajack.exe -"C:\Program Files (x86)\Windows Kits\10\bin\10.0.19041.0\x64\signtool.exe" sign /t http://timestamp.sectigo.com c:\tmp\publish-wj\app\wabbajack-cli.exe +dotnet publish Wabbajack.App.Wpf\Wabbajack.App.Wpf.csproj --runtime win-x64 --configuration Release /p:Platform=x64 -o c:\tmp\publish-wj\app /p:PublishReadyToRun=true /p:PublishSingleFile=true /p:IncludeNativeLibrariesForSelfExtract=true --self-contained /p:DebugType=embedded +dotnet publish Wabbajack.Launcher\Wabbajack.Launcher.csproj --runtime win-x64 --configuration Release /p:Platform=x64 -o c:\tmp\publish-wj\launcher /p:PublishReadyToRun=true /p:PublishSingleFile=true /p:IncludeNativeLibrariesForSelfExtract=true --self-contained /p:DebugType=embedded +dotnet publish c:\oss\Wabbajack\Wabbajack.CLI\Wabbajack.CLI.csproj --runtime win-x64 --configuration Release /p:Platform=x64 -o c:\tmp\publish-wj\app --self-contained /p:DebugType=embedded +"C:\Program Files (x86)\Windows Kits\10\bin\10.0.19041.0\x64\signtool.exe" sign /fd sha256 /tr http://ts.ssl.com /td sha256 /sha1 8c26a8e0bf3e70eb89721cc4d86a87137153ccba c:\tmp\publish-wj\app\Wabbajack.exe +"C:\Program Files (x86)\Windows Kits\10\bin\10.0.19041.0\x64\signtool.exe" sign /fd sha256 /tr http://ts.ssl.com /td sha256 /sha1 8c26a8e0bf3e70eb89721cc4d86a87137153ccba c:\tmp\publish-wj\launcher\Wabbajack.exe +"C:\Program Files (x86)\Windows Kits\10\bin\10.0.19041.0\x64\signtool.exe" sign /fd sha256 /tr http://ts.ssl.com /td sha256 /sha1 8c26a8e0bf3e70eb89721cc4d86a87137153ccba c:\tmp\publish-wj\app\wabbajack-cli.exe "c:\Program Files\7-Zip\7z.exe" a c:\tmp\publish-wj\%VERSION%.zip c:\tmp\publish-wj\app\* copy c:\tmp\publish-wj\launcher\Wabbajack.exe c:\tmp\publish-wj\Wabbajack.exe From cf0dae0049b40a547a750c954c4cc3751fa040f3 Mon Sep 17 00:00:00 2001 From: Timothy Baldridge Date: Fri, 20 Oct 2023 22:40:35 +0100 Subject: [PATCH 2/5] Rework the server code a bit to use web workers and r2 in more places --- Wabbajack.Server/AppSettings.cs | 9 +- Wabbajack.Server/Controllers/Proxy.cs | 149 +++++++++++++----- Wabbajack.Server/DataModels/AuthorFiles.cs | 6 +- .../Resources/Reports/AuthoredFiles.html | 2 +- Wabbajack.Server/Startup.cs | 6 +- Wabbajack.Server/appsettings.json | 13 +- 6 files changed, 125 insertions(+), 60 deletions(-) diff --git a/Wabbajack.Server/AppSettings.cs b/Wabbajack.Server/AppSettings.cs index 6b16a846..bbaddce7 100644 --- a/Wabbajack.Server/AppSettings.cs +++ b/Wabbajack.Server/AppSettings.cs @@ -37,18 +37,19 @@ public class AppSettings public CouchDBSetting CesiDB { get; set; } public CouchDBSetting MetricsDB { get; set; } - public S3Settings AuthoredFilesS3 { get; set; } + public S3Settings S3 { get; set; } } public class S3Settings { public string AccessKey { get; set; } public string SecretKey { get; set; } - public string ServiceURL { get; set; } + public string ServiceUrl { get; set; } - public string BucketName { get; set; } + public string AuthoredFilesBucket { get; set; } + public string ProxyFilesBucket { get; set; } - public string BucketCacheFile { get; set; } + public string AuthoredFilesBucketCache { get; set; } } public class CouchDBSetting diff --git a/Wabbajack.Server/Controllers/Proxy.cs b/Wabbajack.Server/Controllers/Proxy.cs index eba4175d..155cfc97 100644 --- a/Wabbajack.Server/Controllers/Proxy.cs +++ b/Wabbajack.Server/Controllers/Proxy.cs @@ -1,4 +1,7 @@ using System.Text; +using Amazon.Runtime; +using Amazon.S3; +using Amazon.S3.Model; using FluentFTP.Helpers; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; @@ -10,7 +13,9 @@ using Wabbajack.Downloaders.Interfaces; using Wabbajack.DTOs; using Wabbajack.DTOs.DownloadStates; using Wabbajack.Hashing.xxHash64; +using Wabbajack.Paths; using Wabbajack.Paths.IO; +using Wabbajack.RateLimiter; using Wabbajack.VFS; namespace Wabbajack.Server.Controllers; @@ -24,14 +29,23 @@ public class Proxy : ControllerBase private readonly TemporaryFileManager _tempFileManager; private readonly AppSettings _appSettings; private readonly FileHashCache _hashCache; + private readonly IAmazonS3 _s3; + private readonly string _bucket; + + private string _redirectUrl = "https://proxy.wabbajack.org/"; + private readonly IResource _resource; - public Proxy(ILogger logger, DownloadDispatcher dispatcher, TemporaryFileManager tempFileManager, FileHashCache hashCache, AppSettings appSettings) + public Proxy(ILogger logger, DownloadDispatcher dispatcher, TemporaryFileManager tempFileManager, + FileHashCache hashCache, AppSettings appSettings, IAmazonS3 s3, IResource resource) { _logger = logger; _dispatcher = dispatcher; _tempFileManager = tempFileManager; _appSettings = appSettings; _hashCache = hashCache; + _s3 = s3; + _bucket = _appSettings.S3.ProxyFilesBucket; + _resource = resource; } [HttpHead] @@ -58,12 +72,14 @@ public class Proxy : ControllerBase [HttpGet] public async Task ProxyGet(CancellationToken token, [FromQuery] Uri uri, [FromQuery] string? name, [FromQuery] string? hash) { + + Hash hashResult = default; var shouldMatch = hash != null ? Hash.FromHex(hash) : default; _logger.LogInformation("Got proxy request for {Uri}", uri); var state = _dispatcher.Parse(uri); var cacheName = (await Encoding.UTF8.GetBytes(uri.ToString()).Hash()).ToHex(); - var cacheFile = _appSettings.ProxyPath.Combine(cacheName); + var cacheFile = await GetCacheEntry(cacheName); if (state == null) { @@ -84,26 +100,27 @@ public class Proxy : ControllerBase return BadRequest(new {Type = "Downloader is not IProxyable", Downloader = downloader.GetType().FullName}); } - if (cacheFile.FileExists() && (DateTime.Now - cacheFile.LastModified()) > TimeSpan.FromHours(4)) + if (cacheFile != null && (DateTime.UtcNow - cacheFile.LastModified) > TimeSpan.FromHours(4)) { try { var verify = await _dispatcher.Verify(archive, token); if (verify) - cacheFile.Touch(); + await TouchCacheEntry(cacheName); } catch (Exception ex) { - _logger.LogInformation(ex, "When trying to verify cached file ({Hash}) {Url}", cacheFile.FileName, uri); - cacheFile.Touch(); + _logger.LogInformation(ex, "When trying to verify cached file ({Hash}) {Url}", + cacheFile.Hash, uri); + await TouchCacheEntry(cacheName); } } - if (cacheFile.FileExists() && (DateTime.Now - cacheFile.LastModified()) > TimeSpan.FromHours(24)) + if (cacheFile != null && (DateTime.Now - cacheFile.LastModified) > TimeSpan.FromHours(24)) { try { - cacheFile.Delete(); + await DeleteCacheEntry(cacheName); } catch (Exception ex) { @@ -112,18 +129,15 @@ public class Proxy : ControllerBase } - if (cacheFile.FileExists()) + var redirectUrl = _redirectUrl + cacheName + "?response-content-disposition=attachment;filename=" + (name ?? "unknown"); + if (cacheFile != null) { if (hash != default) { - var hashResult = await _hashCache.FileHashCachedAsync(cacheFile, token); - if (hashResult != shouldMatch) + if (cacheFile.Hash != shouldMatch) return BadRequest(new {Type = "Unmatching Hashes", Expected = shouldMatch.ToHex(), Found = hashResult.ToHex()}); } - var ret = new PhysicalFileResult(cacheFile.ToString(), "application/octet-stream"); - if (name != null) - ret.FileDownloadName = name; - return ret; + return new RedirectResult(redirectUrl); } _logger.LogInformation("Downloading proxy request for {Uri}", uri); @@ -131,38 +145,87 @@ public class Proxy : ControllerBase var tempFile = _tempFileManager.CreateFile(deleteOnDispose:false); var proxyDownloader = _dispatcher.Downloader(archive) as IProxyable; - await using (var of = tempFile.Path.Open(FileMode.Create, FileAccess.Write, FileShare.None)) + + using var job = await _resource.Begin("Downloading file", 0, token); + hashResult = await proxyDownloader!.Download(archive, tempFile.Path, job, token); + + + if (hash != default && hashResult != shouldMatch) { - Response.StatusCode = 200; - if (name != null) - { - Response.Headers.Add(HeaderNames.ContentDisposition, $"attachment; filename=\"{name}\""); - } - - Response.Headers.Add( HeaderNames.ContentType, "application/octet-stream" ); - - var result = await proxyDownloader!.DownloadStream(archive, async s => { - return await s.HashingCopy(async m => - { - var strmA = of.WriteAsync(m, token); - await Response.Body.WriteAsync(m, token); - await Response.Body.FlushAsync(token); - await strmA; - }, token); }, - token); - - - if (hash != default && result != shouldMatch) - { - if (tempFile.Path.FileExists()) - tempFile.Path.Delete(); - } + if (tempFile.Path.FileExists()) + tempFile.Path.Delete(); } + + await PutCacheEntry(tempFile.Path, cacheName, hashResult); + _logger.LogInformation("Returning proxy request for {Uri}", uri); + return new RedirectResult(redirectUrl); + } - await tempFile.Path.MoveToAsync(cacheFile, true, token); + private async Task GetCacheEntry(string name) + { + var info = await _s3.GetObjectMetadataAsync(new GetObjectMetadataRequest() + { + BucketName = _bucket, + Key = name + }); + if (info.HttpStatusCode == System.Net.HttpStatusCode.NotFound) + return null; + + if (info.Metadata["WJ-Hash"] == null) + return null; + + if (!Hash.TryGetFromHex(info.Metadata["WJ-Hash"], out var hash)) + return null; + + return new CacheStatus + { + LastModified = info.LastModified, + Size = info.ContentLength, + Hash = hash + }; + } + + private async Task TouchCacheEntry(string name) + { + await _s3.CopyObjectAsync(new CopyObjectRequest() + { + SourceBucket = _bucket, + DestinationBucket = _bucket, + SourceKey = name, + DestinationKey = name, + MetadataDirective = S3MetadataDirective.REPLACE, + }); + } + + private async Task PutCacheEntry(AbsolutePath path, string name, Hash hash) + { + var obj = new PutObjectRequest + { + BucketName = _bucket, + Key = name, + FilePath = path.ToString(), + ContentType = "application/octet-stream", + DisablePayloadSigning = true + }; + obj.Metadata.Add("WJ-Hash", hash.ToHex()); + await _s3.PutObjectAsync(obj); + } + + private async Task DeleteCacheEntry(string name) + { + await _s3.DeleteObjectAsync(new DeleteObjectRequest + { + BucketName = _bucket, + Key = name + }); + } - _logger.LogInformation("Returning proxy request for {Uri} {Size}", uri, cacheFile.Size().FileSizeToString()); - return new EmptyResult(); + record CacheStatus + { + public DateTime LastModified { get; init; } + public long Size { get; init; } + + public Hash Hash { get; init; } } } \ No newline at end of file diff --git a/Wabbajack.Server/DataModels/AuthorFiles.cs b/Wabbajack.Server/DataModels/AuthorFiles.cs index c9ff706b..e22b3cd8 100644 --- a/Wabbajack.Server/DataModels/AuthorFiles.cs +++ b/Wabbajack.Server/DataModels/AuthorFiles.cs @@ -31,7 +31,7 @@ public class AuthorFiles private readonly HttpClient _httpClient; private readonly AbsolutePath _cacheFile; - private Uri _baseUri => new($"https://r2.wabbajack.org/"); + private Uri _baseUri => new($"https://authored-files.wabbajack.org/"); public AuthorFiles(ILogger logger, AppSettings settings, DTOSerializer dtos, IAmazonS3 s3, HttpClient client) { @@ -41,10 +41,10 @@ public class AuthorFiles _settings = settings; _dtos = dtos; _fileCache = new ConcurrentDictionary(); - _bucketName = settings.AuthoredFilesS3.BucketName; + _bucketName = settings.S3.AuthoredFilesBucket; _ = PrimeCache(); _streamPool = new RecyclableMemoryStreamManager(); - _cacheFile = _settings.AuthoredFilesS3.BucketCacheFile.ToAbsolutePath(); + _cacheFile = _settings.S3.AuthoredFilesBucket.ToAbsolutePath(); } private async Task PrimeCache() diff --git a/Wabbajack.Server/Resources/Reports/AuthoredFiles.html b/Wabbajack.Server/Resources/Reports/AuthoredFiles.html index fe85202d..a7a216d7 100644 --- a/Wabbajack.Server/Resources/Reports/AuthoredFiles.html +++ b/Wabbajack.Server/Resources/Reports/AuthoredFiles.html @@ -28,7 +28,7 @@ {{$.HumanSize}} {{$.Definition.Author}} {{$.Updated}} - (Slow) HTTP Direct Link + (Slow) HTTP Direct Link {{/each}} diff --git a/Wabbajack.Server/Startup.cs b/Wabbajack.Server/Startup.cs index 14b8c66f..d67d0726 100644 --- a/Wabbajack.Server/Startup.cs +++ b/Wabbajack.Server/Startup.cs @@ -101,11 +101,11 @@ public class Startup services.AddSingleton(s => { var appSettings = s.GetRequiredService(); - var settings = new BasicAWSCredentials(appSettings.AuthoredFilesS3.AccessKey, - appSettings.AuthoredFilesS3.SecretKey); + var settings = new BasicAWSCredentials(appSettings.S3.AccessKey, + appSettings.S3.SecretKey); return new AmazonS3Client(settings, new AmazonS3Config { - ServiceURL = appSettings.AuthoredFilesS3.ServiceURL, + ServiceURL = appSettings.S3.ServiceUrl, }); }); services.AddTransient(s => diff --git a/Wabbajack.Server/appsettings.json b/Wabbajack.Server/appsettings.json index 5de64833..1acb7a81 100644 --- a/Wabbajack.Server/appsettings.json +++ b/Wabbajack.Server/appsettings.json @@ -29,12 +29,13 @@ "Username": "wabbajack", "Password": "password" }, - "AuthoredFilesS3": { - "AccessKey": "", - "SecretKey": "", - "ServiceURL": "", - "BucketName": "authored-files", - "BucketCacheFile": "c:\\tmp\\bucket-cache.txt" + "S3": { + "AccessKey": "<>", + "SecretKey": "<>", + "ServiceUrl": "<>", + "ProxyFilesBucket": "proxy-files", + "AuthoredFilesBucket": "authored-files", + "AuthoredFilesBucketCache": "c:\\tmp\\bucket-cache.txt" } }, "AllowedHosts": "*" From 798b07c715d112316851eb02af2dcc92b04c7ef5 Mon Sep 17 00:00:00 2001 From: Timothy Baldridge Date: Fri, 20 Oct 2023 22:56:19 +0100 Subject: [PATCH 3/5] Fix typeo --- Wabbajack.Server/DataModels/AuthorFiles.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Wabbajack.Server/DataModels/AuthorFiles.cs b/Wabbajack.Server/DataModels/AuthorFiles.cs index e22b3cd8..a4c3bc6c 100644 --- a/Wabbajack.Server/DataModels/AuthorFiles.cs +++ b/Wabbajack.Server/DataModels/AuthorFiles.cs @@ -44,7 +44,7 @@ public class AuthorFiles _bucketName = settings.S3.AuthoredFilesBucket; _ = PrimeCache(); _streamPool = new RecyclableMemoryStreamManager(); - _cacheFile = _settings.S3.AuthoredFilesBucket.ToAbsolutePath(); + _cacheFile = _settings.S3.AuthoredFilesBucketCache.ToAbsolutePath(); } private async Task PrimeCache() From 25dd5a047487f5de015d84bed99708d31bb0c117 Mon Sep 17 00:00:00 2001 From: Timothy Baldridge Date: Fri, 20 Oct 2023 23:04:47 +0100 Subject: [PATCH 4/5] Soe error handling --- Wabbajack.Server/Controllers/Proxy.cs | 32 ++++++++++++--------------- 1 file changed, 14 insertions(+), 18 deletions(-) diff --git a/Wabbajack.Server/Controllers/Proxy.cs b/Wabbajack.Server/Controllers/Proxy.cs index 155cfc97..6f10a637 100644 --- a/Wabbajack.Server/Controllers/Proxy.cs +++ b/Wabbajack.Server/Controllers/Proxy.cs @@ -52,21 +52,8 @@ public class Proxy : ControllerBase public async Task ProxyHead(CancellationToken token, [FromQuery] Uri uri, [FromQuery] string? name, [FromQuery] string? hash) { - var shouldMatch = hash != null ? Hash.FromHex(hash) : default; - _logger.LogInformation("Got proxy head request for {Uri}", uri); - var state = _dispatcher.Parse(uri); var cacheName = (await Encoding.UTF8.GetBytes(uri.ToString()).Hash()).ToHex(); - var cacheFile = _appSettings.ProxyPath.Combine(cacheName); - - if (!cacheFile.FileExists()) - return NotFound(); - - if (shouldMatch != default) - if (await _hashCache.FileHashCachedAsync(cacheFile, token) != shouldMatch) - return NotFound(); - - return Ok(); - + return new RedirectResult(_redirectUrl + cacheName); } [HttpGet] @@ -164,11 +151,20 @@ public class Proxy : ControllerBase private async Task GetCacheEntry(string name) { - var info = await _s3.GetObjectMetadataAsync(new GetObjectMetadataRequest() + GetObjectMetadataResponse info; + try { - BucketName = _bucket, - Key = name - }); + info = await _s3.GetObjectMetadataAsync(new GetObjectMetadataRequest() + { + BucketName = _bucket, + Key = name, + }); + } + catch (Exception _) + { + return null; + } + if (info.HttpStatusCode == System.Net.HttpStatusCode.NotFound) return null; From ce7198e79212f81b0e3934dda315b894a194d5d9 Mon Sep 17 00:00:00 2001 From: Timothy Baldridge Date: Fri, 20 Oct 2023 23:17:15 +0100 Subject: [PATCH 5/5] Return not found on hash error --- Wabbajack.Server/Controllers/Proxy.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/Wabbajack.Server/Controllers/Proxy.cs b/Wabbajack.Server/Controllers/Proxy.cs index 6f10a637..918351f5 100644 --- a/Wabbajack.Server/Controllers/Proxy.cs +++ b/Wabbajack.Server/Controllers/Proxy.cs @@ -141,6 +141,7 @@ public class Proxy : ControllerBase { if (tempFile.Path.FileExists()) tempFile.Path.Delete(); + return NotFound(); } await PutCacheEntry(tempFile.Path, cacheName, hashResult);