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

Đang mở
#3,455 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức phù hợp với người mới
25/100
Loại issue
Tính năng
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
csharp, docker, github-actions, nginx

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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.

Ngôn ngữ chính
C#
Star
567
Fork
107
Merge trung bình
1 giờ 19 phút
Pull request đã merge (30 ngày)
353

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của fluentcms/FluentCMS

Tất cả issue của fluentcms/FluentCMS

Issue tương tự

Thêm issue về C#

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.