ContainerDeskDocs
Management & terminalView source ↗

⚡ Verified remote Compose actions

Compose grouping remains read-only discovery. To enable actions, the user enters and acknowledges a remote working directory, an ordered list of absolute config-file paths and an explicit project name. Discovered label paths are never promoted automatically. The form belongs to the full host/daemon/session scope; changing host/project or editing the configuration discards verification. Remote Compose must be available. Only start, stop and restart of existing verified services are registered; no up/build/pull/down/remove/deployment path is exposed.

The backend validates the project-name subset (lowercase ASCII letters/digits, underscore and dash, starting alphanumeric; maximum 128 bytes), absolute paths without controls/dot segments (maximum 4 KiB each, one to eight distinct files), and bounded service names. The directory and each file are encoded with the existing central POSIX single-quote function. A fixed remote prefix cd <directory> && test -f <file> && test -r <file> ... && exec <Docker argv> checks access and establishes the working directory; the local process remains native OpenSSH with argument arrays, never a local shell.

Every Compose command has explicit --project-directory, --project-name, ordered --file arguments, --profile '*', --ansi never, --progress quiet and --parallel 1. Docker endpoint/context and sudo policy remain pinned by the existing verified daemon binding. Validation calls config --quiet, then config --hash '*', then ps --all --quiet --orphans=false. A narrow container inspect checks full IDs, exact project/service labels, non-one-off status and matching service config hashes. Labels alone cannot authorize execution. Wrong names, absent dependencies, changed file order, differing deployed configuration or missing services fail verification while read-only grouping remains available.

Resolved configuration/environment is never rendered, exported or returned over IPC. All subprocess output is bounded; raw stderr is discarded after static error classification. Required interpolation warnings fail verification. Service config hashes remain private Rust memory. The renderer receives only the acknowledged configuration, verified service names, full existing IDs, a random token and expiry. One verification per host is retained, at most three, with a five-minute monotonic TTL and complete session binding. Verification and mutations do not use automatic read retries.

Management opt-in uses the existing backend host policy. Preparation rechecks live configuration/instances, then issues the existing 30-second one-use confirmation bound to configuration order, token, service names, full IDs, action, timeout and scope. The confirmation displays those fields with the selected host and daemon. The owned mutation task rechecks again before dispatch. Restart passes --no-deps; all commands name the verified existing services explicitly. Start does not create missing containers. Stop/restart use the chosen 1–120 second shutdown timeout; operation output is capped at 64 KiB per stream and the dispatched command deadline is timeout plus ten seconds (at most 130 seconds).

Compose uses the same per-host/global mutation locks and durable activity store as container actions. All targets become durable unknown together before a single project command is dispatched. A successful Compose exit records success. A nonzero exit, timeout or lost response stays unknown for every target because the CLI may have completed only some work. Pending cancellation can prevent dispatch; it never interrupts or replays a dispatched command. Renderer disconnection does not release the owner while its SSH child is running. History retains only the existing action enum/IDs/outcomes and no paths/configuration/hashes/secrets.

After completion the UI reads current container state and health. Command success and observed running state are not readiness guarantees; an unknown action stays unknown even if a subsequent snapshot is running. Every further action requires explicit verification again. Configuration checks are bounded to 30 seconds, 128 service hashes, 20 existing instances/services and 32 KiB hash/instance projection responses; global/per-host read admission remains enforced.

Verification is conservative: it requires deployed Compose config hashes to match current explicit configuration. Different versions, changed deployment configuration or unresolved environment may require review in the user’s terminal; ContainerDesk does not rebuild/recreate services to fix this. Checks and a service-targeted CLI command cannot atomically lock out external file changes, scaling or other operators. The final fresh verification narrows that race; the confirmation identifies service scope and the observed instance IDs. Remote user permissions and trusted configuration remain the execution boundary. Sudo does not bypass the SSH user’s file-access prefix.

The owned lab tests/lab/logs.py --stream --jump --compose-actions --sshd-root <OpenSSH root> provisions two disposable real projects with the same web/worker service names. The controlled project has spaces/apostrophes in its directory/files, an ordered override and a required env file. The app-only SSH gate admits exact configuration reads and start/stop/restart for that project. Setup may use Compose up solely to provision disposable fixtures; app command plans never do. Native backend/UI and independent Docker inspect verify lifecycle states and unchanged start timestamps for the unrelated project. Tests also reject missing env, wrong name, swapped files, intent reuse and actual configuration drift after confirmation.

Official references checked 2026-09-29: explicit Compose project/file options, validation and config hashes, restart semantics, existing container listing. Actual native evidence and platform limits are in prompt 037.