Skip to content

[java/curseforge] Install script fixes and enhancements - #131

Open
vrrdnt wants to merge 3 commits into
pelican-eggs:mainfrom
vrrdnt:curseforge/install-script-fixes
Open

vrrdnt wants to merge 3 commits into
pelican-eggs:mainfrom
vrrdnt:curseforge/install-script-fixes

Conversation

@vrrdnt

@vrrdnt vrrdnt commented May 6, 2026 •

Copy link
Copy Markdown

Description

Fixes three install-script bugs in the CurseForge generic egg, plus one variable default cleanup.

May resolve:
#121
#127

Commits:

  1. [java/curseforge] Fix null/zero serverPackFileId crash on latest install -- Resolves [Install Bug]: Curseforge Generic #121. Adds select(. != null and . != 0) guards in two jq expressions so they stop emitting the literal strings "null" / "0" when CurseForge returns those for serverPackFileId.

  2. [java/curseforge] Extract download URL resolution into a helper -- Pure refactor. Consolidates three duplicated /v1/mods/{pid}/files/{fid}/download-url fetches into one cf_resolve_download_url helper. Same endpoint, auth, parsing, and empty-on-failure behavior.

  3. [java/curseforge] Surface clear error when API distribution is disabled -- When a project has allowModDistribution: false, /download-url returns 403 with no body. Replace the opaque "No download url found" message at all three call sites with a prominent block that names the cause (author has opted out of API distribution) and tells the user to download the pack manually. For json_download_mods, retain the existing continue behavior but warn loudly that the install will be incomplete. The egg deliberately does not bypass the flag by constructing edge.forgecdn.net URLs from fileId/fileName, as doing so would ignore the author's wishes and risk API key revocation.

  4. [java/curseforge] Default modpack File ID to blank -- Variable default change only. The script already treats "" and "latest" identically (both fall back to mainFileId); drop the magic-string default so users get newest-version behavior by leaving the field blank.

  5. [java/curseforge] Mirror fixes to pterodactyl egg variant -- The install script between the pelican egg and pterodactyl egg are identical, so the fixes were copied over to the pelican variant's install script.

Tested locally against a real Pelican panel install with several modpacks, including one with allowModDistribution: false (COBBLEVERSE - Pokemon Adventure [Cobblemon], project 1210677) to verify the new error path is reached and the message displays cleanly.

Checklist for all submissions

  • Have you followed the guidelines in our Contributing document?

  • Have you checked to ensure there aren't other open Pull Requests for the same update/change?

  • Have you tested and reviewed your changes with confidence that everything works?

  • Did you branch your changes and PR from that branch and not from your master branch?

  • You verify that the start command applied does not use a shell script

    • If some script is needed then it is part of a current yolk or a PR to add one
  • The egg was exported from the panel

@vrrdnt

vrrdnt commented May 23, 2026

Copy link
Copy Markdown
Author

Is anyone available to give this a review?

@QuintenQVD0
QuintenQVD0 requested a review from parkervcp May 28, 2026 16:20
@vrrdnt vrrdnt closed this Aug 1, 2026
@parkervcp

Copy link
Copy Markdown
Contributor

@vrrdnt I apologize that wasn't reviewed. I have been extremely busy in my personal life for the last 4-ish months. I can review this over this weekend.

@vrrdnt

vrrdnt commented Aug 4, 2026

Copy link
Copy Markdown
Author

No worries at all -- please take your time.

I’ve added two commits based on recently reported issues:

@parkervcp

Copy link
Copy Markdown
Contributor

I have requested the reporters of the issues you said this may resolve. I will give it a look as well.

vrrdnt added a commit to vrrdnt/minecraft that referenced this pull request Sep 17, 2026
Revert the five files introduced by edcb7a1: the CurseForge GitHub Actions workflow, Docker test image, test documentation, installer fixtures, and HTTP tests. These additions were not intended to be part of PR pelican-eggs#131.

Preserve all installer and egg documentation changes. Verified the staged tree exactly matches 28eb4f8, the commit immediately before the test additions, and git diff --cached --check passes. No runtime tests were run because this change only removes the unintended test infrastructure.
@vrrdnt
vrrdnt force-pushed the curseforge/install-script-fixes branch from 7c7edf5 to 58a5c8a Compare September 29, 2026 04:48
@vrrdnt

vrrdnt commented Sep 29, 2026 •

Copy link
Copy Markdown
Author

I've tried to clean this PR up into two commits, since it became a mess. The first converts the original Pelican egg to YAML for improved readability, and the second applies the existing fixes. 58a5c8a should be easier to review since it shows the installer changes separately from the format conversion. The Pterodactyl egg is still JSON.

The changes cover:

  • Handling missing or zero server-pack IDs instead of treating them as valid IDs.
  • Authenticating CurseForge CDN downloads and reporting download failures more clearly. Disabled distribution is only reported when the project metadata confirms it.
  • Supporting uploaded server.zip files containing a CurseForge manifest, including one exported by Packwiz, or a prepared server. Native pack.toml files aren’t supported.
  • Failing the install if a required mod can’t be downloaded, rather than reporting success with an incomplete pack.
  • Checking for usable startup files before reporting success.
  • Preserving the full loader version, including suffixes, and rejecting unsupported loaders.
  • Using the overrides directory specified in the manifest and copying hidden files too.
  • Leaving the modpack File ID blank by default to select the latest version.

While testing these changes (post-YAML-conversion) using StoneBlock 4, I found that failed client manifest extraction needed a more readable error. Its server ZIP only contains scripts for downloading FTB’s own installer, so it can’t be installed by this egg. It now stops with a clear message pointing to the FTB egg, instead of continuing into mv and jq errors.

I’ve tested the new YAML egg on my Pelican panel using AllTheMods 10 (latest), and installation completed successfully.

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.

[Install Bug]: Curseforge Generic

2 participants