Repository navigation
fix(server): baixa Paper via API fill v3 (v2 sunset -> jar corrompido) #6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -32,7 +32,8 @@ if exist "%PAPER_JAR%" ( | |
| echo [WARN] %PAPER_JAR% ja existe. Pulando download. | ||
| ) else ( | ||
| echo [INFO] Baixando Paper %PAPER_VERSION%... | ||
| powershell -Command "Invoke-WebRequest -Uri 'https://api.papermc.io/v2/projects/paper/versions/%PAPER_VERSION%/builds/latest/downloads/paper-%PAPER_VERSION%.jar' -OutFile '%PAPER_JAR%'" | ||
| REM A API v2 foi DESCONTINUADA (sunset). Usamos a API fill v3 para obter a URL real. | ||
| powershell -Command "$meta = Invoke-RestMethod -Uri 'https://fill.papermc.io/v3/projects/paper/versions/%PAPER_VERSION%/builds/latest'; Invoke-WebRequest -Uri $meta.downloads.'server:default'.url -OutFile '%PAPER_JAR%'" | ||
|
Comment on lines
+35
to
+36
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🔒 Security & Privacy | 🟠 Major | ⚡ Quick win 🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -euo pipefail
printf '--- scripts/setup.bat ---\n'
nl -ba scripts/setup.bat | sed -n '1,120p'
printf '\n--- search for sha256 / fill / papermc in repo ---\n'
rg -n "sha256|fill\.papermc\.io|papermc\.io|Invoke-RestMethod|Invoke-WebRequest" -S .Repository: oTalentz/plugin-minecraft-2026 Length of output: 259 🌐 Web query:
💡 Result: PaperMC's download service, now referred to as Fill v3, serves as the successor to the previous Bibliothek (v2) API [1][2]. All automated tools, scripts, and server hosts must migrate to the new Citations:
🌐 Web query:
💡 Result: The term "server:default" appears as a specific key used within the PaperMC Downloads Service API [1]. It is utilized when querying for the download information of a project build (such as Paper) to specify which artifact download should be returned [1]. In the context of the PaperMC Downloads Service GraphQL API, when you request the Citations: 🏁 Script executed: #!/bin/bash
set -euo pipefail
nl -ba scripts/setup.bat | sed -n '1,120p'
printf '\n--- matches ---\n'
rg -n "sha256|fill\.papermc\.io|papermc\.io|Invoke-RestMethod|Invoke-WebRequest" -S .Repository: oTalentz/plugin-minecraft-2026 Length of output: 208 Compare the downloaded JAR to Fill’s 🤖 Prompt for AI AgentsSource: MCP tools |
||
| echo [OK] Paper baixado. | ||
| ) | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔒 Security & Privacy | 🟠 Major | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
Repository: oTalentz/plugin-minecraft-2026
Length of output: 275
🌐 Web query:
PaperMC fill v3 downloads server:default checksums sha256 documentation💡 Result:
PaperMC has transitioned to a new download service named Fill (formerly Bibliothek), which uses the v3 API [1]. This service is hosted at fill.papermc.io [2][1]. Unlike previous versions, you should no longer manually construct download URLs; instead, you retrieve them directly from the API responses [1][3]. Key Technical Details for Fill v3: Base URL: All requests should be made to https://fill.papermc.io [2][1]. Downloads and Checksums: In the v3 API, download information—including the SHA256 checksum and the direct download URL—is embedded directly within the build object [4][3]. The primary download key for the server JAR is server:default [2][4][1]. API Response Structure: A typical build response includes a downloads object containing the server:default entry. This entry provides the following fields [4]: name: The filename (e.g., paper-1.21.8-56.jar) [4] url: The absolute URL to the binary, hosted at fill-data.papermc.io [4][1] checksums: An object containing the sha256 hash string [2][4] size: The size of the file in bytes [4] Implementation Notes: User-Agent: It is required to provide a descriptive User-Agent header when making requests to the Fill v3 API [5][3]. GraphQL: An experimental GraphQL API is also available for more complex queries at https://fill.papermc.io/graphql [2][1]. Deprecated API: The older v1/v2 API at api.papermc.io has been sunset and should no longer be used [1][3]. For detailed interactive documentation and schema exploration, you can access the Swagger UI documentation typically provided by the service [1]. Always ensure your scripts resolve the download URL dynamically from the JSON response rather than using hardcoded paths [1][3].
Citations:
🏁 Script executed:
Repository: oTalentz/plugin-minecraft-2026
Length of output: 317
🏁 Script executed:
Repository: oTalentz/plugin-minecraft-2026
Length of output: 208
🏁 Script executed:
Repository: oTalentz/plugin-minecraft-2026
Length of output: 7636
Verify the Paper JAR digest before using it.
Dockerfile#L27-L31:unzip -tqqonly checks archive structure; compare the downloaded JAR againstdownloads."server:default".checksums.sha256before accepting it.scripts/setup.bat#L35-L36: add the same SHA-256 check before the downloaded JAR is used.📍 Affects 2 files
Dockerfile#L27-L31(this comment)scripts/setup.bat#L35-L36🤖 Prompt for AI Agents
Source: MCP tools