Skip to content
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

Fix: eliminated hardcoded URL for custom versions #468

Merged
merged 2 commits into from
Oct 18, 2024

Conversation

thedhruvn
Copy link
Contributor

Old behavior: Custom versions used hardcoded download URL. this URL should be dynamically sourced using the lookupVersion command instead.

New behavior: lookupVersion takes a second parameter, version, and uses a simple sed replace to insert the version parameter into the download URL dynamically, if it was successfully found.

Also, removed old bedrock version shortcuts. This can be restored and modified to use the lookupVersion command to get the right URL if needed. It's unclear whether there's any active servers still running on legacy versions of bedrock (to this author).

Resolves #460

Old behavior: Custom versions used hardcoded download URL. this URL
should be dynamically sourced using the lookupVersion command instead.

New behavior: lookupVersion takes a second parameter, version, and
uses a simple sed replace to insert the version parameter into the
download URL dynamically, if it was successfully found.

Also, removed old bedrock version shortcuts. This can be restored and
modified to use the lookupVersion command to get the right URL if
needed. It's unclear whether there's any active servers still running
on legacy versions of bedrock (to this author).

Resolves itzg#460
Copy link
Owner

@itzg itzg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

I like the overall idea of what you're doing.

However, I'm still undecided if the changes (other than old version cleanup) are needed since Microsoft seems to have corrected the one-off version location.

bedrock-entry.sh Show resolved Hide resolved
bedrock-entry.sh Outdated Show resolved Hide resolved
@thedhruvn
Copy link
Contributor Author

Thanks!

I like the overall idea of what you're doing.

However, I'm still undecided if the changes (other than old version cleanup) are needed since Microsoft seems to have corrected the one-off version location.

I don't love hard-coded URLs in general - my suggestion would be to adopt this so we follow the once and only once principle in managing constants.

@itzg
Copy link
Owner

itzg commented Oct 8, 2024

That's fair. Let's see how the preview support looks.

Old behavior: custom version only supported versioning for non-preview
releases.
New behavior: custom version can look up custom preview versions and
custom release versions based on the value of the PREVIEW flag.
bedrock-entry.sh Show resolved Hide resolved
Copy link
Owner

@itzg itzg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These all worked correctly:

docker run -it --rm -e EULA=true -e VERSION=PREVIEW itzg/minecraft-bedrock-server
docker run -it --rm -e EULA=true -e VERSION=1.21.50.24 -e PREVIEW=true itzg/minecraft-bedrock-server
docker run -it --rm -e EULA=true -e VERSION=LATEST itzg/minecraft-bedrock-server
docker run -it --rm -e EULA=true -e VERSION=1.21.31.04 itzg/minecraft-bedrock-server

@itzg itzg merged commit dfadf93 into itzg:master Oct 18, 2024
1 check passed
@itzg itzg added the enhancement New feature or request label Oct 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Download URL
2 participants