-
-
Notifications
You must be signed in to change notification settings - Fork 225
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
Conversation
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
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.
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. |
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.
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.
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
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