S5 of the roadmap. ContentSanitizer wraps HtmlSanitizer with Mastodon's allowlist: the inline and list tags Mastodon keeps, href/rel/class and the list attributes, microformat and mention/hashtag/ellipsis/invisible classes, Mastodon's link schemes, every link rel=nofollow noopener noreferrer, relative links unlinked, headings folded to a bold paragraph, and the contents of script, style, svg, iframe and friends dropped rather than kept as text. Post and DmPost gain ContentHtml (what is shown) and ContentFormat (Markdown for local, Html for remote). Inbound Create and Update, and a remote actor's biography, are sanitized on the way in; local posts store their Markdig rendering. Migration _002 does the same to what is already stored, and migrations now run at startup. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012CzABvBkbcFqoHdmi8b9WB
60 lines
2.3 KiB
XML
60 lines
2.3 KiB
XML
<Project Sdk="Microsoft.NET.Sdk.Web">
|
|
|
|
<PropertyGroup>
|
|
<TargetFramework>net10.0</TargetFramework>
|
|
<Nullable>disable</Nullable>
|
|
<ImplicitUsings>enable</ImplicitUsings>
|
|
</PropertyGroup>
|
|
|
|
<ItemGroup>
|
|
<PackageReference Include="HtmlSanitizer" Version="9.2.1039" />
|
|
<PackageReference Include="MailKit" Version="4.18.0" />
|
|
<PackageReference Include="Markdig" Version="1.4.0" />
|
|
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="10.0.9" />
|
|
<PackageReference Include="MongoDB.Entities" Version="25.1.0" />
|
|
<PackageReference Include="PasswordGenerator" Version="3.0.0" />
|
|
<PackageReference Include="Serilog.AspNetCore" Version="10.0.0" />
|
|
<PackageReference Include="Serilog.Sinks.MongoDB" Version="7.3.0" />
|
|
<PackageReference Include="Swashbuckle.AspNetCore" Version="10.2.3" />
|
|
</ItemGroup>
|
|
|
|
<ItemGroup>
|
|
<ProjectReference Include="..\PrivaPub.ClientModels\PrivaPub.ClientModels.csproj" />
|
|
</ItemGroup>
|
|
|
|
<ItemGroup>
|
|
<Compile Update="Resources\GenericRes.Designer.cs">
|
|
<DesignTime>True</DesignTime>
|
|
<AutoGen>True</AutoGen>
|
|
<DependentUpon>GenericRes.resx</DependentUpon>
|
|
</Compile>
|
|
</ItemGroup>
|
|
|
|
<ItemGroup>
|
|
<EmbeddedResource Update="Resources\GenericRes.resx">
|
|
<Generator>PublicResXFileCodeGenerator</Generator>
|
|
<LastGenOutput>GenericRes.Designer.cs</LastGenOutput>
|
|
</EmbeddedResource>
|
|
</ItemGroup>
|
|
|
|
<Target Name="GenerateBuildInfo" BeforeTargets="BeforeCompile">
|
|
<PropertyGroup>
|
|
<BuildInfoPath>$(IntermediateOutputPath)BuildInfo.g.cs</BuildInfoPath>
|
|
</PropertyGroup>
|
|
<ItemGroup>
|
|
<BuildInfoLine Include="public static class BuildInfo" />
|
|
<BuildInfoLine Include="{" />
|
|
<BuildInfoLine Include=" public const string Commit = "$(BuildCommit)"%3B" />
|
|
<BuildInfoLine Include=" public const string Ref = "$(BuildRef)"%3B" />
|
|
<BuildInfoLine Include=" public const string BuiltAt = "$(BuildTimeUtc)"%3B" />
|
|
<BuildInfoLine Include="}" />
|
|
</ItemGroup>
|
|
<WriteLinesToFile File="$(BuildInfoPath)" Lines="@(BuildInfoLine)" Overwrite="true" WriteOnlyWhenDifferent="true" />
|
|
<ItemGroup>
|
|
<Compile Include="$(BuildInfoPath)" />
|
|
<FileWrites Include="$(BuildInfoPath)" />
|
|
</ItemGroup>
|
|
</Target>
|
|
|
|
</Project>
|