Complete remaining file manager features from spec #6

Open
opened 2026-02-25 14:45:32 +00:00 by mik-tf · 0 comments
Owner

Summary

Remaining features from the full file manager spec (geomind_code/home#41) that are not yet implemented in hero_drive.

The core file manager (v1) is complete — 10 RPC methods, Dioxus UI with browse/search/viewers/markdown editor, 5-crate workspace, CI green. This issue tracks the remaining items to reach full spec compliance.

Architecture: Dual-Mode Operation

hero_drive supports two deployment modes:

Standalone Mode (default)

  • Embeds hero_fossil as a library (features = ["server"])
  • Spawns its own WebDAV server on port 3387
  • Self-contained: cargo run just works, no external dependencies
  • Use case: development, testing, single-machine deployments

Ecosystem Mode (via hero_zero)

  • Connects to an external hero_fossil service as a WebDAV client
  • WEBDAV_URL env var points to hero_fossil (e.g., via hero_proxy at http://localhost:8080/hero_fossil/webdav/default)
  • Listens on Unix socket at ~/hero/var/sockets/hero_drive.sock
  • hero_proxy routes /hero_drive/... to the socket
  • hero_auth provides JWT-based auth via shared HERO_SECRET
  • heroindex provides full-text search + audit log
Standalone:                          Ecosystem (hero_zero):

hero_drive                           hero_fossil (separate service)
├── embedded hero_fossil (:3387)       └── WebDAV on hero_fossil.sock
├── OServer RPC (:3394)                        ↑
└── Dioxus UI                        hero_drive (WebDAV client)
                                     ├── OServer RPC
                                     ├── Dioxus UI
                                     └── hero_drive.sock
                                               ↑
                                     hero_proxy (:8080) → browser

The WEBDAV_URL env var controls which mode: if set, hero_drive uses the external URL and skips spawning the embedded WebDAV server. If unset, it starts the embedded server on the default port.

Remaining Features

1. Documentation (README.md)

  • Architecture overview (dual-mode: standalone vs ecosystem)
  • Quick start for standalone mode (cargo run)
  • Ecosystem integration guide (hero_zero, hero_proxy, WEBDAV_URL)
  • Environment variables reference (WEBDAV_URL, HERO_SECRET, RUST_LOG)
  • API reference (10 RPC methods, WebDAV endpoints)

2. Ecosystem Integration

  • CLI flag or auto-detect to skip embedded WebDAV when WEBDAV_URL is set
  • --bind unix:<path> argument for Unix socket binding (alongside TCP fallback)
  • GET /health endpoint for hero_proxy health checks
  • hero_zero service template (services/hero_drive.toml)
  • hero_proxy routing entry (hero_drive:http)

3. Auth & Permissions (integrate with hero_auth)

  • Axum middleware: extract Authorization: Bearer <JWT> header
  • Local JWT validation using shared HERO_SECRET env var (HS256, zero network calls)
  • Scope-based access control: read (browse/download), write (upload/edit/move/copy), admin (delete permanently, manage perms)
  • Login redirect flow via hero_auth (/login?redirect_uri=...)
  • UI: login page, token storage in state, inject Bearer header in API calls
  • Hide UI actions the user's scope doesn't permit
  • Standalone mode: auth optional (disabled by default, enabled with --require-auth)

4. Advanced Search (via heroindex)

  • Add heroindex_client dependency
  • Index file metadata into heroindex (name, path, mime_type, size, modified_at)
  • Search by date range (modified_at gte/lte) — currently missing from UI
  • Full-text content search for text/markdown files (spec: index-based, via heroindex)
  • Replace recursive WebDAV walk with heroindex queries for better performance
  • Standalone mode: fall back to current recursive WebDAV search when heroindex unavailable

5. Server-side Audit Log (via heroindex)

  • Index file operation events (create, delete, rename, move, copy, upload, download) into heroindex
  • Each event: timestamp, user (from JWT sub), action, path, detail
  • RPC method to query audit log with date range and filters
  • UI: server-persisted activity panel (replace current client-side-only in-memory log)
  • Standalone mode: fall back to in-memory ring buffer (current behavior)

6. Zip Download

  • Server-side zip assembly endpoint for folder download
  • Multi-file zip download (selected files)
  • UI: download button for folders and multi-select

7. Folder Upload

  • Add webkitdirectory attribute to file input for folder upload
  • Reconstruct folder paths from dropped directory entries
  • Create subdirectories on WebDAV before uploading files

8. Viewer & Editor Enhancements

  • Image viewer: fullscreen/lightbox mode with requestFullscreen API
  • PDF viewer: custom page navigation controls (page N of M), zoom (replace bare iframe)
  • Markdown editor: drag image into textarea to upload and insert link
  • Markdown editor: version conflict detection (ETag/If-Match before save)

9. UI Polish

  • Loading skeleton placeholders (animated cards instead of text spinner)
  • New file from template (pre-populated content per file type)

Ecosystem Dependencies

Dependency Purpose Standalone Ecosystem
hero_fossil WebDAV file storage Embedded (library) External service via hero_proxy
hero_auth OAuth2 + JWT auth Optional (--require-auth) Required via HERO_SECRET
heroindex Full-text search + audit log Fallback to WebDAV walk + memory log Full integration
hero_proxy Unix socket routing Not used (TCP direct) Routes /hero_drive/...
hero_zero Service orchestration Not used Manages lifecycle

Priority Order

  1. README — document what exists and the dual-mode architecture
  2. Ecosystem integration — socket binding, health endpoint, hero_zero template
  3. Auth (hero_auth) — security foundation
  4. Advanced search (heroindex) — replaces fragile recursive walk
  5. Audit log (heroindex) — reuses same heroindex integration
  6. Zip download — commonly requested
  7. Folder upload — browser support varies
  8. Viewer/editor enhancements — polish
  9. UI polish — cosmetic
## Summary Remaining features from the full file manager spec ([geomind_code/home#41](https://forge.ourworld.tf/geomind_code/home/issues/41)) that are not yet implemented in hero_drive. The core file manager (v1) is complete — 10 RPC methods, Dioxus UI with browse/search/viewers/markdown editor, 5-crate workspace, CI green. This issue tracks the remaining items to reach full spec compliance. ## Architecture: Dual-Mode Operation hero_drive supports two deployment modes: ### Standalone Mode (default) - Embeds hero_fossil as a library (`features = ["server"]`) - Spawns its own WebDAV server on port 3387 - Self-contained: `cargo run` just works, no external dependencies - Use case: development, testing, single-machine deployments ### Ecosystem Mode (via hero_zero) - Connects to an **external** hero_fossil service as a WebDAV client - `WEBDAV_URL` env var points to hero_fossil (e.g., via hero_proxy at `http://localhost:8080/hero_fossil/webdav/default`) - Listens on Unix socket at `~/hero/var/sockets/hero_drive.sock` - hero_proxy routes `/hero_drive/...` to the socket - hero_auth provides JWT-based auth via shared `HERO_SECRET` - heroindex provides full-text search + audit log ``` Standalone: Ecosystem (hero_zero): hero_drive hero_fossil (separate service) ├── embedded hero_fossil (:3387) └── WebDAV on hero_fossil.sock ├── OServer RPC (:3394) ↑ └── Dioxus UI hero_drive (WebDAV client) ├── OServer RPC ├── Dioxus UI └── hero_drive.sock ↑ hero_proxy (:8080) → browser ``` The `WEBDAV_URL` env var controls which mode: if set, hero_drive uses the external URL and skips spawning the embedded WebDAV server. If unset, it starts the embedded server on the default port. ## Remaining Features ### 1. Documentation (README.md) - [ ] Architecture overview (dual-mode: standalone vs ecosystem) - [ ] Quick start for standalone mode (`cargo run`) - [ ] Ecosystem integration guide (hero_zero, hero_proxy, WEBDAV_URL) - [ ] Environment variables reference (WEBDAV_URL, HERO_SECRET, RUST_LOG) - [ ] API reference (10 RPC methods, WebDAV endpoints) ### 2. Ecosystem Integration - [ ] CLI flag or auto-detect to skip embedded WebDAV when `WEBDAV_URL` is set - [ ] `--bind unix:<path>` argument for Unix socket binding (alongside TCP fallback) - [ ] `GET /health` endpoint for hero_proxy health checks - [ ] hero_zero service template (`services/hero_drive.toml`) - [ ] hero_proxy routing entry (`hero_drive:http`) ### 3. Auth & Permissions (integrate with hero_auth) - [ ] Axum middleware: extract `Authorization: Bearer <JWT>` header - [ ] Local JWT validation using shared `HERO_SECRET` env var (HS256, zero network calls) - [ ] Scope-based access control: `read` (browse/download), `write` (upload/edit/move/copy), `admin` (delete permanently, manage perms) - [ ] Login redirect flow via hero_auth (`/login?redirect_uri=...`) - [ ] UI: login page, token storage in state, inject Bearer header in API calls - [ ] Hide UI actions the user's scope doesn't permit - [ ] Standalone mode: auth optional (disabled by default, enabled with `--require-auth`) ### 4. Advanced Search (via heroindex) - [ ] Add `heroindex_client` dependency - [ ] Index file metadata into heroindex (name, path, mime_type, size, modified_at) - [ ] Search by date range (modified_at gte/lte) — currently missing from UI - [ ] Full-text content search for text/markdown files (spec: index-based, via heroindex) - [ ] Replace recursive WebDAV walk with heroindex queries for better performance - [ ] Standalone mode: fall back to current recursive WebDAV search when heroindex unavailable ### 5. Server-side Audit Log (via heroindex) - [ ] Index file operation events (create, delete, rename, move, copy, upload, download) into heroindex - [ ] Each event: timestamp, user (from JWT sub), action, path, detail - [ ] RPC method to query audit log with date range and filters - [ ] UI: server-persisted activity panel (replace current client-side-only in-memory log) - [ ] Standalone mode: fall back to in-memory ring buffer (current behavior) ### 6. Zip Download - [ ] Server-side zip assembly endpoint for folder download - [ ] Multi-file zip download (selected files) - [ ] UI: download button for folders and multi-select ### 7. Folder Upload - [ ] Add `webkitdirectory` attribute to file input for folder upload - [ ] Reconstruct folder paths from dropped directory entries - [ ] Create subdirectories on WebDAV before uploading files ### 8. Viewer & Editor Enhancements - [ ] Image viewer: fullscreen/lightbox mode with `requestFullscreen` API - [ ] PDF viewer: custom page navigation controls (page N of M), zoom (replace bare iframe) - [ ] Markdown editor: drag image into textarea to upload and insert link - [ ] Markdown editor: version conflict detection (ETag/If-Match before save) ### 9. UI Polish - [ ] Loading skeleton placeholders (animated cards instead of text spinner) - [ ] New file from template (pre-populated content per file type) ## Ecosystem Dependencies | Dependency | Purpose | Standalone | Ecosystem | |---|---|---|---| | hero_fossil | WebDAV file storage | Embedded (library) | External service via hero_proxy | | hero_auth | OAuth2 + JWT auth | Optional (`--require-auth`) | Required via `HERO_SECRET` | | heroindex | Full-text search + audit log | Fallback to WebDAV walk + memory log | Full integration | | hero_proxy | Unix socket routing | Not used (TCP direct) | Routes `/hero_drive/...` | | hero_zero | Service orchestration | Not used | Manages lifecycle | ## Priority Order 1. **README** — document what exists and the dual-mode architecture 2. **Ecosystem integration** — socket binding, health endpoint, hero_zero template 3. **Auth** (hero_auth) — security foundation 4. **Advanced search** (heroindex) — replaces fragile recursive walk 5. **Audit log** (heroindex) — reuses same heroindex integration 6. **Zip download** — commonly requested 7. **Folder upload** — browser support varies 8. **Viewer/editor enhancements** — polish 9. **UI polish** — cosmetic
mik-tf changed title from WIP: Complete remaining file manager features from spec to Complete remaining file manager features from spec 2026-02-25 14:46:40 +00:00
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
lhumina_code/hero_drive#6
No description provided.