packwiz: re-load LOAD_ENV_FROM_FILE after the installer runs#4137
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #4074.
When
PACKWIZ_URLandLOAD_ENV_FROM_FILEare both set, the container sources the env file before packwiz writes it.start-configurationloads it during the configuration stage, before the deploy is dispatched. The packwiz installer runs later, instart-setupModpack, and writes pack files into/data, including any.envthe pack ships. By that point the container has already sourced the previous file, or no file at all on a first run, so the pack's values never reach the rest of startup.The fix re-runs
loadEnvFromFileinsidehandlePackwizonce the installer succeeds, guarded onLOAD_ENV_FROM_FILEbeing set.start-setupModpackalready sourcesstart-utils, so the helper is in scope. The early load stays where it is, soTYPEandVERSIONstill resolve before the deploy is dispatched.What changed:
scripts/start-setupModpack: re-load the env file after the packwiz installer runs.docs/mods-and-plugins/packwiz.md: document the re-load, and note thatTYPEandVERSIONresolve earlier, so a pack.envcan't set them (useLOAD_ENV_FROM_GENERIC_PACKorLOAD_ENV_FROM_ARCHIVEfor that).Behaviour only changes when both
PACKWIZ_URLandLOAD_ENV_FROM_FILEare set. Existing setups behave the same.To reproduce: serve a packwiz pack with a root
.env(for exampleMOTD=from-packwiz), then run withEULA=TRUE TYPE=FABRIC PACKWIZ_URL=... LOAD_ENV_FROM_FILE=/data/.envon a clean/data. The resultingserver.propertiesshowsmotd=from-packwiz; without this change it stays at the default. Updating the served.envand restarting picks up the new value.