Skip to content

rossnorrie/eurooffice-skyeconnex

Repository files navigation

Euro-Office Connector for SkyeCONNEX

Integrate Euro-Office Document Server with SkyeCONNEX distributed cloud storage for seamless in-browser document editing with zero-knowledge encryption.

What It Does

This connector enables SkyeCONNEX users to edit documents directly in the browser without downloading them. The editing flow preserves SkyeCONNEX's zero-knowledge encryption and erasure-coded distribution:

  1. User clicks Edit on a document in SkyeCONNEX
  2. The connector decrypts the file and creates a secure editing session
  3. Euro-Office Document Server loads the editor in an iframe
  4. User edits the document collaboratively
  5. On save, the connector re-encrypts and re-distributes the file across cloud providers
  6. The original is archived as a previous version — full version history is preserved
+-------------------+        +-------------------+        +-------------------+
|   SkyeCONNEX UI   | -----> |    Connector       | -----> | Euro-Office       |
|   (Browser)       |        |    (Flask/Python)   |        | Document Server   |
+-------------------+        +-------------------+        +-------------------+
                                  |           ^
                             decrypt/       callback
                             serve file    (save/close)
                                  |           |
                                  v           |
                              +-------------------+
                              |   SkyeCONNEX      |
                              |   Storage Layer   |
                              |   (Encrypt+RAID)  |
                              +-------------------+

Features

  • Zero-knowledge editing — files are decrypted only in memory for the editing session
  • Automatic versioning — every save creates a new version; previous versions are preserved
  • JWT authentication — all communication between the connector and Document Server is signed
  • Force-save support — auto-save while editing, not just on close
  • Session management — Redis-backed sessions with file-based fallback
  • Collaborative editing — multiple users can edit simultaneously
  • Format support — Word (.docx, .doc, .odt, .rtf, .txt), Excel (.xlsx, .xls, .ods, .csv), PowerPoint (.pptx, .ppt, .odp), and HTML

Requirements

  • Python 3.10+
  • Euro-Office Document Server 9.0+ (or ONLYOFFICE Document Server 8.0+)
  • Redis (recommended) or filesystem for session storage
  • SkyeCONNEX backend with RAID storage service

Quick Start

1. Configure environment variables

# Euro-Office Document Server URL (as seen by the browser)
EUROOFFICE_URL=https://your-domain.com:8080

# Euro-Office URL as seen by the app container (Docker internal network)
EUROOFFICE_INTERNAL_URL=http://eurooffice

# Your app URL as seen by the Euro-Office container (for callbacks)
EUROOFFICE_CALLBACK_URL=http://app:5000

# JWT secret (must match Document Server config)
EUROOFFICE_JWT_SECRET=your_shared_secret

# Redis URL for session storage (optional — falls back to temp files)
REDIS_URL=redis://redis:6379/0

2. Docker Compose

Add Euro-Office Document Server alongside your application:

services:
  eurooffice:
    image: ghcr.io/euro-office/documentserver:latest
    ports:
      - "8080:80"
    environment:
      - JWT_ENABLED=true
      - JWT_SECRET=${EUROOFFICE_JWT_SECRET:-your_shared_secret}
    volumes:
      - eurooffice_data:/var/lib/eurooffice
      - eurooffice_logs:/var/log/eurooffice

volumes:
  eurooffice_data:
  eurooffice_logs:

3. Register the Flask blueprint

from eurooffice_connector import eurooffice_bp

app.register_blueprint(eurooffice_bp)

4. Add the editor iframe to your frontend

// Create an editing session
fetch('/api/eurooffice/session', {
    method: 'POST',
    headers: { 'Content-Type': 'application/json' },
    body: JSON.stringify({ file_id: fileId })
})
.then(r => r.json())
.then(data => {
    // Load the Euro-Office JS API
    var script = document.createElement('script');
    script.src = data.api_js_url;
    script.onload = function() {
        new DocsAPI.DocEditor('editor-container', data.config);
    };
    document.head.appendChild(script);
});

Integration Pattern

This connector implements the standard Euro-Office/ONLYOFFICE integration protocol:

Endpoints

Method Endpoint Description
POST /api/eurooffice/session Create editing session — decrypts file, returns editor config
GET /api/eurooffice/file/<session_id> Serve decrypted file to Document Server
POST /api/eurooffice/callback/<session_id> Handle save/close callbacks from Document Server
GET /edit/<file_id> Full-page editor view (iframe host)

Callback Statuses

Status Meaning Action
1 Document being edited No action
2 Document ready for saving (all editors closed) Download, re-encrypt, re-distribute
4 Document closed with no changes Clean up temp files
6 Force-save (auto-save while editing) Download, re-encrypt, re-distribute

JWT Authentication

All editor configs are signed with HS256 JWT tokens using the shared secret. The Document Server verifies the token before loading the editor, and the connector can optionally verify incoming callback requests.

Configuration Reference

Variable Default Description
EUROOFFICE_URL /ds Document Server URL for the browser
EUROOFFICE_INTERNAL_URL http://eurooffice Document Server URL for server-to-server
EUROOFFICE_CALLBACK_URL http://app:5000 App URL for Document Server callbacks
EUROOFFICE_JWT_SECRET (required) Shared JWT signing secret
REDIS_URL redis://redis:6379/0 Redis connection for session storage

Supported File Types (68 formats)

Category Full Edit View / Auto-Convert
Word Processing .docx, .doc, .odt, .rtf, .txt, .html, .docm, .dotm, .dotx, .ott .dot, .epub, .fb2, .fodt, .hwp, .hwpx, .md, .mht, .mhtml, .pages, .stw, .sxw, .wps, .wpt, .xml
Spreadsheets .xlsx, .xls, .ods, .csv, .xlsb, .xlsm, .xltm, .xltx, .ots .et, .ett, .fods, .numbers, .sxc, .tsv, .xlt
Presentations .pptx, .ppt, .odp, .pptm, .potm, .potx, .ppsm, .ppsx, .otp .dps, .dpt, .fodp, .key, .odg, .pot, .pps, .sxi
PDF .pdf (edit, comment, fill) .djvu, .oxps, .xps (view only)
Diagrams .vsdx, .vsdm, .vssm, .vssx, .vstm, .vstx (view only)

Architecture Notes

Security Model

SkyeCONNEX uses zero-knowledge encryption — the platform never stores plaintext data. During an editing session:

  1. The file is decrypted in memory and written to a temporary directory
  2. The temp file is served to the Document Server over the internal Docker network
  3. On save, the edited document is downloaded, re-encrypted, and re-distributed across cloud providers using Reed-Solomon erasure coding
  4. The temp file is deleted immediately after processing
  5. If the save fails, the previous version is automatically restored

Version Management

Every save (including force-saves) creates a new version linked via version_group_id. The connector archives all current versions in the group before creating the new one, preventing duplicate entries when force-save fires multiple times in a single session.

Contributing

See the Euro-Office contributing guidelines.

License

AGPL-3.0 — see LICENSE.

About

Euro-Office Document Server connector for SkyeCONNEX distributed cloud storage

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors