mirror of
https://github.com/Studio-Saelix/sencho.git
synced 2026-08-11 11:16:55 +00:00
fix(stacks): resolve permission denied error on stack deletion (#261)
* fix(stacks): resolve permission denied error when deleting stacks with root-owned files When Docker Compose creates files as root inside a stack directory, the non-root Sencho process cannot remove them. This adds a Docker-based fallback: if fsPromises.rm fails with EACCES/EPERM, Sencho spawns a short-lived Alpine container to clean up the root-owned files. Also enhances docker compose down with --volumes --remove-orphans to let Docker clean up its own resources before filesystem deletion. * docs: clarify that pre-existing root-owned stacks can be deleted * fix(stacks): include Docker stderr in fallback deletion error message Fixes CI lint failure: 'stderr' was assigned but never read in forceDeleteViaDocker(). Now surfaces Docker stderr output in the error message when the fallback cleanup fails.
This commit is contained in:
@@ -49,12 +49,16 @@ The stack header exposes four actions:
|
||||
| **Stop** | `docker compose stop` | Stops containers without removing them. State is preserved. |
|
||||
| **Restart** | `docker compose restart` | Restarts all containers in the stack. |
|
||||
| **Update** | `docker compose pull` + `up -d` | Pulls the latest image tags and recreates containers. |
|
||||
| **Delete** | `down` + removes files | Stops and removes containers, then deletes the stack directory. |
|
||||
| **Delete** | `down --volumes` + removes files | Stops and removes containers and volumes, then deletes the stack directory. |
|
||||
|
||||
<Warning>
|
||||
**Delete** is irreversible. It removes the stack directory - including `compose.yaml`, `.env`, and any bind-mounted files stored there. Back up important files before deleting.
|
||||
</Warning>
|
||||
|
||||
<Note>
|
||||
Stack directories often contain root-owned files — either because Docker Compose creates them, or because the stacks were originally set up outside of Sencho with `sudo`. Sencho handles this automatically: if a normal deletion fails due to permissions, it uses Docker to clean up root-owned files. No manual intervention is needed in the standard setup.
|
||||
</Note>
|
||||
|
||||
## Stack context menu
|
||||
|
||||
Right-click or use the **⋮** button on any stack in the sidebar to access:
|
||||
|
||||
Reference in New Issue
Block a user