Skip to content

Feature: "All containers" toggle for admins sitewide; add additional docker build failsafe's. #374

Merged
cmyers-mieweb merged 4 commits into
mainfrom
cmyers_issue112
Jun 30, 2026
Merged

Feature: "All containers" toggle for admins sitewide; add additional docker build failsafe's. #374
cmyers-mieweb merged 4 commits into
mainfrom
cmyers_issue112

Conversation

@cmyers-mieweb

@cmyers-mieweb cmyers-mieweb commented Jun 23, 2026

Copy link
Copy Markdown
Collaborator

Issue: #374

This pull request introduces an "All Containers" admin view to the container management system, allowing admins to see every container on a site, including the owner of each container. It also refactors the Docker Compose setup to prevent race conditions during dependency installation, and extends the API, client types, and OpenAPI schema to support the new functionality.

Admin "All Containers" View and API Enhancements:

  • Added a new /sites/{siteId}/containers/all API endpoint (admin-only) that returns all containers for a site, including the owner field, with support for filtering by nodeId, hostname, and username. [1] [2] [3] [4]
  • Updated the OpenAPI schema to document the new endpoint, the owner field on containers, and the new query parameters. [1] [2] [3]
  • Updated the backend container serialization and query logic to include the owner field and to support flexible filtering for both user and admin list endpoints. [1] [2] [3] [4]

Frontend: Containers List Page and API Integration:

  • Enhanced the ContainersListPage to support an "all"/"mine" toggle (visible to admins), display the container owner in the "All" view, and handle new query parameters for filtering. [1] [2] [3] [4] [5] [6] [7] [8]
  • Updated client-side types and queries to handle the owner field and the new listAllContainers API. [1] [2] [3]

Docker Compose Dependency Installation Improvements:

  • Refactored the Docker Compose setup so only the node service runs npm ci (with --ignore-scripts and manual patching), preventing race conditions and ensuring reliable dependency setup for both server and client. The client service now waits for node to finish before building. [1] [2] [3]
image image image image

Issue: #112

Expose an admin-only API and UI to list every container on a site and add owner metadata. Server: add apiAdmin, include owner in serialized containers, introduce CONTAINER_INCLUDE and buildContainerListWhere to centralize eager-loading and filtering, reuse includes for list/show routes, and add GET /sites/{siteId}/containers/all (with username/nodeId/hostname filters). Client: add route /containers/all and scope prop to ContainersListPage, query keys and listAllContainers API call, owner type, admin toggle to switch between "Mine" and "All", and show owner column when viewing all. OpenAPI: document owner property, nodeId query param, and new /containers/all path. Compose: make the node service the single owner of npm installs (use --ignore-scripts + patch-package) and make the client wait for node to finish to avoid concurrent install races. images/proxmox-ve: handle partially-created LXC configs by checking for lingering create locks and missing arch, tearing down remnants and recreating to avoid wedging boots.
Comment thread compose.yml Outdated
Comment thread images/proxmox-ve/create-manager.sh Outdated
Comment thread create-a-container/openapi.v1.yaml Outdated
Allow listing containers by owner via a `user` query param and propagate that across API, client, and docs. Server: add resolveUsernameFilter to enforce admin-only access for `user='*'` or other owners, apply the username constraint to the existing /containers endpoint, and remove the legacy /containers/all route; update OpenAPI to document the new `user` query and 403 response. Client: update query keys and listContainers to send the `user` param, change routing to use ?user=* for the "All" view, and make ContainersListPage read the user query param so the view is bookmarkable. Dev environment: adjust compose.yml to use node:24-trixie and run npm installs/builds in the client service (simplify install steps and watch behavior). images/proxmox-ve: clarify create-manager.sh comments and simplify the partial-create detection logic to rely on the create lock. These changes make owner-scoped listing explicit, bookmarkable, and consistently enforced.
@runleveldev

Copy link
Copy Markdown
Collaborator

It's not a blocker to this PR, but can we see why the job for the preview container failed and get another issue opened. https://github.com/mieweb/opensource-server/actions/runs/28060284274/job/83073005593?pr=374

Comment thread create-a-container/routers/api/v1/containers.js
Comment thread create-a-container/openapi.v1.yaml Outdated
const userFilter = isAll ? '*' : undefined;
// Only admins ever see more than one owner in the `*` view, so the owner
// column is meaningful for them alone.
const showOwner = isAdmin && isAll;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Not a blocker just a note, this will no longer be true once the sharing system is added.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I'll remove this on my next PR

@cmyers-mieweb cmyers-mieweb merged commit f5fd514 into main Jun 30, 2026
8 checks passed
@cmyers-mieweb cmyers-mieweb deleted the cmyers_issue112 branch June 30, 2026 15:25
@cmyers-mieweb cmyers-mieweb restored the cmyers_issue112 branch June 30, 2026 15:40
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