Prebuilt static build of the admin on the release, with the hosting guide (A-43)

未关闭
#3,455 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
5/5
预计耗时
一周以上
新手友好度
25/100
Issue 类型
功能
描述清晰度
描述清楚
活跃度
活跃
技术栈
csharp, docker, github-actions, nginx

调研方向

Start with the release and CI workflows in .github/workflows/publish.yml and .github/workflows/ci.yml, then inspect the admin project settings and hosting sections of docs/planning/admin-technical-spec.md. Map the requested zip, hosting guide, and cross-origin end-to-end case to the acceptance list; done means all listed release, packaging, hosting, favicon, route, and notice checks pass. The issue spans release automation, hosting behavior, docs, and tests, so it is a substantial project effort.

由索引模型根据 Issue 内容生成。

描述

area:admin area:build type:feature

Problem

Decision 5 names three distributions of the admin, and the third, a prebuilt static build that any static host serves (section 6.3), does not exist:

  • Nothing publishes it. The Pack job of CI publishes FluentCMS.Admin.App trimmed into artifacts/admin for the size check and drops it (.github/workflows/ci.yml, step "Publish the admin trimmed"). The Publish workflow packs the NuGet packages, builds the image, and attaches the client's .tgz to the GitHub release when it is not on npm (.github/workflows/publish.yml); it never publishes the app.
  • The build is not ready to be edited. An operator of a static host edits config.json and the <base href> of index.html (6.3). The app keeps config.json out of the compression, so that no stale compressed copy is served (admin/src/FluentCMS.Admin.App/FluentCMS.Admin.App.csproj, line 16), and does not do the same for index.html. The sample config.json points at https://localhost:5001. Whether the publish writes index.html.br and index.html.gz was not checked on a build.
  • Nothing has run it from another origin. Section 6.4 names the two settings of the API host for an admin on another origin, and the end-to-end tests run the admin at /admin of the API host only.
  • No guide. docs/host-configuration.md lists the keys of FluentCms:Admin for the reference host, and no page says what a static host must do: the fallback, the caching, the headers of 6.1.
  • Two follow-ups meet here. Without faviconUrl the browser asks for /favicon.ico and logs a 404 on every first load, where section 2.5 promises a built-in one (#3178). A client route whose last segment has a dot answers 404 on reload from the hosting package, and each recipe of a static host has the same choice to make (#3178).

Proposal

  • The zip. The Publish workflow publishes the app at the version of the release and attaches fluentcms-admin-{version}.zip to the GitHub release: the wwwroot of the publish with the sample config.json, LICENSE, THIRD-PARTY-NOTICES.md and a short text that points to the guide. A dry run lists it among what a release pushes. The Pack job of CI makes the same zip on every full run and checks what it holds: one index.html with one <base href>, the sample config.json, no compressed copy of either, the Blazor script, the two notices.
  • A built-in favicon, used when faviconUrl is not set.
  • A run from another origin. An end-to-end case unzips the build, serves it from another origin and under a path with a static file server of the test project's own (the framework's static files, no new package), sets the two settings of 6.4 on the API host, and signs in, reads a list, shows an image through its signed URL and signs out.
  • docs/admin-hosting.md. What any host must do: answer index.html for a path that is no file, never cache index.html and config.json, cache the fingerprinted files for good, serve .wasm with its type and the compressed copies by Accept-Encoding, and send the headers of 6.1 with the Content-Security-Policy written out for an API on another origin; then the two settings of 6.4. Then a recipe for nginx, Caddy, Azure Static Web Apps, Amazon S3 with CloudFront and Cloudflare Pages. A recipe that was not run says so.
  • Routes with a dot. One rule for the hosting package and for every recipe, recorded in section 4.1: the fallback takes every path that is not under _framework/ or _content/ and has no known static extension, or the areas keep dots out of their last segment. The lane picks the one the recipes can all express.
  • The notices. The zip carries LICENSE and THIRD-PARTY-NOTICES.md as #3215, done beside the milestone, puts them in the published admin.

Acceptance

  • A dry run of Publish lists fluentcms-admin-{version}.zip, and the Pack job of CI builds it and fails when a file of the list above is missing or a compressed copy of index.html or config.json is there
  • The unzipped build, with config.json and <base href> edited, signs an editor in from another origin and under a path, reads a list and shows an image, in an end-to-end case
  • A first load without faviconUrl logs no 404
  • A reload of a client route whose last segment has a dot answers the app, from the hosting package and from the static server of the case, or the specification says why no route has one
  • docs/admin-hosting.md has the requirements and the five recipes, each marked as run or not run
  • The zip holds LICENSE and THIRD-PARTY-NOTICES.md
  • The items of #3178 on the favicon and on routes with a dot are ticked

Design: docs/planning/admin-technical-spec.md, sections 2.5, 6.1, 6.3, 6.4 and 10.8 (A-43). Decision 5. Takes two items of #3178, and builds on #3215. A-55, which takes the build inside the hosting package, needs it. Size: M.

主要语言
C#
星标
567
派生
107
平均合并
1 小时 19 分钟
30 天内合并 PR
353

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

fluentcms/FluentCMS 的其他 Issue

查看 fluentcms/FluentCMS 的全部 Issue

相似的 Issue

更多 C# Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。