Skip to content

feat: fetch display files pinned by hash, with limits - #64

Merged
fogrew merged 2 commits into
release/3.0.0from
feature/display-files
Oct 27, 2026
Merged

fogrew merged 2 commits into
release/3.0.0from
feature/display-files

Conversation

@fogrew

@fogrew fogrew commented Oct 27, 2026

Copy link
Copy Markdown
Member

What

The fetch-and-verify layer for everything a profile shows, in Launcher.Core, with no UI yet:

  • RegistryEntry gains Theme, About and Terms (language to path), and the index reader requires each path to be a safe relative path that is also pinned in digests. Changelog is the conventional changelog.md when pinned.
  • DisplayFiles requests a path only if the entry pins it, tries the mirrors in order, and uses the bytes only if they hash to the pinned SHA-256 and fit the file's limit (enforced while reading, and again on the result). A failure is returned as a problem, not thrown.
  • DisplayFileCache keeps verified files under their digest; a stored file is hashed again on every read.
  • ImageInspector reads format and pixel size from the header, so an oversized or animated picture is turned away before anything decodes it. Rules: logo PNG 256 KiB and 512 x 512; art PNG or JPEG 1 MiB and 1920 x 1080.
  • ThemeLoader loads theme.json and its pictures; a picture that fails becomes the default and the rest of the theme stays. A picture both schemes name is fetched once.
  • HttpRegistryFetcher takes a limit per call (IDisplayFileFetcher); the registry index still uses its 1 MiB.

Docs: a "Display files" section in registry-format.md; the changelog limit (64 KiB) is new and is added to server-page.md.

Notes

The decoded size is still checked by the UI when it builds the bitmap (#24); this layer makes sure nothing oversized or unpinned gets that far.

Tests

46 new tests (Launcher.Tests is now 402).

Closes #26

🤖 Generated with Claude Code

fogrew and others added 2 commits October 27, 2026 12:25
Registry entries gain the optional theme, about and terms paths; each must
be pinned in digests. DisplayFiles fetches a pinned file only, tries the
mirrors in order, and uses it only if the bytes hash to the pinned SHA-256
and fit the file's limit. A verified file may be kept under its digest and
is hashed again on every read.

Pictures are judged from their header before anything decodes them:
format, pixel size and, for a PNG, that it is not animated. ThemeLoader
loads a theme with its pictures and replaces what fails a check with the
default, keeping the rest of the theme.

Closes #26

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@fogrew
fogrew merged commit e697e71 into release/3.0.0 Oct 27, 2026
2 checks passed
@fogrew
fogrew deleted the feature/display-files branch October 27, 2026 10:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant