Iceshrimp.NET/Iceshrimp.Backend/Iceshrimp.Backend.csproj
Laura Hausmann 705e061f74
[backend/asp] Refactor middleware stack
This commit splits the request pipeline conditionally instead of invoking every middleware in the stack.

It also simplifies middleware instantiation by using runtime discovery, allowing for Plugins to add Middleware.
2024-11-18 19:02:44 +01:00

103 lines
6 KiB
XML

<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<!-- ASP.NET MVC & Razor Pages don't support trimming yet (and everything else might also break) -->
<PublishTrimmed>false</PublishTrimmed>
<!-- Makes sure that we compile against the correct native dependency -->
<UseCurrentRuntimeIdentifier>true</UseCurrentRuntimeIdentifier>
</PropertyGroup>
<Import Project="..\Iceshrimp.Build\Iceshrimp.Build.props"/>
<ItemGroup>
<ProjectReference Include="..\Iceshrimp.Build\Iceshrimp.Build.csproj" PrivateAssets="all" IncludeAssets="build" />
<ProjectReference Include="..\Iceshrimp.Frontend\Iceshrimp.Frontend.csproj" />
<ProjectReference Include="..\Iceshrimp.Parsing\Iceshrimp.Parsing.fsproj" />
<ProjectReference Include="..\Iceshrimp.Shared\Iceshrimp.Shared.csproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="AngleSharp" Version="1.1.2" />
<PackageReference Include="AsyncKeyedLock" Version="7.1.3" />
<PackageReference Include="CommunityToolkit.HighPerformance" Version="8.3.2" />
<PackageReference Include="dotNetRdf.Core" Version="3.3.1-iceshrimp" />
<PackageReference Include="EntityFrameworkCore.Exceptions.PostgreSQL" Version="8.1.3" />
<PackageReference Include="EntityFrameworkCore.Projectables" Version="4.0.0-preview.4" />
<PackageReference Include="FlexLabs.EntityFrameworkCore.Upsert" Version="8.0.0" />
<PackageReference Include="Iceshrimp.ObjectStorage.S3" Version="0.34.3" />
<PackageReference Include="Isopoh.Cryptography.Argon2" Version="2.0.0" />
<PackageReference Include="JetBrains.Annotations" Version="2024.3.0" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.Server" Version="9.0.0" />
<PackageReference Include="Microsoft.AspNetCore.DataProtection.EntityFrameworkCore" Version="9.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="9.0.0" />
<PackageReference Include="Microsoft.AspNetCore.SignalR.Protocols.MessagePack" Version="9.0.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="9.0.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="9.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.Ini" Version="9.0.0" />
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="9.0.0" />
<PackageReference Include="Scalar.AspNetCore" Version="1.2.39" />
<PackageReference Include="SixLabors.ImageSharp.Drawing" Version="2.1.4" />
<PackageReference Include="SixLabors.ImageSharp" Version="3.1.6-iceshrimp" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="7.0.0" />
<PackageReference Include="System.IO.Hashing" Version="9.0.0" />
<PackageReference Include="System.Linq.Async" Version="6.0.1" />
<PackageReference Include="System.Text.RegularExpressions" Version="4.3.1" />
<PackageReference Include="System.Text.Json" Version="9.0.0" />
<PackageReference Include="Ulid" Version="1.3.4" />
<PackageReference Include="Iceshrimp.AssemblyUtils" Version="1.0.2" />
<PackageReference Include="Iceshrimp.MimeTypes" Version="1.0.1" />
<PackageReference Include="Iceshrimp.WebPush" Version="2.1.0" />
<PackageReference Include="NetVips" Version="3.0.0" />
</ItemGroup>
<!-- Transitive dependency version overrides to patch security vulnerabilities -->
<ItemGroup>
<PackageReference Include="System.Private.Uri" Version="4.3.2" />
</ItemGroup>
<!-- If the build flag BundleNativeDeps is set, reference the LibVips native dependecy -->
<ItemGroup Condition=" '$(BundleNativeDeps)' == 'true' ">
<PackageReference Include="NetVips.Native" Version="8.15.2-iceshrimp" />
</ItemGroup>
<!-- This makes sure configuration.ini & the preloaded AS contexts are added to the assembly as embedded resources -->
<ItemGroup>
<EmbeddedResource Include="configuration.ini" CopyToOutputDirectory="Always" />
<EmbeddedResource Include="Core\Federation\ActivityStreams\Contexts\*.json">
<TargetPath>contexts\%(Filename)%(Extension)</TargetPath>
</EmbeddedResource>
<Content Update="Core\Federation\ActivityStreams\Contexts\*.json">
<CopyToOutputDirectory>Never</CopyToOutputDirectory>
<CopyToPublishDirectory>Never</CopyToPublishDirectory>
</Content>
</ItemGroup>
<!-- This is a script used during development, and not needed in the final output -->
<ItemGroup>
<None Remove="Core\Database\prune-designer-cs-files.sh" />
</ItemGroup>
<!-- This saves a bunch of disk space by discarding the original and gzip-compressed static assets. -->
<!-- For clients that don't support brotli, they will be transparently decompressed by the server. -->
<Target Name="KeepOnlyBrotliCompressedStaticAssets" AfterTargets="Publish">
<ItemGroup>
<CompressedFiles Include="$(PublishDir)\wwwroot\**\*.br" />
<FilesToClean Include="@(CompressedFiles->'%(RootDir)%(Directory)%(Filename)')" />
<FilesToClean Include="@(CompressedFiles->'%(RootDir)%(Directory)%(Filename).gz')" />
</ItemGroup>
<Delete Files="@(FilesToClean->Exists())" />
</Target>
<!-- This runs a task that rewrites the static asset endpoints JSON file to enable transparent decompression. -->
<ItemGroup>
<ManifestFiles Include="$(PublishDir)\Iceshrimp.Backend.staticwebassets.endpoints.json"/>
</ItemGroup>
<Target Name="RewriteStaticAssetManifest" AfterTargets="KeepOnlyBrotliCompressedStaticAssets">
<RewriteStaticAssetManifest ManifestFiles="@(ManifestFiles)" />
</Target>
</Project>