No description
- Rust 63.5%
- Shell 16.7%
- TypeScript 12.1%
- CSS 4.3%
- JavaScript 2.4%
- Other 1%
Add 15 markdown unit tests (frontmatter, headings, lists, tables, blockquotes, code blocks, inline formatting, XSS prevention, horizontal rules, images, links, HTML escaping, mixed content) and 8 new browser E2E tests (image viewer controls, fullscreen, prev/next navigation, move-to dialog, duplicate context menu, PDF page navigation, permission-aware UI). Total: 137 tests across 4 layers. |
||
|---|---|---|
| .forgejo/workflows | ||
| crates | ||
| docs/schemas | ||
| schemas/filemanager | ||
| scripts | ||
| services | ||
| tests/e2e | ||
| .gitignore | ||
| buildenv.sh | ||
| Cargo.lock | ||
| Cargo.toml | ||
| LICENSE | ||
| Makefile | ||
| README.md | ||
Hero File Manager (hero_drive)
Web-based file manager built on the Hero ecosystem. Supports two modes of operation:
- Standalone mode — embeds hero_fossil (WebDAV) and runs self-contained on TCP
- Ecosystem mode — connects to external hero_fossil via
WEBDAV_URL, binds a Unix socket for hero_proxy routing, validates JWT tokens from hero_auth
Quick Start (Standalone)
git clone https://forge.ourworld.tf/lhumina_code/hero_drive.git
cd hero_drive
make run # Builds and starts backend (3394) + UI (8887)
Open http://localhost:8887 in your browser.
Ecosystem Mode
When deployed via hero_zero, hero_drive connects to an external hero_fossil and listens on a Unix socket:
hero_filemanager \
--webdav-url http://localhost:3387/webdav/default \
--bind unix:~/hero/var/sockets/hero_drive.sock
hero_proxy then routes /hero_drive/* traffic to the Unix socket.
The hero_zero service template is at services/hero_drive.toml.
Architecture
Standalone:
Browser ──> Dioxus UI (8887) ──JSON-RPC──> OServer (3394) ──WebDAV──> hero_fossil (3387, embedded)
Ecosystem:
Browser ──> hero_proxy ──> Unix socket proxy ──> OServer (TCP, internal)
└──WebDAV──> hero_fossil (external)
| Crate | Purpose |
|---|---|
hero_filemanager |
Main binary — starts OServer + optional embedded WebDAV + optional Unix socket proxy |
hero_filemanager_server |
RPC handlers, WebDAV client, OSIS types |
hero_filemanager_ui |
Dioxus 0.7 web frontend (WASM) |
hero_filemanager_sdk |
JSON-RPC client library (native + WASM) |
hero_filemanager_rhai |
Rhai scripting bindings (10 functions) |
Environment Variables
| Variable | Default | Description |
|---|---|---|
WEBDAV_URL |
— | External WebDAV URL (skips embedded hero_fossil when set) |
HERO_DRIVE_BIND |
— | Bind address: host:port for TCP, unix:/path for Unix socket |
HERO_SECRET |
— | Shared secret for JWT validation (auth disabled when unset) |
RUST_LOG |
info |
Log level filter |
Features
- Browse, search, upload, download, rename, copy, move, delete files
- Trash and restore with path-encoded
.trash/directory - Grid and list views with sortable columns and pagination
- Markdown editor with edit/split/preview modes, autosave, image embed
- Image viewer with zoom, rotate, gallery navigation
- PDF viewer, text viewer with syntax highlighting
- Drag-drop upload and drag-drop move (onto folders)
- Keyboard shortcuts (Ctrl+C/X/V/A, Delete, F2, Backspace)
- File info panel with metadata and copy-path
- Activity/audit log panel
- Context menus, inline rename, multi-select (shift+click)
- MCP endpoint for AI tool integration
Development
make help # Show all targets
make run # Build and run backend + UI
make dev # Same with RUST_LOG=debug
make check # Fast cargo check
make fmt # Format code
make lint # Clippy
Testing
make test # Rust unit tests
make smoke-test # Curl-based HTTP/RPC tests
make e2e-test # Playwright API tests
make e2e-browser # Playwright browser tests (needs WEBDAV_AVAILABLE=1)
make test-all # Full CI suite (fmt, lint, check, test, build, smoke, e2e)
Ports
| Service | Port |
|---|---|
| OServer backend | 3394 |
| Dioxus UI | 8887 |
| WebDAV (hero_fossil, embedded) | 3387 |
RPC API
All via POST /api/root/filemanager/rpc (JSON-RPC 2.0):
| Method | Params | Returns |
|---|---|---|
fileservice.list_directory |
path, sort_by, sort_order | Vec<FileEntry> |
fileservice.get_file_info |
path | FileEntry |
fileservice.create_folder |
path, name | FileEntry |
fileservice.rename_item |
old_path, new_name | FileEntry |
fileservice.move_items |
paths, destination, on_conflict | Vec<FileEntry> |
fileservice.copy_items |
paths, destination, on_conflict | Vec<FileEntry> |
fileservice.delete_items |
paths | bool |
fileservice.trash_items |
paths | bool |
fileservice.restore_items |
paths | bool |
fileservice.search |
query, path | Vec<FileEntry> |
File upload/download via WebDAV: GET/PUT http://localhost:3387/webdav/default/{path}
License
Apache 2.0 — Copyright 2026 ThreeFold