Skip to content

!!! Reworking the Paper download to work with their new API endpoint #42

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

cyberops7
Copy link

@cyberops7 cyberops7 commented Jan 1, 2025

Fixes #40

Reworking the Paper server download to work with their new API endpoint. This includes cleaning up the version extraction from the JSON response by using jq.

Adding jq to the Dockerfiles to support this.

Also adding vim to the Dockerfiles so that users have a choice between nano and vim.

Tested locally with a version with a stable build:

❯ ./test.sh 1.21.3
Testing version: 1.21.3
Latest paperclip build found: 82 (stable)
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 48.5M  100 48.5M    0     0  28.5M      0  0:00:01  0:00:01 --:--:-- 28.4M
paperclip.jar

and a version with only an experimental build:

❯ ./test.sh 1.21.4
Testing version: 1.21.4
Unable to retrieve latest Paper build (got result of 0).  Retrying the experimental channel for version 1.21.4
Latest paperclip build found: 70 (experimental)
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 48.9M  100 48.9M    0     0  36.5M      0  0:00:01  0:00:01 --:--:-- 36.5M
paperclip.jar

… This includes cleaning up the version extraction from the JSON response by using jq. Adding jq to the Dockerfiles to support this. Also adding vim to the Dockerfiles so that users have a choice between nano and vim.
@cyberops7
Copy link
Author

This could be consolidated quite a bit, as well as other parts of the script with how it handles things like $QuietCurl, but I figured I'd keep this PR as consistent as possible with the current script structure to limit the changes. I can submit another PR implementing those later once this more important fix is in place.

@cyberops7
Copy link
Author

I built this locally, pushed to my internal registry, and updated one of my test servers to use this test image. It successfully downloaded the experimental 1.21.4 build:

...
Updating to most recent paperclip version ...
Unable to retrieve latest Paper build (got result of 0).  Retrying the experimental channel for version 1.21.4
Latest paperclip build found: 70 (experimental)
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 48.9M  100 48.9M    0     0  48.3M      0  0:00:01  0:00:01 --:--:-- 48.4M
Updating Floodgate...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
100 10.9M  100 10.9M    0     0  17.6M      0 --:--:-- --:--:-- --:--:-- 17.6M
Updating Geyser...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
100 20.9M  100 20.9M    0     0  20.3M      0  0:00:01  0:00:01 --:--:-- 20.3M
Updating ViaVersion...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 4877k  100 4877k    0     0  2840k      0  0:00:01  0:00:01 --:--:-- 2840k
Starting Minecraft server...
...

@jczinger
Copy link

jczinger commented Jan 2, 2025

@TheRemote - Any chance we could get this pulled in?

@cyberops7
Copy link
Author

I do have a slicker version of this that I'm including in another PR I'm working on to overhaul a fair bit of the start.sh script, but I wanted to keep this like more of a targeted hotfix that could get out quickly with minimal review required.

@cyberops7 cyberops7 changed the title Reworking the Paperclip download to work with their new API endpoint !!! Reworking the Paperclip download to work with their new API endpoint Jan 4, 2025
@cyberops7 cyberops7 changed the title !!! Reworking the Paperclip download to work with their new API endpoint !!! Reworking the Paper download to work with their new API endpoint Jan 4, 2025
@blindway
Copy link

Waiting on this fix to be able to run my fresh install of the server.
Please have a look.

@cyberops7
Copy link
Author

fresh

While we wait, for a fresh install you could manually download the jar file and place it in the minecraft directory in your container’s volume mount, then start it up and it should work.

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.

PaperMC downloads are broken
3 participants