Skip to content

Patch WorldIslandId / AutoLoadLatestBackupIfHasBroken from env#68

Open
indifferentketchup wants to merge 1 commit into
indifferentbroccoli:mainfrom
indifferentketchup:windrose-saves
Open

Patch WorldIslandId / AutoLoadLatestBackupIfHasBroken from env#68
indifferentketchup wants to merge 1 commit into
indifferentbroccoli:mainfrom
indifferentketchup:windrose-saves

Conversation

@indifferentketchup
Copy link
Copy Markdown

Adds two env vars (WORLD_ISLAND_ID, AUTO_LOAD_LATEST_BACKUP) to scripts/init.sh and patches them into the ServerDescription_Persistent block of ServerDescription.json in scripts/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.yml carries the env vars, init.sh exports them through su -w, start.sh applies them via jq.

The schema guard — if ! ... has("ServerDescription_Persistent") — short-circuits the jq patch with a clear error rather than silently corrupting ServerDescription.json if upstream renames or restructures the persistent block. The inline note also reminds future editors that PersistentServerId and DeploymentId are server-managed and must not be patched, since upstream docs warn PersistentServerId's format may change in upcoming builds.

Files changed

  • scripts/init.sh (+3 lines): WORLD_ISLAND_ID and AUTO_LOAD_LATEST_BACKUP exports + their inclusion in the su - steam -w allow-list.
  • scripts/start.sh (+45 / -29): wrap existing jq config patch in a schema-existence guard, plus the two new key writes.

Test plan

  • Boot a container with WORLD_ISLAND_ID=<some id> set — verify ServerDescription.json has the WorldIslandId patched.
  • Boot with AUTO_LOAD_LATEST_BACKUP=false — verify AutoLoadLatestBackupIfHasBroken reflects it.
  • Hand-edit ServerDescription.json to rename the ServerDescription_Persistent key, boot — verify the script logs the schema-mismatch error and skips the patch instead of corrupting the file.

@Florian-Dj
Copy link
Copy Markdown

Why not add the information to the .env.example file?

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.

2 participants