Patch WorldIslandId / AutoLoadLatestBackupIfHasBroken from env#68
Open
indifferentketchup wants to merge 1 commit into
Open
Patch WorldIslandId / AutoLoadLatestBackupIfHasBroken from env#68indifferentketchup wants to merge 1 commit into
indifferentketchup wants to merge 1 commit into
Conversation
|
Why not add the information to the .env.example file? |
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.
Adds two env vars (
WORLD_ISLAND_ID,AUTO_LOAD_LATEST_BACKUP) toscripts/init.shand patches them into theServerDescription_Persistentblock ofServerDescription.jsoninscripts/start.sh, behind a schema-existence guard.This lets the host-side dashboard's "World ID" field and "Auto-restore broken saves" toggle take effect on next container boot —
docker-compose.ymlcarries the env vars,init.shexports them throughsu -w,start.shapplies them viajq.The schema guard —
if ! ... has("ServerDescription_Persistent")— short-circuits thejqpatch with a clear error rather than silently corruptingServerDescription.jsonif upstream renames or restructures the persistent block. The inline note also reminds future editors thatPersistentServerIdandDeploymentIdare server-managed and must not be patched, since upstream docs warnPersistentServerId's format may change in upcoming builds.Files changed
scripts/init.sh(+3 lines):WORLD_ISLAND_IDandAUTO_LOAD_LATEST_BACKUPexports + their inclusion in thesu - steam -wallow-list.scripts/start.sh(+45 / -29): wrap existingjqconfig patch in a schema-existence guard, plus the two new key writes.Test plan
WORLD_ISLAND_ID=<some id>set — verifyServerDescription.jsonhas theWorldIslandIdpatched.AUTO_LOAD_LATEST_BACKUP=false— verifyAutoLoadLatestBackupIfHasBrokenreflects it.ServerDescription.jsonto rename theServerDescription_Persistentkey, boot — verify the script logs the schema-mismatch error and skips the patch instead of corrupting the file.