Conversation
A failed refresh could truncate a previously good cache entry, and the shared `<dest>.tmp` name let concurrent seeds race on the same path. - Write the icon cache through a unique temp file and rename into place - Use a per-destination unique temp file when seeding Docker Manager - chmod 0644 before rename since tempnam() creates files as 0600 Refs #129
Seeding writes a persistent copy as well as the RAM one, so tests left files behind and could become order-dependent. Refs #129
Three separate refactors shared one bullet, breaking the one-change-per- line format of the surrounding release notes.
fix(icon): serve icons from cache and repair Docker Manager icon cache
composeIconSrc/composeIconFallback lived in composeManagerMain.js, which is only loaded on the Compose/Docker tab. On the Dashboard the stack render loop threw a ReferenceError, so the tile stayed on 'Loading...' and compose containers were never hidden from the Docker tile. Move the icon helpers into composeIcons.js and load it from both the Compose page and the dashboard tile. Also run container hiding before the render loop so a render failure can no longer disable it.
IconCache.php?src=<data URI> puts the whole base64 payload in the query string, which trips browser/nginx URL length limits and breaks the icon. Data URIs are already inline, so proxying gains nothing; Docker Manager seeding for them still happens server-side in Exec.php.
fix(dashboard): load icon helpers on Dashboard tile (#143)
Add ProjectIdentity resolver that compares folder-derived and legacy name-derived candidates against live compose project label ownership across containers, volumes, and networks. Persist resolved runtime identity to project_name metadata and wire StackInfo to always use that centralized pinned identity for docker compose -p. Fail closed on ambiguous or unprobeable identity and add explicit owner-choice support via StackInfo.
Enforce resolved project identity across compose action builders, single and multi-stack command launchers, manual and scheduled auto-update paths, and event/script consumers via compose_args. Add read-only identity preview endpoint plus explicit identity selection endpoint for owner-driven conflict resolution. Surface blocked stacks in list/UI with warning indicator and chooser modal when actions hit ambiguous identity.
…osed behavior Add ProjectIdentity tests covering legacy name mismatch, running/stopped ownership, volume-only ownership, ambiguous dual ownership, no ownership, Docker probe failure, pinned reuse, owner choice, and logs-vs-mutation guard behavior. Set deterministic default probe in test bootstrap so unit tests never depend on host Docker state.
Scope the fail-closed identity guard in echoComposeCommand() to mutating actions only. composeLogs stays read-only and continues opening ttyd even when identity is unresolved.
Handle identity error payloads that do not include per-stack candidates (e.g. multi-stack operations) with a simple warning dialog instead of opening the chooser with no options.
fix(migration): fail-closed legacy runtime project identity migration for imported stacks
There was a problem hiding this comment.
🟡 Changes recommended
There are confirmed security/robustness issues in the new identity chooser HTML escaping and in atomic write logic that can spuriously fail due to chmod chaining, plus a potentially unintended update-channel switch in the plugin URL.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
This PR strengthens Docker container icon handling (cache correctness, atomic writes, Docker Manager cache/metadata repair, shared JS helpers for dashboard + main UI) and adds a fail-closed legacy Compose project-identity migration mechanism that blocks mutating actions until identity is proven or explicitly pinned.
Changes:
- Introduces shared
composeIcons.jshelpers and aligns Compose page + Dashboard tile icon resolution (including container-context seeding). - Hardens icon caching: verify PNG bytes, atomic cache writes, stricter cache serving behavior in
IconCache.php, and Docker Manager icon/docker.json repair. - Adds
ProjectIdentityresolution + UI affordances (warnings + chooser) and enforces fail-closed behavior across compose actions and auto-update paths, with new regression coverage.
File summaries
| File | Description |
|---|---|
| tests/unit/StackInfoTest.php | Expands icon seeding/repair test coverage and consolidates cleanup. |
| tests/unit/ProjectIdentityTest.php | Adds regression tests for legacy project-identity resolution and fail-closed behavior. |
| tests/bootstrap.php | Adds test constants for Docker Manager icon paths and disables live Docker probing by default in tests. |
| source/compose.manager/README.md | Marks plugin as “(Beta)”. |
| source/compose.manager/javascript/composeManagerMain.js | Removes inline icon helpers (moved to composeIcons.js) and adds identity-warning UI + identity pinning flow. |
| source/compose.manager/javascript/composeIcons.js | New shared icon helper module for Compose page + Dashboard tile. |
| source/compose.manager/include/Util.php | Adds PNG verification/staleness helpers, atomic icon-cache writes, Docker Manager seeding + docker.json repair, and identity integration into StackInfo. |
| source/compose.manager/include/ProjectIdentity.php | New identity resolver/pinner with Docker evidence probing and fail-closed unresolved state. |
| source/compose.manager/include/Helpers.php | Blocks mutating compose actions when identity is unresolved; improves multi-action handling for blocked stacks. |
| source/compose.manager/include/Exec.php | Seeds Docker Manager icons during icon resolution and adds endpoints for identity preview + pinning. |
| source/compose.manager/include/Defines.php | Adds constants for Docker Manager icon locations and icon-label key. |
| source/compose.manager/include/ComposeManager.php | Loads composeIcons.js on the Compose page. |
| source/compose.manager/include/ComposeList.php | Adds identity warning indicators and row data attributes used by the chooser UI. |
| source/compose.manager/include/ComposeCommandBuilder.php | Refuses mutating compose actions when identity is unresolved (logs allowed). |
| source/compose.manager/include/AutoUpdateRunner.php | Skips scheduled auto-updates when identity is unresolved. |
| source/compose.manager/include/AutoUpdate.php | Blocks manual auto-updates with 409 when identity is unresolved. |
| source/compose.manager/IconCache.php | Serves strictly from cache (with refresh/staleness logic) and supports container-context repairs. |
| source/compose.manager/compose.manager.dashboard.page | Loads composeIcons.js on dashboard tile and passes container name into icon proxying. |
| compose.manager.plg | Points pluginURL to the dev branch and tidies changelog formatting. |
Review details
Suppressed comments (1)
source/compose.manager/include/Util.php:467
- Docker Manager icon seeding uses a copy/chmod/rename && chain, so a chmod failure prevents seeding even if the copy and rename would have worked. Consider making chmod best-effort (as in other atomic-write patterns) to avoid leaving Docker Manager with a corrupt/missing icon due to permission quirks.
if (@copy($cachedPngPath, $tmp) && @chmod($tmp, 0644) && @rename($tmp, $dest)) {
$seeded = true;
composeLogger('Seeded Docker Manager icon cache', ['container' => $containerName, 'dest' => $dest], 'system', 'debug', 'icon-cache');
} else {
@unlink($tmp);
- Files reviewed: 19/19 changed files
- Comments generated: 4
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
…uring compose up by omitting the detach option
There was a problem hiding this comment.
🟡 Changes recommended
There are confirmed functional and security issues in the new follow-logs path (getopt option list and EXIT trap handling) and in the dashboard/detach endpoints where unescaped or unvalidated inputs can lead to injection or unsafe process signaling.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Review details
- Files reviewed: 29/29 changed files
- Comments generated: 4
- Review effort level: Lite
This pull request delivers a beta release of Compose Manager Plus, introducing significant new features for stack management, improvements to icon caching, and robust identity enforcement for Docker Compose projects. It also includes several bug fixes, refactorings, and test enhancements to improve reliability and maintainability.
New features and enhancements:
Stack management improvements:
compose upby omitting the detach option.Identity enforcement and security:
Icon caching and Docker Manager integration:
Bug fixes and refactoring:
UI and dashboard:
Chores and documentation:
For a full list of changes and details, see the beta release diff.