fix: supply IDP login media assets for no-npm (rolling) builds#23
fix: supply IDP login media assets for no-npm (rolling) builds#23DeepDiver1975 wants to merge 1 commit into
Conversation
The upstream "service/idp no-npm" rewrite (owncloud/ocis da7ef6050, OCISDEV-696, #12086) replaced the IDP React SPA with a server-rendered login page and a static theme.css. That theme.css references a favicon plus media assets — a background image and the Inter web fonts — which the commit never committed and provides no build step to generate. The IDP assets are embedded into the binary via `//go:embed assets/*`, so on master/rolling builds these files are missing and the login page serves 404s for the favicon, background, and font. Release tags (e.g. 8.0.5) are unaffected: they still build the React SPA via `pnpm build` and serve a complete asset set. Supply the missing files in the no-npm branch of the node-builder stage: the favicon from owncloud/assets (matching the pnpm path) and the media files recovered from the pre-no-npm parent commit, written to assets/identifier/static/media/ at the exact (webpack-hashed) names theme.css references. Verified the assets land at the expected embed paths with byte sizes matching the originals. This is a workaround pinned to a historical upstream commit; remove it once upstream ships the media assets. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Signed-off-by: Thomas Müller <1005065+DeepDiver1975@users.noreply.github.com>
DeepDiver1975
left a comment
There was a problem hiding this comment.
🤖 Automated review by Claude Code review agent.
Verdict: approve. This correctly supplies the IDP login media assets that the no-npm upstream layout fails to ship, and I verified the mechanics end-to-end.
Correctness (verified):
- The three pinned media URLs all resolve and the byte sizes match the PR body exactly:
background.jpg→ 200/88069,inter.woff2→ 200/21624,inter.ttf→ 200/803384 (@02395858…, commit confirmed present upstream). theme.csson currentmasterreferences exactlymedia/background.7296b9ab..jpg,media/inter.d5c51099..woff2,media/inter.aadb65ac..ttf— so the (intentional double-dot, webpack-mangled) output names atDockerfile.multiarch:36,38,40match the referenced names precisely.- No silent-failure risk: every fetch uses
curl -fsSL(non-2xx → non-zero exit) chained with&&, so a missing asset aborts theRUNlayer rather than baking a broken image (:30-40). - The favicon fetch in the
elsebranch (:32-33) mirrors the pnpm branch (:27-28) — same source, no duplication/conflict since the two branches are mutually exclusive ([ -f package.json ]). - Embed→serve path is already proven by the live-200
theme.css/logo.svgfrom the same tree, so build-time presence is sufficient.
Reproducibility: the media is pinned to an immutable commit via ARG IDP_MEDIA_REF (:22,34) — good, non-latest. The favicon still tracks owncloud/assets@main (:32), but that mirrors the pre-existing pnpm-path convention (:27), so it's consistent rather than a regression introduced here.
Conventions: comment block (:13-21) clearly documents the workaround, its upstream cause (OCISDEV-696 / da7ef6050), and the removal condition — matches the existing in-file documentation style. Worth filing the upstream owncloud/ocis issue mentioned in the PR note so this workaround can be retired.
CHANGELOG: n/a — Dockerfile/build fix, following this repo's established convention (build fixes #16–#19 added no CHANGELOG.md entry). The diff does not touch CHANGELOG.md.
Checks: all build/lint checks green (amd64 + arm64 across both 8.0.5 and rolling matrices, lint, lint-editorconfig). mergeStateStatus=BLOCKED reflects the pending required review, not a failing check.
|
Closing this in favour of the upstream fix owncloud/ocis#12462 ("fix: service idp assets"). On reassessment, the missing IDP login assets are a problem that belongs upstream, not in this Docker build. #12462 fixes the real root cause: the parent Because the IDP assets are embedded via |
|
owncloud/ocis#12462 was merged upstream |
Problem
The IDP login UI on
owncloud/ocis-rolling:latestrenders without its favicon, background image, and Inter font.I pulled the latest rolling image, ran it (
ocis init+ocis server), and checked the login page (/signin/v1/identifier/) by asserting every referenced asset resolves:theme.css,logo.svgfavicon.icomedia/background.7296b9ab..jpgmedia/inter.d5c51099..woff2(font)media/inter.aadb65ac..ttf(font)Root cause
Upstream oCIS commit
da7ef6050("service/idp no-npm", OCISDEV-696, #12086) replaced the IDP React SPA with a server-rendered login page and a statictheme.css. Thattheme.cssreferences a favicon plus media assets (background + Inter web fonts, with mangled double-dot webpack hashes) that the commit never committed and provides no build step to generate. The IDP assets are embedded via//go:embed assets/*(services/idp/idp.go), so on master/rolling builds these files are simply missing → 404.Our Dockerfile's no-npm
elsebranch correctly skipspnpm build, but as a side effect also skipped the favicon fetch, and there was never anything supplying the media.Release tags (e.g.
8.0.5) are unaffected — they still build the React SPA viapnpm buildand serve a complete asset set from/signin/v1/static/(verified: all 200).Fix
In the no-npm branch of the
node-builderstage, fetch the missing files:owncloud/assets(matching the pnpm path)background.jpg,inter.woff2,inter.ttf) recovered from the pre-no-npm parent commit0239585…, written toassets/identifier/static/media/at the exact namestheme.cssreferences.Verification
Built the
node-buildertarget from this branch against current master and confirmed all four assets land at the expected embed paths with byte sizes matching the originals (favicon, bg 88069, woff2 21624, ttf 803384). The embed→serve path is already proven (the existingtheme.css/logo.svgserve 200 from the same tree on the live rolling container), so files present at build time will serve 200.Note
This is a workaround pinned to a historical upstream commit. It should be removed once upstream ships the media assets (worth filing against
owncloud/ocis).🤖 Generated with Claude Code