Repository navigation
[codex] Add staged mod upload support - #7
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2292fe703b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if have_mods: | ||
| try: | ||
| applied_mods = apply_staged_mods() | ||
| except Exception as e: |
There was a problem hiding this comment.
Restart the game before applying staged mods
In _api_config_apply, apply_staged_mods() executes before request_restart(). On the normal “Apply + restart” flow while the server is running, this rewrites R5/Content/Paks/~mods and ~mods.disabled while the game process is still alive, which breaks the staged-next-boot behavior and can race with runtime file access. Restart should be triggered first (or mod promotion deferred to startup) so live mod directories are only mutated after shutdown.
Useful? React with 👍 / 👎.
| if src.is_dir(): | ||
| shutil.copytree(src, dst / rel, dirs_exist_ok=True) | ||
| mods_copied = True | ||
| if mods_copied or (dst / MODS_METADATA_NAME).is_file() or (dst / MODS_STAGED_METADATA_NAME).is_file(): |
There was a problem hiding this comment.
Always mark backups with explicit mod-state inclusion
The .mods-included marker is only written when mod files or mod metadata exist. That means a backup taken before any mods are installed has no marker, and restore_backup() then skips mod cleanup, leaving whatever mods are currently on disk. Restoring a backup that represents an empty mod set cannot roll mods back to empty state; write a marker (or explicit empty mod metadata) for every backup so restore can clear mod dirs when needed.
Useful? React with 👍 / 👎.
Summary
Adds staged server-side mod management to the admin console for
.pak-style Windrose mods.R5/.mods-staging/and desired state intoR5/.mods.staged.jsonR5/Content/Paks/~mods//api/modsendpointsWhy
Windrose mods should not be copied into or removed from the live
~modsdirectory while the game process is running. This keeps uploads and enable/disable operations as next-restart intent, matching the existing staged config/world workflow.Validation
python3 tests/test_http.pypython3 tests/test_schema.pypython3 tests/test_retention.pypython3 tests/test_restore.pypython3 tests/test_auto_backup.pypython3 -m py_compile server.py tests/test_http.pynode --check ui/app.jsbash -n scripts/entrypoint.sh