diff --git a/ARCHITECTURE.md b/ARCHITECTURE.md index b512444..ca9a876 100644 --- a/ARCHITECTURE.md +++ b/ARCHITECTURE.md @@ -44,6 +44,7 @@ Single deployable backend service, split into modules (routers) by domain. - `control/app_networks.py` — networks tab endpoints - `control/app_files.py` — files/workloads endpoints (tree/read/save/etc.) - `control/app_images.py` — images endpoints + - `control/app_volumes.py` — volumes endpoints (list/create/delete/prune/exists) 4. **Shared Infrastructure Layer** - `control/common.py` @@ -73,10 +74,11 @@ After any change affecting backend routing or shared helpers, run: ```bash python3 -m py_compile control/app.py control/common.py control/app_system.py \ control/app_containers.py control/app_pods.py control/app_networks.py \ - control/app_files.py control/app_images.py + control/app_files.py control/app_images.py control/app_volumes.py curl -fsS http://127.0.0.1:8081/api/health | jq curl -fsS http://127.0.0.1:8081/api/pods-dashboard >/dev/null && echo OK curl -fsS http://127.0.0.1:8081/api/containers-dashboard >/dev/null && echo OK curl -fsS http://127.0.0.1:8081/api/files/tree >/dev/null && echo OK +curl -fsS http://127.0.0.1:8081/api/volumes >/dev/null && echo OK curl -fsS http://127.0.0.1:8081/api/networks/meta | jq diff --git a/CLAUDE.md b/CLAUDE.md index 1725607..94ef491 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -19,6 +19,7 @@ podman-mvp is a Portainer-like web dashboard for managing rootless user-session | `app_pods.py` | Pods router: dashboard, pod actions | | `app_networks.py` | Networks router | | `app_images.py` | Images router | +| `app_volumes.py` | Volumes router: list, create, delete, prune, exists | | `app_files.py` | Files/workloads router: tree, read, save | Backend communicates with Podman through the Unix socket at `/run/user/1000/podman/podman.sock` using `requests_unixsocket`. Podman API base: `http+unix://%2Frun%2Frun%2Fuser%2F1000%2Fpodman%2Fpodman.sock/v5.4.2`. @@ -26,7 +27,7 @@ Backend communicates with Podman through the Unix socket at `/run/user/1000/podm ### Frontend — Static Apache (`webui/`) - `webui/html/index.html` — single-page app shell -- `webui/html/assets/js/tabs/` — per-tab JavaScript modules (containers, networks, images, files) +- `webui/html/assets/js/tabs/` — per-tab JavaScript modules (containers, networks, images, volumes, files) - `webui/conf/httpd.conf` — Apache config, proxies `/api/` → `http://127.0.0.1:8000/api/` ## Build & Deploy @@ -60,13 +61,14 @@ podman run -d --pod mvp-pod --name mvp-webui \ # Syntax check all backend modules python3 -m py_compile control/app.py control/common.py control/app_system.py \ control/app_containers.py control/app_pods.py control/app_networks.py \ - control/app_files.py control/app_images.py + control/app_files.py control/app_images.py control/app_volumes.py # Smoke test key endpoints (all via proxy on :8081) curl -fsS http://127.0.0.1:8081/api/health | jq curl -fsS http://127.0.0.1:8081/api/containers-dashboard >/dev/null && echo OK curl -fsS http://127.0.0.1:8081/api/pods-dashboard >/dev/null && echo OK curl -fsS http://127.0.0.1:8081/api/files/tree >/dev/null && echo OK +curl -fsS http://127.0.0.1:8081/api/volumes >/dev/null && echo OK curl -fsS http://127.0.0.1:8081/api/networks/meta | jq ``` diff --git a/contracts/API_GOLDEN.md b/contracts/API_GOLDEN.md index 46d6700..b1727d9 100644 --- a/contracts/API_GOLDEN.md +++ b/contracts/API_GOLDEN.md @@ -149,6 +149,74 @@ Golden example: } +================================================== +GET /api/volumes +================================================== + +Curl: +curl -s http://127.0.0.1:8081/api/volumes + +Response type: +Array of Podman volume objects (raw Podman passthrough). + +Golden keys per item: +- Name +- Driver +- Mountpoint +- CreatedAt +- Labels + +Golden example: +[ + { + "Name": "my-volume", + "Driver": "local", + "Mountpoint": "/home/kodi/.local/share/containers/storage/volumes/my-volume/_data", + "CreatedAt": "2026-03-01T12:00:00Z", + "Labels": {} + } +] + + +================================================== +POST /api/volumes +================================================== + +Request body (JSON): +- name (string, required) +- driver (string, optional, default "local") +- labels (object, optional) +- driverOpts (object, optional) + +Response: created volume object (raw Podman passthrough). + + +================================================== +DELETE /api/volumes/{name} +================================================== + +Response on success (204 from Podman): +{"ok": true} + +Error responses forwarded from Podman (e.g. 409 if in use). + + +================================================== +POST /api/volumes/prune +================================================== + +Response: array of pruned volume names (raw Podman passthrough). + + +================================================== +GET /api/volumes/{name}/exists +================================================== + +Response: +{"exists": true} — volume bestaat (Podman 204) +{"exists": false} — volume niet gevonden (Podman 404) + + ================================================== GET /api/openapi.json ==================================================