Repository navigation
feat: add modpack sources and harden build key handling - #45
Merged
Merged
Conversation
…odpacks Implements the four-track plan. Shop sources (A): manage mod-shop scripts (import/remove/permissions) from the Scripts page, alongside providers/parsers/automation. Typed script config (B): ConfigOption/ScriptConfig proto + GetConfig/SetConfig on all four script services; engine ConfigStore + meta.config validation + ctx.config injection; a Configure dialog on each script card (secrets are write-only). Mod compatibility (C): new engine compat package (loader-family + Fabric/Maven version-range matching) sets ModFile.Compat; builtin parsers emit game versions/range; installed-mod and shop-version compat badges in the app. FTB modpacks (D): ModKind.MODPACK + ProviderCapabilities.hidden/ free_form_versions + Server.loader; an ftb shop (browse) and a hidden ftb provider (installs a pack as a whole server, resolving CurseForge-hosted files via the shared key); a modpack Create-server flow in the Mod Shop. LaunchSpec now carries mc_version/loader so a modpack resolves its concrete version at install. Contract-first: proto edits regenerated on both sides. Verified: engine go build/vet + 274 unit tests; app build (0 warnings) + 5 Core integration tests. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- introduce ShopContext.ForModpackBrowsing with CreateServer callback to start whole-server installs via the main window's global install flow - update ShopDetailViewModel to hand modpack create requests to CreateServer and show a "creation started" status - filter available shops by context (server-scoped vs global) and surface a "no sources" status when none are visible - add home-page button, ShopWindow title variant, and localization entries for the modpack shop - remove ServerCreated event and handler; rely on the global install flow for new-server creation tracking
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
ftb.lua echoes the opaque packId/versionId back as pack_version on the launch spec; the engine stores it (new provider_version SQLite column with migration) and returns it on the Server proto so the app can offer update/export for modpack servers. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Worker pool (default 6, cap 16) over errgroup; items carry a direct url or a resolve endpoint (CurseForge download-url convention) resolved inside the worker, so CF API round-trips parallelize too. First error cancels the batch; progress is per-file completion with serialized emission. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
provider.Updater interface + ErrUpdateUnsupported sentinel; the Lua host shares ctx-table construction and spec parsing between install() and update(), which additionally receives ctx.old_version. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Streams progress like Create; requires a stopped modpack server; failure restores STOPPED and leaves the existing install untouched. Empty spec.Args from update() keeps the server's current launch args. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
manifest.json lists every CF-hosted file including client-only mods; the server's live config dirs and hand-added mods go into overrides/; client-only direct-URL files are downloaded at export time. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Server header flyout gains Update/Export modpack items (modpack servers only; update requires the server stopped). Both stream through the global per-server progress tracker: update picks a version fetched from the shop and refreshes the list on completion; export saves a CurseForge client pack zip via a file picker. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Live export against the real API failed with a JSON unmarshal error: the manifest's curseforge.project/file are numeric strings, not numbers. Accept both via flexInt64 and skip zero ids. Adds an opt-in live-export diagnostic test (JHMC_LIVE_EXPORT_DIR/_PACK). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
New server from a local CurseForge client pack zip or Modrinth .mrpack, streaming install progress like Create. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Extract the loader-install steps (fabric/forge/neoforge) and the file
download/diff bookkeeping out of ftb.lua into a shared `mplib` module,
loaded into every script sandbox by prepare(). New providers (CurseForge,
Modrinth, import) build on it instead of copying ~140 lines.
Add a {prefix=...} option to jhmc.unzip so a pack's overrides/ tree can be
splatted into the server root, and have ftb.lua persist a normalized
.jhmc/modpack.json at install/update so export and update work without
re-fetching the upstream source.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Export now reads the server's normalized .jhmc/modpack.json when present, building the CurseForge client zip from it instead of re-fetching the FTB API. This makes Export work for every modpack provider (CurseForge, Modrinth, imported) and offline; the FTB-API path stays as a fallback for legacy FTB servers installed before manifests were persisted. Relax the ExportModpack RPC gate from FTB-only to any modpack server. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Add a browseable CurseForge modpack shop (classId 4471) and a hidden provider that installs a pack from its client manifest: download the pack zip, resolve every listed mod's name/hash/url via the batch files endpoint, install the pinned loader, splat overrides/ into the server root, and persist the normalized manifest for export/update. The shared install and update routines live in mplib so the import provider can reuse them. All CurseForge sources share one API key, seeded from the CurseForge shop key. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Add a keyless Modrinth modpack shop (project_type:modpack) and a hidden provider that installs a pack from its .mrpack: download the mrpack, install the files modrinth.index.json lists (skipping env.server=="unsupported", which are kept as client_only for export fidelity), extract overrides/ then server-overrides/ (server wins), install the pinned loader, and persist the normalized manifest. Quilt packs are rejected with a clear message. The shared mrpack routines live in mplib for the import provider to reuse. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Add the ImportModpack handler: it validates the picked file, stages it into the new server dir at .jhmc/import.zip, and drives a hidden "import" provider that detects the format (CurseForge manifest.json or Modrinth modrinth.index.json) and reuses the shared mplib install routines. The create flow is factored into runCreate with a staging hook shared by Create and ImportModpack. Imported servers persist the normalized manifest (Export works) but have no update() (Update stays Unimplemented — a local file has no upstream to diff). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Add an Import button to the home header: it picks a .zip (CurseForge) or .mrpack (Modrinth) file, prompts for a server name (defaulted from the file name) and memory, and streams install progress through the shared new-server flow (InstallServerAsync and the new ImportModpackAsync now both route through RunNewServerInstallAsync). Imported servers show Export but not Update — the Update menu item hides when the provider id is "import". Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…mented A provider whose script has no update() (imported packs) returns provider.ErrUpdateUnsupported, which mapInstallError routed to Internal. Map it to codes.Unimplemented so it matches the non-Updater path in UpdateModpack. UI-unreachable today (the app hides Update for imports), but the status code is now correct. Add a regression test. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
000hen
marked this pull request as ready for review
July 18, 2026 14:27
- Make SelectedShopIsModpack derive from Context.Kind rather than merged shop capabilities - Read IsModpack in ShopDetailViewModel from SelectedShopIsModpack - Add ShopBrowsingContractTests to assert browse mode comes from context
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary / 摘要
masterWinUI design by moving new dialogs and finite UI states into XAML-owned localization resources.build.ps1, Visual Studio/MSBuild, and MSIX builds through one shared PowerShell implementation.The earlier obfuscation implementation did not cover every build entry point. This PR unifies those paths while retaining master's XAML-first resource architecture and fixing the lifecycle failures found during review.
XOR is obfuscation rather than cryptographic secrecy because the binary contains both cipher and pad. The embedded key must remain scoped and rotatable.
Testing / 測試
go test ./...(fromengine/) — 388 tests passed in 21 packagesdotnet test app/JustHostMC.Core.Tests/JustHostMC.Core.Tests.csproj— 35 tests passedgo vet ./...dotnet build app/JustHostMC.App/JustHostMC.App.csproj -p:Platform=x64— 0 errors, 0 warningsclang-format;git diff --checkpassesCheck code formattingworkflow — passedScreenshots / 螢幕截圖
No before/after screenshots were captured. UI changes were validated through the x64 WinUI build and resource/finite-state tests, but not through a manual visual test pass.
Checklist / 檢查清單
proto/changed. / 若修改了proto/,我已在本機重新產生 protobuf 輸出。