Skip to content

[codex] Add staged mod upload support - #7

Merged
seslly merged 9 commits into
mainfrom
feat/mod-support
Apr 28, 2026
Merged

seslly merged 9 commits into
mainfrom
feat/mod-support

Conversation

@seslly

@seslly seslly commented Apr 28, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds staged server-side mod management to the admin console for .pak-style Windrose mods.

  • Adds a new Mods UI card for uploading, listing, enabling, disabling, and deleting mods
  • Stages mod uploads into R5/.mods-staging/ and desired state into R5/.mods.staged.json
  • Applies staged mods on the next game launch before Proton starts, promoting enabled mods into R5/Content/Paks/~mods/
  • Preserves mod files and metadata across SteamCMD updates
  • Includes mod state in UI backups and restores it with save/identity state
  • Documents the new UI flow and /api/mods endpoints

Why

Windrose mods should not be copied into or removed from the live ~mods directory 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.py
  • python3 tests/test_schema.py
  • python3 tests/test_retention.py
  • python3 tests/test_restore.py
  • python3 tests/test_auto_backup.py
  • python3 -m py_compile server.py tests/test_http.py
  • node --check ui/app.js
  • bash -n scripts/entrypoint.sh

@seslly
seslly marked this pull request as ready for review April 28, 2026 04:44

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread server.py Outdated
Comment on lines +2559 to +2562
if have_mods:
try:
applied_mods = apply_staged_mods()
except Exception as e:

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

Comment thread server.py Outdated
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():

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

@seslly
seslly merged commit a9db113 into main Apr 28, 2026
11 checks passed
@seslly
seslly deleted the feat/mod-support branch April 30, 2026 17:11
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.

1 participant