Skip to content

feature: Add curseforge support as curserinth has 20 item limit and unmaintained - #136

Merged
deniz-blue merged 1 commit into
deniz-blue:mainfrom
hinshun:feature/curseforge
Dec 28, 2025
Merged

feature: Add curseforge support as curserinth has 20 item limit and unmaintained#136
deniz-blue merged 1 commit into
deniz-blue:mainfrom
hinshun:feature/curseforge

Conversation

@hinshun

@hinshun hinshun commented Dec 28, 2025

Copy link
Copy Markdown
Contributor

I'm new to Minecraft modding and not sure if there's politics or policies involved why we can't implement Curseforge. Let me know, I used the API key that Curserinth is using.

I introduced an env var to switch to curseforge:

MCMAN_USE_CURSEFORGE=1 CURSEFORGE_API_KEY=<redacted> mcman init --packwiz https://asphodel.cc/packwiz/Ports/Curse/Raspberry-Server/pack.toml

I'm having trouble mcman build for Raspberry Flavoured which includes a mod of an older MC version. Curserinth limits at 20 items in their implementation: https://github.com/kuylar/curserinth/blob/7fbc142484ca9ca178bfa44dfc6658cd767c2370/CurseRinth/Controllers/V2/VersionsController.cs#L36

If there's no issues, maybe we should just default to the curseforge implementation and keep curserinth.rs around for backwards compatibility (and remove the MCMAN_USE_CURSEFORGE env var).

So this will fail:

# server.toml
name = "Test"
mc_version = "1.19.2"

[jar]
type = "forge"
loader = "43.5.1"

[[mods]]
type = "curserinth"
id = "60028"
version = "5320128"

But this will succeed with this PR:

# server.toml - same as above but with:
[[mods]]
type = "curseforge"
id = "60028"
version = "5320128"

@hinshun

hinshun commented Dec 28, 2025

Copy link
Copy Markdown
Contributor Author

Note this PR needs to be revised if #135 lands first.

Comment thread src/sources/curseforge.rs
@deniz-blue

Copy link
Copy Markdown
Owner

I'm new to Minecraft modding and not sure if there's politics or policies involved why we can't implement Curseforge. Let me know, I used the API key that Curserinth is using.

I asked @kuylar and she said the API key is... from the CurseForge App. If we use it we will most likely violate their ToS.
The API key should be settable through an environment variable at the very least.
Should I apply for an API key for mcman? I'm not really sure
The current API key might also be bypassing the "Project Distribution Toggle" which is an opt-in feature for mod devs who dont want third party apps to download their files

@kuylar

kuylar commented Dec 28, 2025

Copy link
Copy Markdown

Should I apply for an API key for mcman?

Last time I checked you'd be waiting for months to get an API key, if you ever get a response at all. I don't know if this has changed however, I haven't touched CF in 2 years.

If it was me, I would get an API key from CF (hopefully) but allow overrides through an environment variable or a local file.

Regarding why CR had a hardcoded 20 versison limit: Modrinth's API doesn't have pagination in the project versions endpoint (docs), so my options were to either
a. Spam the CurseForge API until I got a list of all the verisions (could have to do 200 requests maximum, bad idea!!!)
b. Only return the maximum amount of versions I can get from a project (Apparently the limit was 50, I'm not sure why I used 20 there)

Though, looks like Modrinth has added game version & loader type filters in their version listing endpoint (still no pagination! john modrinth, please...) so I may end up throwing a small patch to add that to CR

re: why i had the api key in my code but telling others not to have it: the file the key was in (launchSettings.json) was NEVER meant to be committed and i have force pushed a version without the file. this is the third time this happened and i blame rider for forcing me to edit that god damned file to add an environment variable

@hinshun

hinshun commented Dec 28, 2025

Copy link
Copy Markdown
Contributor Author

I revised after #135 merged to update with BTreeMap. I redacted the curseforge API key and introduced reading from env CURSEFORGE_API_KEY.

@deniz-blue

Copy link
Copy Markdown
Owner

lgtm

@deniz-blue
deniz-blue merged commit 0e3bef5 into deniz-blue:main Dec 28, 2025
3 checks passed
@hinshun
hinshun deleted the feature/curseforge branch December 28, 2025 23:25
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.

3 participants