mirror of
https://github.com/BinaryAlley/Nemera.git
synced 2026-12-02 19:11:10 +00:00
Adds bundled plugin trust and cross-platform native deployment
- embeds the append-only historical and deny trust lists in the API and marks matching bundled plugins as Official without blocking loading - builds and records the current plugin manifest only for official release builds - deploys the PDF native libraries for the supported Linux, macOS and Windows runtimes from the plugin dependency manifest - records release hashes by appending only missing entries to master's manifest and rejects any diff that removes a line - documents the release flow, the supported runtimes and the plugin installer limits
This commit is contained in:
1 parent
3fb8912c7f
commit
b30cbd6b9e
114 files changed
+2708
-243
No files matched your search
@@ -52,4 +52,9 @@ public class PluginDto
|
||||
/// Gets or sets the settings of the plugin.
|
||||
/// </summary>
|
||||
public Dictionary<string, string>? Settings { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets whether the plugin matches a trusted bundled plugin binary.
|
||||
/// </summary>
|
||||
public bool IsOfficial { get; set; }
|
||||
}
|
||||
@@ -165,4 +165,7 @@
|
||||
<data name="UploadFailed" xml:space="preserve">
|
||||
<value>فشل الرفع</value>
|
||||
</data>
|
||||
<data name="Official" xml:space="preserve">
|
||||
<value>رسمي</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -165,4 +165,7 @@
|
||||
<data name="UploadFailed" xml:space="preserve">
|
||||
<value>Upload fehlgeschlagen</value>
|
||||
</data>
|
||||
<data name="Official" xml:space="preserve">
|
||||
<value>Offiziell</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -165,4 +165,7 @@
|
||||
<data name="UploadFailed" xml:space="preserve">
|
||||
<value>Upload failed</value>
|
||||
</data>
|
||||
<data name="Official" xml:space="preserve">
|
||||
<value>Official</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -165,4 +165,7 @@
|
||||
<data name="UploadFailed" xml:space="preserve">
|
||||
<value>Error al subir</value>
|
||||
</data>
|
||||
<data name="Official" xml:space="preserve">
|
||||
<value>Oficial</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -165,4 +165,7 @@
|
||||
<data name="UploadFailed" xml:space="preserve">
|
||||
<value>Échec du téléversement</value>
|
||||
</data>
|
||||
<data name="Official" xml:space="preserve">
|
||||
<value>Officiel</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -165,4 +165,7 @@
|
||||
<data name="UploadFailed" xml:space="preserve">
|
||||
<value>Caricamento non riuscito</value>
|
||||
</data>
|
||||
<data name="Official" xml:space="preserve">
|
||||
<value>Ufficiale</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -165,4 +165,7 @@
|
||||
<data name="UploadFailed" xml:space="preserve">
|
||||
<value>アップロードに失敗しました</value>
|
||||
</data>
|
||||
<data name="Official" xml:space="preserve">
|
||||
<value>公式</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -165,4 +165,7 @@
|
||||
<data name="UploadFailed" xml:space="preserve">
|
||||
<value>Upload failed</value>
|
||||
</data>
|
||||
<data name="Official" xml:space="preserve">
|
||||
<value>Official</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -165,4 +165,7 @@
|
||||
<data name="UploadFailed" xml:space="preserve">
|
||||
<value>Încărcarea a eșuat</value>
|
||||
</data>
|
||||
<data name="Official" xml:space="preserve">
|
||||
<value>Oficial</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -165,4 +165,7 @@
|
||||
<data name="UploadFailed" xml:space="preserve">
|
||||
<value>Не вдалося завантажити</value>
|
||||
</data>
|
||||
<data name="Official" xml:space="preserve">
|
||||
<value>Офіційний</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -165,4 +165,7 @@
|
||||
<data name="UploadFailed" xml:space="preserve">
|
||||
<value>上传失败</value>
|
||||
</data>
|
||||
<data name="Official" xml:space="preserve">
|
||||
<value>官方</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -50,7 +50,14 @@
|
||||
@foreach (PluginDto plugin in Model)
|
||||
{
|
||||
<tr data-plugin-id="@plugin.Id">
|
||||
<td>@plugin.Name</td>
|
||||
<td>
|
||||
@plugin.Name
|
||||
@* Only a loaded plugin can carry the Official badge; a failed plugin has no trusted binary to describe. *@
|
||||
@if (plugin.LoadStatus == PluginLoadStatus.Loaded && plugin.IsOfficial)
|
||||
{
|
||||
<span class="plugin-official-badge">@_localizer["Official"]</span>
|
||||
}
|
||||
</td>
|
||||
<td>@plugin.Author</td>
|
||||
<td>@plugin.Version</td>
|
||||
<td>@plugin.Description</td>
|
||||
|
||||
@@ -11,22 +11,25 @@ EXPOSE 5012
|
||||
|
||||
|
||||
# ==== Stage 1: Build stage
|
||||
FROM mcr.microsoft.com/dotnet/sdk:10.0 AS build
|
||||
FROM mcr.microsoft.com/dotnet/sdk:10.0.100 AS build
|
||||
|
||||
ARG BUILD_CONFIGURATION=Release
|
||||
|
||||
WORKDIR /src
|
||||
|
||||
# Restore NuGet packages (keeping this section separate from the rest of the project files allows Docker to cache the restored packages).
|
||||
COPY ["AssemblyInfo_Shared.cs", "."]
|
||||
COPY ["Nemera.Presentation.Web/Nemera.Presentation.Web.csproj", "Nemera.Presentation.Web/"]
|
||||
COPY ["Directory.Build.props", "."]
|
||||
COPY ["Directory.Packages.props", "."]
|
||||
COPY ["global.json", "."]
|
||||
COPY ["src/AssemblyInfo_Shared.cs", "src/"]
|
||||
COPY ["src/Directory.Build.props", "src/"]
|
||||
COPY ["src/Nemera.Presentation.Web/Nemera.Presentation.Web.csproj", "src/Nemera.Presentation.Web/"]
|
||||
|
||||
RUN dotnet restore "./Nemera.Presentation.Web/Nemera.Presentation.Web.csproj" /p:BaseOutputPath=/app/publish/
|
||||
RUN dotnet restore "./src/Nemera.Presentation.Web/Nemera.Presentation.Web.csproj" /p:BaseOutputPath=/app/publish/
|
||||
|
||||
# Build the project.
|
||||
COPY ["Nemera.Presentation.Web/", "Nemera.Presentation.Web/"]
|
||||
COPY . .
|
||||
WORKDIR /src/Nemera.Presentation.Web
|
||||
COPY ["src/", "src/"]
|
||||
WORKDIR /src/src/Nemera.Presentation.Web
|
||||
|
||||
RUN dotnet build "./Nemera.Presentation.Web.csproj" -c $BUILD_CONFIGURATION -o /app/build /p:BaseOutputPath=/app/publish/
|
||||
|
||||
@@ -43,7 +46,7 @@ FROM base AS final
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
COPY --from=publish /app/publish .
|
||||
COPY --from=publish --chown=app:app /app/publish .
|
||||
# The HTTP port is controlled per run mode: launchSettings.json for local development, ASPNETCORE_HTTP_PORTS here for
|
||||
# Docker, and for a published DLL run directly on a host, ASPNETCORE_URLS (or ASPNETCORE_HTTP_PORTS) must be set.
|
||||
ENV ASPNETCORE_HTTP_PORTS=5012
|
||||
@@ -51,4 +54,4 @@ EXPOSE 5012
|
||||
ENTRYPOINT ["dotnet", "Nemera.Presentation.Web.dll"]
|
||||
|
||||
# To build this Docker image, run the following command from the root of the project (location of the .slnx solution file):
|
||||
# docker build --no-cache -t nemera-web -f Nemera.Presentation.Web/Dockerfile .
|
||||
# docker build --no-cache -t nemera-web -f src/Nemera.Presentation.Web/Dockerfile .
|
||||
@@ -0,0 +1,19 @@
|
||||
# This image ships the published release artifacts, so the image contents are the same files the release workflow exported.
|
||||
# Build it with the published Web directory as the context:
|
||||
# docker build -t nemera-web -f src/Nemera.Presentation.Web/Dockerfile.release bin/web/publish
|
||||
FROM mcr.microsoft.com/dotnet/aspnet:10.0 AS final
|
||||
|
||||
# Curl is used by the container healthcheck to probe the /health endpoints.
|
||||
RUN apt-get update \
|
||||
&& apt-get install -y --no-install-recommends curl \
|
||||
&& rm -rf /var/lib/apt/lists/* \
|
||||
&& mkdir /logs && chown -R app:app /logs
|
||||
|
||||
USER app
|
||||
WORKDIR /app
|
||||
|
||||
COPY --chown=app:app . .
|
||||
|
||||
ENV ASPNETCORE_HTTP_PORTS=5012
|
||||
EXPOSE 5012
|
||||
ENTRYPOINT ["dotnet", "Nemera.Presentation.Web.dll"]
|
||||
@@ -3,7 +3,7 @@
|
||||
<TargetFramework>net10.0</TargetFramework>
|
||||
<Nullable>enable</Nullable>
|
||||
<ImplicitUsings>disable</ImplicitUsings>
|
||||
<BaseOutputPath>$(SolutionDir)..\bin\web\</BaseOutputPath>
|
||||
<BaseOutputPath>$(RepoRoot)bin/web/</BaseOutputPath>
|
||||
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
|
||||
<WarningsNotAsErrors>$(WarningsNotAsErrors);EXTEXP0018</WarningsNotAsErrors>
|
||||
<UserSecretsId>10a94da9-18ed-4c70-a9da-b461e08958c4</UserSecretsId>
|
||||
|
||||
@@ -2516,3 +2516,17 @@ html.audio-player-initializing .audio-player-container {
|
||||
animation: none;
|
||||
}
|
||||
}
|
||||
|
||||
/* Informational badge for a loaded bundled plugin whose binary matches the release trust list. */
|
||||
.plugin-official-badge {
|
||||
display: inline-block;
|
||||
margin-left: 0.4rem;
|
||||
padding: 0 0.35rem;
|
||||
border: 1px solid currentColor;
|
||||
border-radius: 2px;
|
||||
font-size: 0.7em;
|
||||
line-height: 1.4;
|
||||
letter-spacing: 0.05em;
|
||||
text-transform: uppercase;
|
||||
vertical-align: middle;
|
||||
}
|
||||
Reference in new issue
Block a user