File browser: folder upload + copy/move (0.13.0)

Folder upload: the Files page gained an "Upload folder" picker
(webkitdirectory); each file is sent with its webkitRelativePath and the
backend recreates the directory tree. upload_target now accepts an optional
rel_path, creating intermediate dirs (mkdir -p) inside the sandbox with each
component validated against traversal.

Copy/move: new file_service.copy/move + POST /api/files/{copy,move}
(admin, audit-logged). The UI adds per-row copy/cut actions, a clipboard bar
to paste into the current directory, and an overwrite prompt on conflict.
Both refuse to move/copy a folder into itself or its own subtree and are
sandbox-checked on source and destination.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
menzelj
2026-06-08 10:53:57 +00:00
co-authored by Claude Opus 4.8
parent e3313fb4ac
commit 25bba1cf2c
8 changed files with 290 additions and 16 deletions
+7 -3
View File
@@ -154,13 +154,17 @@ as intuitive as Dockge, as capable as Portainer for Compose workflows.
highlighting picked from the extension). Binary and oversized files are
detected and offered as a download instead. Admins can edit and **Save**.
- **Manage** (admin): create folders/files, rename, delete (recursive for
folders), upload files, and download any file. Every mutation is audit-logged.
folders), upload files **or whole folders** (the directory tree is recreated
server-side), and download any file. **Copy/cut & paste** moves files and
folders between directories (clipboard bar + per-row copy/cut, with an
overwrite prompt on conflict). Every mutation is audit-logged.
- **Sandboxed**: all access is confined to `ALLOWED_BROWSE_ROOTS`; path
traversal and deleting a browse root are refused. To reach the real host
filesystem, mount it into the backend and set `HOST_ROOT_PREFIX` (see the
commented `/:/host_root` volume in `docker-compose.yml`). Endpoints live under
`/api/files/*` (`list`, `read`, `write`, `mkdir`, `touch`, `rename`, `upload`,
`download`, `DELETE`).
`/api/files/*` (`list`, `read`, `write`, `mkdir`, `touch`, `rename`, `copy`,
`move`, `upload` — with optional `rel_path` for folder uploads —, `download`,
`DELETE`).
## Deploying an agent on another host