[PR #1299] [MERGED] fix(quartermaster): 0.1.24 send the Admin Secret for remote access #1391

Closed
opened 2026-10-21 05:10:18 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Agents/pull/1299
Author: @newfiesledneck
Created: 10/10/2026
Status: ✅ Merged
Merged: 10/11/2026
Merged by: @SpicyMarinara

Base: staging ← Head: fix/quartermaster-admin-secret


📝 Commits (3)

  • 863aa81 fix(quartermaster): 0.1.24 send the Admin Secret for remote access
  • e073fd2 Merge branch 'staging' into fix/quartermaster-admin-secret
  • 655256a fix(quartermaster): 0.1.25 cache authenticated images and retry real failures

📊 Changes

18 files changed (+699 additions, -104 deletions)

View changed files

➕ artifacts/quartermaster-0.1.24.zip (+0 -0)
➕ artifacts/quartermaster-0.1.25.zip (+0 -0)
📝 catalog/catalog.json (+6 -6)
📝 catalog/notes.json (+12 -12)
📝 catalog/v2/catalog.json (+6 -6)
📝 catalog/v2/notes.json (+12 -12)
📝 catalog/v3/catalog.json (+6 -6)
📝 catalog/v3/notes.json (+12 -12)
📝 packages/quartermaster/CHANGELOG.md (+12 -0)
📝 packages/quartermaster/README.md (+12 -0)
📝 packages/quartermaster/client.js (+187 -23)
📝 packages/quartermaster/manifest.json (+3 -3)
📝 packages/quartermaster/src/00-api.js (+145 -5)
📝 packages/quartermaster/src/04-icons.js (+1 -1)
📝 packages/quartermaster/src/05-state.js (+26 -4)
📝 packages/quartermaster/src/10-dock.js (+14 -12)
📝 scripts/build-quartermaster-package.mjs (+1 -1)
📝 tests/quartermaster-modal-lifecycle.regression.mjs (+244 -1)

📄 Description

Pull request

Important

Contributions target staging. Only SpicyMarinara may promote this repository's staging branch to main.
Outside and first-time contributors also require an approving review from SpicyMarinara.

Linked issue

Closes #7280
Refs Pasta-Devs/Marinara-Engine#7280 (the package half; the Engine half, the missing dock button, was fixed in Pasta-Devs/Marinara-Engine#7343)

Why this change

  • From another device (Android, LAN, remote), Quartermaster's Tracker Panel and dock failed with "Invalid or missing X-Admin-Secret header", even with the Admin Secret saved. Every package route sits behind the Engine's privileged gate, and Quartermaster's client never sent the secret. Loopback is exempt, which is why local testing never hit it.
  • Item images, outfit portraits and slot icons are served by the same gated routes, so they were also broken from other devices: an <img src> cannot send a header.

What changed

  • packages/quartermaster/src/00-api.js
    • qmRequest and the image-connection check send X-Admin-Secret from localStorage["marinara_admin_secret"] (same approach as the Engine's own client, Memory Nag and Relationship Tracker), plus x-marinara-csrf: 1 on writes.
    • A 403 about the admin secret now tells the user how to fix it (missing vs. mismatched secret), in the same wording as Relationship Tracker, Noodle and Slurp.
    • New QM.setImageSrc(img, url): with a secret saved, our own /api/quartermaster/ images load through fetch with the header and a short-lived object URL. Without a saved secret, or for Engine URLs like the persona avatar, it sets src directly, unchanged from before. A failed load still fires the img error event every caller uses for its fallback, and a late response for a reused element (the portrait) is dropped.
  • packages/quartermaster/src/04-icons.js, src/10-dock.js: the five gated image sites (slot icons, portrait ring, equipped slot images, outfit thumbnails, bag item images) use QM.setImageSrc.
  • tests/quartermaster-modal-lifecycle.regression.mjs: three new tests (headers with/without a saved or unreadable secret, the 403 messages, and the image loader's success/404/superseded cases). They fail against the previous 00-api.js and pass with this change. This file already runs in CI.
  • Version 0.1.23 → 0.1.24 (scripts/build-quartermaster-package.mjs), with packages/quartermaster/CHANGELOG.md and the README changelog updated.
  • Generated outputs: packages/quartermaster/client.js, packages/quartermaster/manifest.json, artifacts/quartermaster-0.1.24.zip, and the catalog entries and notes in catalog/catalog.json, catalog/v2/, catalog/v3/.

Package and security impact

  • Affected package IDs: quartermaster
  • Engine compatibility impact: none (still 2.4.6+). Client-only change; server.mjs is unchanged.
  • New or changed permissions/entrypoints: none. The client sends the secret the user already saved on that device, only to same-origin /api/ routes, and only as a header (never in a URL).
  • Restart, storage, update, or uninstall impact: none beyond a normal package update.

Validation

  • node scripts/validate-catalog.mjs passes locally
  • git diff --check passes locally
  • Rebuilt every affected manifest, payload, artifact, and catalog entry
  • Installed or updated the affected package through Marinara Engine
  • Checked supported modes, restart behavior, and uninstall cleanup
  • Read and followed CONTRIBUTING.md

Manual verification notes

  • Tested the issue pre-fix by setting admin secret, then updated to test the fix.
  • Reproduced locally by setting ADMIN_SECRET and MARINARA_REQUIRE_ADMIN_SECRET_ON_LOOPBACK=true in the Engine's .env and saving the same value in Settings → Advanced → Admin Access. On 0.1.23 the Tracker Panel showed "Invalid or missing X-Admin-Secret header".
  • Updated to 0.1.24 through Download Agents: the Tracker Panel loads, the dock opens, and the portrait ring, slot icons, item images and outfit portraits all show.
  • Played a few turns using the extension, tested adding an item, equipping an outfit, Build Wardrobe LLM calls and saving new outfits, generating images, portrait swapping
  • Tested with AND without a set admin secret, and tested setting a wrong admin secret; a wrong saved secret showing the "does not match" message.
  • Uninstalled and reinstalled quartermaster and retested usability.
  • Not tested on a second device / Android, my only device to test on is windows/desktop.

Agent-run checks: npm run check (0 errors; no warnings in changed files), node scripts/test-catalog-lanes.mjs, node scripts/validate-package-locales.mjs, node scripts/validate-catalog.mjs, node scripts/tests/catalog-release-notes.regression.mjs, node scripts/tests/vendored-engine.regression.mjs, node tests/quartermaster-modal-lifecycle.regression.mjs (12/12), git diff --check.

Manually ran validation checks in terminal/git bash.

Documentation impact

  • No documentation changes needed
  • Updated this README catalog and package guidance
  • Updated linked Marinara Engine documentation

Package README changelog updated; no catalog or guidance changes.

UI evidence (if applicable)

N/A

Summary by CodeRabbit

  • New Features
    • Authenticated images are cached and reused across dock changes when an Admin Secret is saved.
    • Images that fail to load for reasons other than being unavailable are retried when the dock reopens. Changing the saved Admin Secret retries all images.
    • Image refresh clears the image cache.
  • Bug Fixes
    • Image updates and deletions refresh cached images so changes appear correctly.
  • Release
    • Updated Quartermaster to version 0.1.25.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Pasta-Devs/Marinara-Agents/pull/1299 **Author:** [@newfiesledneck](https://github.com/newfiesledneck) **Created:** 10/10/2026 **Status:** ✅ Merged **Merged:** 10/11/2026 **Merged by:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Base:** `staging` ← **Head:** `fix/quartermaster-admin-secret` --- ### 📝 Commits (3) - [`863aa81`](https://github.com/Pasta-Devs/Marinara-Agents/commit/863aa8133b44b675da4ea2822b0866549b5b76a6) fix(quartermaster): 0.1.24 send the Admin Secret for remote access - [`e073fd2`](https://github.com/Pasta-Devs/Marinara-Agents/commit/e073fd2e1f8b1fe232b0dbad614cc24b06be3453) Merge branch 'staging' into fix/quartermaster-admin-secret - [`655256a`](https://github.com/Pasta-Devs/Marinara-Agents/commit/655256ab3fea5e6a8fb2af4625117fd8063f3c4a) fix(quartermaster): 0.1.25 cache authenticated images and retry real failures ### 📊 Changes **18 files changed** (+699 additions, -104 deletions) <details> <summary>View changed files</summary> ➕ `artifacts/quartermaster-0.1.24.zip` (+0 -0) ➕ `artifacts/quartermaster-0.1.25.zip` (+0 -0) 📝 `catalog/catalog.json` (+6 -6) 📝 `catalog/notes.json` (+12 -12) 📝 `catalog/v2/catalog.json` (+6 -6) 📝 `catalog/v2/notes.json` (+12 -12) 📝 `catalog/v3/catalog.json` (+6 -6) 📝 `catalog/v3/notes.json` (+12 -12) 📝 `packages/quartermaster/CHANGELOG.md` (+12 -0) 📝 `packages/quartermaster/README.md` (+12 -0) 📝 `packages/quartermaster/client.js` (+187 -23) 📝 `packages/quartermaster/manifest.json` (+3 -3) 📝 `packages/quartermaster/src/00-api.js` (+145 -5) 📝 `packages/quartermaster/src/04-icons.js` (+1 -1) 📝 `packages/quartermaster/src/05-state.js` (+26 -4) 📝 `packages/quartermaster/src/10-dock.js` (+14 -12) 📝 `scripts/build-quartermaster-package.mjs` (+1 -1) 📝 `tests/quartermaster-modal-lifecycle.regression.mjs` (+244 -1) </details> ### 📄 Description # Pull request > [!IMPORTANT] > Contributions target `staging`. Only `SpicyMarinara` may promote this repository's `staging` branch to `main`. > Outside and first-time contributors also require an approving review from `SpicyMarinara`. <!-- Open as a draft while implementation is in progress. Mark Ready for review only after validation and self-review. --> ## Linked issue <!-- Every PR should reference an issue or feature request. --> Closes #7280 Refs Pasta-Devs/Marinara-Engine#7280 (the package half; the Engine half, the missing dock button, was fixed in Pasta-Devs/Marinara-Engine#7343) ## Why this change - From another device (Android, LAN, remote), Quartermaster's Tracker Panel and dock failed with "Invalid or missing X-Admin-Secret header", even with the Admin Secret saved. Every package route sits behind the Engine's privileged gate, and Quartermaster's client never sent the secret. Loopback is exempt, which is why local testing never hit it. - Item images, outfit portraits and slot icons are served by the same gated routes, so they were also broken from other devices: an `<img src>` cannot send a header. ## What changed - `packages/quartermaster/src/00-api.js` - `qmRequest` and the image-connection check send `X-Admin-Secret` from `localStorage["marinara_admin_secret"]` (same approach as the Engine's own client, Memory Nag and Relationship Tracker), plus `x-marinara-csrf: 1` on writes. - A 403 about the admin secret now tells the user how to fix it (missing vs. mismatched secret), in the same wording as Relationship Tracker, Noodle and Slurp. - New `QM.setImageSrc(img, url)`: with a secret saved, our own `/api/quartermaster/` images load through `fetch` with the header and a short-lived object URL. Without a saved secret, or for Engine URLs like the persona avatar, it sets `src` directly, unchanged from before. A failed load still fires the img `error` event every caller uses for its fallback, and a late response for a reused element (the portrait) is dropped. - `packages/quartermaster/src/04-icons.js`, `src/10-dock.js`: the five gated image sites (slot icons, portrait ring, equipped slot images, outfit thumbnails, bag item images) use `QM.setImageSrc`. - `tests/quartermaster-modal-lifecycle.regression.mjs`: three new tests (headers with/without a saved or unreadable secret, the 403 messages, and the image loader's success/404/superseded cases). They fail against the previous `00-api.js` and pass with this change. This file already runs in CI. - Version 0.1.23 → 0.1.24 (`scripts/build-quartermaster-package.mjs`), with `packages/quartermaster/CHANGELOG.md` and the README changelog updated. - Generated outputs: `packages/quartermaster/client.js`, `packages/quartermaster/manifest.json`, `artifacts/quartermaster-0.1.24.zip`, and the catalog entries and notes in `catalog/catalog.json`, `catalog/v2/`, `catalog/v3/`. ## Package and security impact - Affected package IDs: `quartermaster` - Engine compatibility impact: none (still 2.4.6+). Client-only change; `server.mjs` is unchanged. - New or changed permissions/entrypoints: none. The client sends the secret the user already saved on that device, only to same-origin `/api/` routes, and only as a header (never in a URL). - Restart, storage, update, or uninstall impact: none beyond a normal package update. ## Validation - [x] `node scripts/validate-catalog.mjs` passes locally - [x] `git diff --check` passes locally - [x] Rebuilt every affected manifest, payload, artifact, and catalog entry - [x] Installed or updated the affected package through Marinara Engine - [x] Checked supported modes, restart behavior, and uninstall cleanup - [x] Read and followed `CONTRIBUTING.md` ### Manual verification notes - Tested the issue pre-fix by setting admin secret, then updated to test the fix. - Reproduced locally by setting `ADMIN_SECRET` and `MARINARA_REQUIRE_ADMIN_SECRET_ON_LOOPBACK=true` in the Engine's `.env` and saving the same value in Settings → Advanced → Admin Access. On 0.1.23 the Tracker Panel showed "Invalid or missing X-Admin-Secret header". - Updated to 0.1.24 through Download Agents: the Tracker Panel loads, the dock opens, and the portrait ring, slot icons, item images and outfit portraits all show. - Played a few turns using the extension, tested adding an item, equipping an outfit, Build Wardrobe LLM calls and saving new outfits, generating images, portrait swapping - Tested with AND without a set admin secret, and tested setting a wrong admin secret; a wrong saved secret showing the "does not match" message. - Uninstalled and reinstalled quartermaster and retested usability. - Not tested on a second device / Android, my only device to test on is windows/desktop. Agent-run checks: `npm run check` (0 errors; no warnings in changed files), `node scripts/test-catalog-lanes.mjs`, `node scripts/validate-package-locales.mjs`, `node scripts/validate-catalog.mjs`, `node scripts/tests/catalog-release-notes.regression.mjs`, `node scripts/tests/vendored-engine.regression.mjs`, `node tests/quartermaster-modal-lifecycle.regression.mjs` (12/12), `git diff --check`. Manually ran validation checks in terminal/git bash. ## Documentation impact - [ ] No documentation changes needed - [ ] Updated this README catalog and package guidance - [ ] Updated linked Marinara Engine documentation Package README changelog updated; no catalog or guidance changes. ## UI evidence (if applicable) N/A <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Authenticated images are cached and reused across dock changes when an Admin Secret is saved. * Images that fail to load for reasons other than being unavailable are retried when the dock reopens. Changing the saved Admin Secret retries all images. * Image refresh clears the image cache. * **Bug Fixes** * Image updates and deletions refresh cached images so changes appear correctly. * **Release** * Updated Quartermaster to version 0.1.25. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-21 05:10:18 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Pasta-Devs/Marinara-Agents#1391
No description provided.