OnlyOffice document editor connector for Hero OS with per-context WebDAV storage.
  • Rust 98.4%
  • Makefile 1.1%
  • Shell 0.5%
Find a file
despiegk 6ee0cb7ab8
Some checks failed
lab publish / publish (push) Failing after 40s
chore: remove Cargo.lock and update gitignore
2026-06-06 08:05:12 +02:00
.forgejo/workflows ci: install lab onto PATH from ~/.local/bin in the publish workflow 2026-05-29 15:42:38 -04:00
crates fix(admin): convert tungstenite Vec<u8>/String to axum Bytes/Utf8Bytes 2026-05-20 09:59:32 -04:00
doc refactor: rename hero_office_ui -> hero_office_admin (ui.sock -> admin.sock) (#27) 2026-05-08 02:06:08 +00:00
.gitignore chore: remove Cargo.lock and update gitignore 2026-06-06 08:05:12 +02:00
buildenv.sh refactor: rename hero_office_ui -> hero_office_admin (ui.sock -> admin.sock) (#27) 2026-05-08 02:06:08 +00:00
Cargo.toml refactor: rename hero_office_ui -> hero_office_admin (ui.sock -> admin.sock) (#27) 2026-05-08 02:06:08 +00:00
Makefile refactor: rename hero_office_ui -> hero_office_admin (ui.sock -> admin.sock) (#27) 2026-05-08 02:06:08 +00:00
README.md refactor: rename hero_office_ui -> hero_office_admin (ui.sock -> admin.sock) (#27) 2026-05-08 02:06:08 +00:00

hero_office

OnlyOffice document editor connector for the Hero stack, backed by per-context hero_fossil WebDAV storage.

hero_office hosts OnlyOffice Docs editor surfaces (documents, spreadsheets, presentations, PDFs, diagrams) and persists files through the tenant's hero_fossil instance. The UI is embedded into hero_os as a set of apps under the "Office" archipelago.

Workspace layout

crate role
hero_office_server OpenRPC JSON-RPC daemon on rpc.sock — all business logic
hero_office_sdk Generated typed client via openrpc_client! macro
hero_office_admin HTTP UI on admin.sock — admin dashboard + OnlyOffice wrapper pages
hero_office_examples Examples and integration tests

Sockets

socket purpose
$HERO_SOCKET_DIR/hero_office/rpc.sock server OpenRPC endpoint
$HERO_SOCKET_DIR/hero_office/ui.sock UI HTTP endpoint (iframed)
$HERO_SOCKET_DIR/<context>/hero_fossil_server.sock per-context fossil backend

HERO_SOCKET_DIR defaults to $HOME/hero/var/sockets.

Lifecycle

Managed through hero_proc via the Nushell service module at scripts/nu_service.nu (per the nu_service skill).

use scripts/nu_service.nu

nu_service install   # cargo build --release + copy to ~/hero/bin
nu_service start     # register actions + service, then start
nu_service status
nu_service stop

Environment variables

variable purpose
ONLYOFFICE_JWT_SECRET shared JWT secret for signing editor configs (must match the OO container)
OO_SERVER_URL public URL of the OnlyOffice Docs server (loaded by the user's browser)
CONNECTOR_EXTERNAL_URL URL of this service as seen by the OnlyOffice container
DEFAULT_CONTEXT fallback context shown on / (default: default)
HERO_SOCKET_DIR socket directory (default: $HOME/hero/var/sockets)

URL surface (admin.sock, proxied by hero_router under /hero_office/)

route method purpose
/health GET JSON health check
/admin/?context=<ctx> GET operator dashboard
/<ctx>/<type>/ GET file browser filtered to one OnlyOffice type
/<ctx>/edit/<filename> GET OnlyOffice editor wrapper page
/<ctx>/files/<filename> GET byte proxy for the OO container
/<ctx>/callback POST OnlyOffice save callback

Where <type> is one of word, cell, slide, pdf, diagram.

hero_os integration

The "Office" archipelago (hierarchical) contains five islands, each an iframe pointing at the corresponding filtered surface:

  • Documents → /hero_office/<ctx>/word/
  • Spreadsheets → /hero_office/<ctx>/cell/
  • Presentations → /hero_office/<ctx>/slide/
  • PDF → /hero_office/<ctx>/pdf/
  • Diagrams → /hero_office/<ctx>/diagram/

See hero_os/crates/hero_os_app/src/registry.rs and island_content.rs.