- Rust 98.4%
- Makefile 1.1%
- Shell 0.5%
|
|
||
|---|---|---|
| .forgejo/workflows | ||
| crates | ||
| doc | ||
| .gitignore | ||
| buildenv.sh | ||
| Cargo.toml | ||
| Makefile | ||
| README.md | ||
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.