service_drive.nu — hero_drive lifecycle module #157

Open
opened 2026-04-28 09:35:12 +00:00 by mahmoud · 1 comment
Owner

Add service_drive.nu per the tracker in #75. Module exposes install | start [--reset] | stop | status for the hero_drive stack.

Scope

  • Module file: tools/modules/services/service_drive.nu
  • Follow the standard pattern documented in the nu_service and nu_service_use skills.
  • Template to copy from: service_browser.nu (user-level Rust binary).
  • Source repo: hero_drive.

Service-specific notes

  • Binary names mismatch the repo name. The repo is hero_drive, but the binaries inside are prefixed hero_filemanager_*:
    • hero_filemanager (main binary, lifecycle manager)
    • hero_filemanager_server
    • hero_filemanager_ui
    • hero_filemanager_sdk (lib)
    • hero_filemanager_rhai (lib)
  • hero_filemanager is the manager — selfstart pattern, registers hero_filemanager_server + hero_filemanager_ui with hero_proc.
  • User-level service. No privileged ports; no --root.
  • Two operating modes (the nu module should default to ecosystem):
    • Standalone: embeds hero_fossil (WebDAV) and runs self-contained on TCP (8887/3394).
    • Ecosystem: connects to external hero_fossil via WEBDAV_URL; binds a Unix socket for hero_proxy routing; validates JWT tokens from hero_auth via HERO_SECRET.
  • Sockets — current state: the repo binds a single ~/hero/var/sockets/hero_drive.sock rather than the per-service-directory layout (~/hero/var/sockets/hero_drive/{rpc,ui}.sock) called for in hero_sockets. Document this in service_drive.nu's start output but do not widen this issue's scope to fix it — that's a repo-level change tracked separately.
  • External dependency: hero_fossil (WebDAV server). In ecosystem mode this is provided externally; standalone embeds it. The nu module should not install hero_fossil — pre-existing service.
  • Required env in ecosystem mode:
    • WEBDAV_URL — external WebDAV endpoint (when set, skips embedded hero_fossil)
    • HERO_DRIVE_BIND — typically unix:~/hero/var/sockets/hero_drive.sock
    • HERO_SECRET — JWT secret (auth disabled when unset)

Acceptance criteria

  1. use services/mod.nu * makes service_drive available.
  2. On a target host:
    • service_drive install clones the repo, runs cargo build --release, and copies hero_filemanager, hero_filemanager_server, hero_filemanager_ui to ~/hero/bin/.
    • service_drive start [--reset] registers hero_filemanager with hero_proc; the manager selfstarts the server + UI.
    • service_drive status reports state.
    • service_drive stop cleanly unregisters.
  3. The start output prints sockets / UI URL / a short test plan and explicitly notes the legacy single-file socket location, per the nu_service_use skill.

References

  • Parent tracker: #75
  • Pattern skills: nu_service, nu_service_use
  • Self-start pattern: hero_proc_service_selfstart
  • External dep: hero_fossil (WebDAV)
Add `service_drive.nu` per the tracker in #75. Module exposes `install | start [--reset] | stop | status` for the `hero_drive` stack. ## Scope - Module file: `tools/modules/services/service_drive.nu` - Follow the standard pattern documented in the [`nu_service`](../../src/branch/development/claude/skills/nu_service/SKILL.md) and [`nu_service_use`](../../src/branch/development/claude/skills/nu_service_use/SKILL.md) skills. - Template to copy from: `service_browser.nu` (user-level Rust binary). - Source repo: [`hero_drive`](https://forge.ourworld.tf/lhumina_code/hero_drive). ## Service-specific notes - **Binary names mismatch the repo name.** The repo is `hero_drive`, but the binaries inside are prefixed `hero_filemanager_*`: - `hero_filemanager` (main binary, lifecycle manager) - `hero_filemanager_server` - `hero_filemanager_ui` - `hero_filemanager_sdk` (lib) - `hero_filemanager_rhai` (lib) - `hero_filemanager` is the manager — selfstart pattern, registers `hero_filemanager_server` + `hero_filemanager_ui` with hero_proc. - **User-level service.** No privileged ports; no `--root`. - Two operating modes (the nu module should default to ecosystem): - **Standalone:** embeds `hero_fossil` (WebDAV) and runs self-contained on TCP (8887/3394). - **Ecosystem:** connects to external `hero_fossil` via `WEBDAV_URL`; binds a Unix socket for hero_proxy routing; validates JWT tokens from hero_auth via `HERO_SECRET`. - Sockets — current state: the repo binds a single `~/hero/var/sockets/hero_drive.sock` rather than the per-service-directory layout (`~/hero/var/sockets/hero_drive/{rpc,ui}.sock`) called for in [`hero_sockets`](../../src/branch/development/claude/skills/hero_sockets/SKILL.md). Document this in `service_drive.nu`'s start output but do **not** widen this issue's scope to fix it — that's a repo-level change tracked separately. - External dependency: [`hero_fossil`](https://forge.ourworld.tf/lhumina_code/hero_fossil) (WebDAV server). In ecosystem mode this is provided externally; standalone embeds it. The nu module should not install hero_fossil — pre-existing service. - Required env in ecosystem mode: - `WEBDAV_URL` — external WebDAV endpoint (when set, skips embedded hero_fossil) - `HERO_DRIVE_BIND` — typically `unix:~/hero/var/sockets/hero_drive.sock` - `HERO_SECRET` — JWT secret (auth disabled when unset) ## Acceptance criteria 1. `use services/mod.nu *` makes `service_drive` available. 2. On a target host: - `service_drive install` clones the repo, runs `cargo build --release`, and copies `hero_filemanager`, `hero_filemanager_server`, `hero_filemanager_ui` to `~/hero/bin/`. - `service_drive start [--reset]` registers `hero_filemanager` with hero_proc; the manager selfstarts the server + UI. - `service_drive status` reports state. - `service_drive stop` cleanly unregisters. 3. The `start` output prints sockets / UI URL / a short test plan and **explicitly notes** the legacy single-file socket location, per the `nu_service_use` skill. ## References - Parent tracker: #75 - Pattern skills: `nu_service`, `nu_service_use` - Self-start pattern: `hero_proc_service_selfstart` - External dep: `hero_fossil` (WebDAV)
mahmoud self-assigned this 2026-04-28 09:35:12 +00:00
mahmoud removed their assignment 2026-04-28 10:04:20 +00:00
Author
Owner

Updated scope after research on the actual repo. Critical correction: the binaries inside hero_drive are prefixed hero_filemanager_*, not hero_drive_* (repo name and binary prefix diverge). Hero_filemanager is the manager (selfstart pattern). User-level service confirmed. Two operating modes documented (standalone embeds hero_fossil; ecosystem talks to external hero_fossil via WEBDAV_URL). Noted the legacy single-socket-file naming as state-of-the-world but kept it out of scope — that's a repo-level change for a separate issue.

Updated scope after research on the actual repo. Critical correction: **the binaries inside hero_drive are prefixed `hero_filemanager_*`, not `hero_drive_*`** (repo name and binary prefix diverge). Hero_filemanager is the manager (selfstart pattern). User-level service confirmed. Two operating modes documented (standalone embeds hero_fossil; ecosystem talks to external hero_fossil via `WEBDAV_URL`). Noted the legacy single-socket-file naming as state-of-the-world but kept it out of scope — that's a repo-level change for a separate issue.
Sign in to join this conversation.
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_skills#157
No description provided.