feat(wopi): add WOPI protocol support for collaborative editing

Implement the Web Application Open Platform Interface (WOPI) protocol
to enable collaborative document editing with Collabora Online and
OnlyOffice through OxiCloud.

Backend:
- WOPI token service with HMAC-SHA256 signed access tokens
- WOPI lock service with in-memory lock management and expiry
- WOPI discovery service for auto-detecting editor capabilities
- WOPI HTTP handler: CheckFileInfo, GetFile, PutFile, Lock/Unlock
- File entity extended with owner_id for WOPI file-info responses
- Configuration via WOPI_* environment variables
- Services wired through DI in AppState

Frontend:
- WOPI editor component with modal and new-tab viewing modes
- Context menu integration for opening files in online editors
- Inline viewer integration for document preview

Infrastructure:
- Docker Compose file for local Collabora/OnlyOffice dev setup

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Jan Wiebe
2026-02-21 13:39:27 +01:00
parent 807370e194
commit 4e2c9d2592
20 changed files with 1877 additions and 14 deletions
+31
View File
@@ -0,0 +1,31 @@
# WOPI editor services for local development.
# Usage: docker compose -f docker-compose.dev.yml -f docker-compose.wopi.yml up -d
# Then run OxiCloud natively: cargo run
services:
collabora:
image: collabora/code:latest
restart: unless-stopped
cap_add:
- MKNOD
environment:
# Allow OxiCloud running on host to use Collabora
- "aliasgroup1=http://host.docker.internal:8086"
# Disable SSL and SSL termination (dev only, plain HTTP on localhost)
- "extra_params=--o:ssl.enable=false --o:ssl.termination=false --o:net.frame_ancestors=http://localhost:* http://127.0.0.1:*"
# Admin console (optional)
- "username=admin"
- "password=admin"
ports:
- "9980:9980"
# Uncomment to use OnlyOffice instead of / alongside Collabora:
# onlyoffice:
# image: onlyoffice/documentserver:latest
# restart: unless-stopped
# environment:
# - "WOPI_ENABLED=true"
# - "JWT_SECRET=oxicloud-dev-secret"
# - "JWT_ENABLED=true"
# ports:
# - "8088:80"