Integration for Collabora document service.
  • TypeScript 67.6%
  • JavaScript 31%
  • Shell 1.4%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
oliver.maklott 33eefcf268
All checks were successful
Publish / dev-image (push) Successful in 1s
Publish / test (push) Successful in 59s
Publish / pack-and-publish (push) Successful in 32s
Merge pull request 'Embed options and browser base URL declared by the pack. Release 0.10.0.' (#7) from pack-declares-2026-11 into main
2026-11-15 10:56:07 +01:00
.forgejo/workflows CI: pin limedoc-dev 0.73.1 for packing (the 0.72.0 image was pruned from the registry). 2026-11-14 23:36:16 +01:00
.githooks Sub-repo fmt/lint pre-push rollout 2026-08-29 15:42:33 +02:00
client The embed-options handler declares its path form; the WOPI provider passes its browser base URL. Release 0.10.0. 2026-11-15 10:53:33 +01:00
locales Office cards always centered: no align option. Release 0.7.0. 2026-11-07 17:15:15 +00:00
templates Initial commit 2026-08-21 14:43:19 +02:00
worker The office port is published on loopback; the config route gives the reason and operator hint to admins only; in reference attribution mode Collabora gets a tag instead of the user's name. Release 0.9.0. 2026-11-15 00:06:41 +01:00
.env.example Migrate to new owner 2026-10-02 13:17:23 +02:00
.gitignore Initial commit 2026-08-21 14:43:19 +02:00
block_render.test.ts Initial commit 2026-08-21 14:43:19 +02:00
block_render.ts Initial commit 2026-08-21 14:43:19 +02:00
collabora.plugin.json The embed-options handler declares its path form; the WOPI provider passes its browser base URL. Release 0.10.0. 2026-11-15 10:53:33 +01:00
collabora.test.ts Office cards always centered: no align option. Release 0.7.0. 2026-11-07 17:15:15 +00:00
collabora.ts The office port is published on loopback; the config route gives the reason and operator hint to admins only; in reference attribution mode Collabora gets a tag instead of the user's name. Release 0.9.0. 2026-11-15 00:06:41 +01:00
collabora_block_editor.tsx Initial commit 2026-08-21 14:43:19 +02:00
collabora_block_preview_client.tsx Initial commit 2026-08-21 14:43:19 +02:00
collabora_editor_tool.test.ts Initial commit 2026-08-21 14:43:19 +02:00
collabora_editor_tool.tsx The embed-options handler declares its path form; the WOPI provider passes its browser base URL. Release 0.10.0. 2026-11-15 10:53:33 +01:00
collabora_embed.test.ts Office cards always centered: no align option. Release 0.7.0. 2026-11-07 17:15:15 +00:00
collabora_embed_options.test.ts The embed-options handler declares its path form; the WOPI provider passes its browser base URL. Release 0.10.0. 2026-11-15 10:53:33 +01:00
collabora_embed_options.ts The embed-options handler declares its path form; the WOPI provider passes its browser base URL. Release 0.10.0. 2026-11-15 10:53:33 +01:00
collabora_office_dialog.css Collabora Office: AssetField pick and upload 2026-09-11 09:42:04 +02:00
collabora_office_dialog.tsx Office cards always centered: no align option. Release 0.7.0. 2026-11-07 17:15:15 +00:00
collabora_open_editor.tsx Ship own translations (locales/en,de) via pluginT. Release 0.3.0. 2026-10-24 23:22:56 +02:00
compose.dev.yml Migrate to new owner 2026-10-02 13:17:23 +02:00
config.test.ts Initial commit 2026-08-21 14:43:19 +02:00
config.ts Initial commit 2026-08-21 14:43:19 +02:00
deploy.json Guided configure: the pack's own setup flow. Release 0.6.0. 2026-11-04 16:49:12 +01:00
deploy_json.test.ts Guided configure: the pack's own setup flow. Release 0.6.0. 2026-11-04 16:49:12 +01:00
disabled_reason.test.ts Collabora WOPI host + configure messaging 2026-08-26 19:59:27 +02:00
disabled_reason.ts Auto-setup Collabora proof keys with VALIDATE=true 2026-08-26 20:39:13 +02:00
doc_types.ts Initial commit 2026-08-21 14:43:19 +02:00
embed_asset_patterns.ts Initial commit 2026-08-21 14:43:19 +02:00
filename.ts Initial commit 2026-08-21 14:43:19 +02:00
launch_errors.test.ts Formated with deno fmt 2026-08-21 23:24:17 +02:00
launch_errors.ts Initial commit 2026-08-21 14:43:19 +02:00
LICENSE.md Name Oliver Maklott (Belowtoxic e.U.) as the FSL licensor. 2026-10-17 11:13:16 +02:00
limedoc.project.json The embed-options handler declares its path form; the WOPI provider passes its browser base URL. Release 0.10.0. 2026-11-15 10:53:33 +01:00
office_access.test.ts Write test fixtures through the codec so tests pass in encrypted mode. 2026-10-23 19:15:25 +02:00
office_access.ts Public Collabora view + MindElixir edit lock 2026-09-08 23:09:14 +02:00
office_blocks.test.ts Initial commit 2026-08-21 14:43:19 +02:00
office_blocks.ts Launch refuses a pointer whose storage file is not an office type; tokens carry the pointer id. 2026-11-14 21:53:34 +01:00
office_capabilities.test.ts Fix Collabora Browse empty list (office filter) 2026-09-11 10:26:42 +02:00
office_capabilities.ts Fix Collabora Browse empty list (office filter) 2026-09-11 10:26:42 +02:00
office_directive.test.ts Office cards always centered: no align option. Release 0.7.0. 2026-11-07 17:15:15 +00:00
office_directive.ts Office cards always centered: no align option. Release 0.7.0. 2026-11-07 17:15:15 +00:00
office_launch.test.ts The office port is published on loopback; the config route gives the reason and operator hint to admins only; in reference attribution mode Collabora gets a tag instead of the user's name. Release 0.9.0. 2026-11-15 00:06:41 +01:00
office_preview.test.ts Fix office document icon (SVG-as-img) 2026-08-31 02:03:01 +02:00
office_preview.ts Office cards always centered: no align option. Release 0.7.0. 2026-11-07 17:15:15 +00:00
office_scope.test.ts Initial commit 2026-08-21 14:43:19 +02:00
office_scope.ts Initial commit 2026-08-21 14:43:19 +02:00
office_templates.test.ts Initial commit 2026-08-21 14:43:19 +02:00
public_origin.ts Initial commit 2026-08-21 14:43:19 +02:00
README.md The office port is published on loopback; the config route gives the reason and operator hint to admins only; in reference attribution mode Collabora gets a tag instead of the user's name. Release 0.9.0. 2026-11-15 00:06:41 +01:00
register_provider.test.ts The embed-options handler declares its path form; the WOPI provider passes its browser base URL. Release 0.10.0. 2026-11-15 10:53:33 +01:00
register_provider.ts The embed-options handler declares its path form; the WOPI provider passes its browser base URL. Release 0.10.0. 2026-11-15 10:53:33 +01:00
wopi_user_label.test.ts The office port is published on loopback; the config route gives the reason and operator hint to admins only; in reference attribution mode Collabora gets a tag instead of the user's name. Release 0.9.0. 2026-11-15 00:06:41 +01:00
wopi_user_label.ts The office port is published on loopback; the config route gives the reason and operator hint to admins only; in reference attribution mode Collabora gets a tag instead of the user's name. Release 0.9.0. 2026-11-15 00:06:41 +01:00

Collabora Online

Edit office documents via Collabora Online (WOPI).

Requirements

  • Docker (or Podman with DOCKER_CMD=podman)
  • That's it — everything else runs inside containers.

Quick start

# 1. Pull the dev image and set up .env
./ldcmd setup

# 2. Start the dev environment (app + Redis)
./ldcmd up

# 3. Open http://localhost:5173 in your browser

# 4. Edit plugin sources — HMR applies automatically
# 5. Run tests
./ldcmd test

# 6. Check types and import boundaries
./ldcmd check

Directory layout

collabora.plugin.json   # Plugin manifest
collabora.ts            # Server entry (defineLimedocPlugin)
collabora_editor_tool.tsx  # Browser client (builds to client/*.js)
client/              # Pre-built browser bundles (committed)
limedoc.project.json # Store metadata (package download URLs)
compose.dev.yml      # Dev compose (uses the published limedoc-dev image)
ldcmd                # Bridge script — the only thing you run on your host
.env.example         # Env var template — copy to .env and fill in OIDC values

ldcmd commands

Command What it does
./ldcmd setup Pull limedoc-dev image, copy .env.example → .env
./ldcmd up Start dev environment
./ldcmd down Stop dev environment
./ldcmd logs [service] Follow container logs
./ldcmd sh [service] Open shell in container (default: app-dev)
./ldcmd test Run plugin tests
./ldcmd fmt Format sources
./ldcmd lint Lint sources
./ldcmd check Type-check + import boundary check
./ldcmd pack Build zip + sha256 (CI also publishes sig.json)
./ldcmd publish Pack and upload (needs .forgejo.env / PACKAGE_TOKEN)
./ldcmd plugin install <id> Install a plugin dependency into the running env
./ldcmd plugin ls List installed plugins

Building client bundles

# Inside the container (run after editing .tsx files)
./ldcmd sh
deno task plugin:build -- /limedoc/plugins/collabora.plugin

Or directly:

./ldcmd check  # runs build as part of the check

Production sidecar (host)

Pack Store / packs:install unpacks this plugin into the app only. The Docker sidecar is not started by Limedoc (no Docker socket in the app). On the deploy host:

ldcmd sidecar up collabora
# or: ldcmd up

Compose SoT: deploy.json + worker/docker-compose.yml (joins DOCKER_NETWORK_NAME).

ldcmd sidecar configure collabora (or sidecar up collabora --configure) walks through the settings this pack declares in deploy.json configure: the public Collabora host (default collabora.<APP_BASE_HOST>), its scheme and port, the WOPI callback base (default: the public Limedoc address), and, behind one question, the admin user and the proof key directory. It derives COLLABORA_BASE_URL and COLLABORA_SSL_TERMINATION, generates the admin password once, creates the proof key, checks that the discovery address differs from the public one and prints the next steps. With Limedoc older than 0.57.0 the app's built-in Collabora steps do the same.

Distroless + proof-key + HTTPS

collabora/code:latest is distroless (no shell / no coolconfig). ldcmd sidecar configure / the setup wizard host-generate proof_key under COLLABORA_COOLWSD_HOST_PATH and set COLLABORA_VALIDATE_PROOF_KEY=true when keygen succeeds. Compose file-mounts proof_key and proof_key.pub into /etc/coolwsd/ (do not bind-mount the whole directory — that hides coolwsd.xml). After first keygen, recreate Collabora then the app. Verify /hosting/discovery contains proof-key.

Behind a TLS reverse proxy keep COLLABORA_SSL_TERMINATION=true (default) so the browser uses wss://. Set false only for plain-HTTP local bring-up.

Host port, image and privileges

The container port 9980 is published on 127.0.0.1 only (COLLABORA_HOST_BIND, default 127.0.0.1): coolwsd speaks plain HTTP there and the reverse proxy on the same host forwards the public Collabora host to it. Set COLLABORA_HOST_BIND=0.0.0.0 (or one interface address) in the deploy .env when the proxy runs on another host, or when browsers reach host:9980 directly in a setup without a proxy (earlier versions published the port on all interfaces).

COLLABORA_IMAGE defaults to collabora/code:latest so security releases arrive with a pull; pin a version or digest there when upgrades must be deliberate. The compose file keeps MKNOD, SYS_ADMIN, SYS_CHROOT and apparmor=unconfined: coolwsd builds a chroot jail per document and does not start documents without them.

Privacy

With ATTRIBUTION_MODE=reference the app sends Collabora no name or email: the user label (shown at cursors, stored with comments and tracked changes) is User <6 hex>, a tag derived from the instance address and the user id. The anonymous config route tells non-admins only whether the integration is on; the reason and the operator hint (which names the compose file on the server) go to admins.

Packing and publishing

# Build the installable zip + sha256 sidecar (local)
./ldcmd pack

# Publish (needs .forgejo.env with PACKAGE_TOKEN, PACKAGE_OWNER)
./ldcmd publish

CI (Forgejo Actions, .forgejo/workflows/publish.yml) on push to main publishes zip + sha256 + sig.json to Packages and Releases. Pack CI signs the content hash with OpenBao Transit (Forgejo Actions OIDC). Actions secret PACKAGE_TOKEN only — PACKAGE_OWNER is in the workflow env.

Developing with plugin dependencies

Your plugin may depend on another plugin at runtime. Three ways to include it:

1. Install via ldcmd (easiest, needs the app running)

./ldcmd up
./ldcmd plugin install media   # fetches from PACKAGE_STORE_URL in .env

Set PACKAGE_STORE_URL in .env to point at the Forgejo package registry:

PACKAGE_STORE_URL=https://git.belowtoxic.cloud/api/packages/limedoc-plugins

2. Local bind-mount (no running app needed)

Download the pack zip, unzip it next to this directory, then add a volume to compose.dev.yml:

app-dev:
    volumes:
        - .:/limedoc/plugins/collabora.plugin
        # Add the dependency:
        - ../other-plugin.plugin:/limedoc/plugins/other.plugin

Then ./ldcmd up — the app loads all *.plugin directories in plugins/.

3. Multi-repo development (two plugins at once)

Check out the other plugin repo next to this one:

cd ..
git clone git@git.belowtoxic.cloud:limedoc-plugins/other.git other.plugin

Then add it as a bind-mount in compose.dev.yml as shown above. Both plugins are mounted into the same app instance. No special ldcmd support required — the app discovers every *.plugin directory at startup.

Startup order: The app loads plugins alphabetically. If your plugin requires another, the dependency must be present on disk for the load plan to resolve. The compose depends_on in the sidecar template ensures the worker sidecar is healthy before the app starts, but for plugin-to-plugin dependencies no extra compose configuration is needed.

CI / CD

Push to main → Forgejo Actions runs .forgejo/workflows/publish.yml:

  1. Tests pass inside the limedoc-dev container
  2. Client bundles built; boundary check passes
  3. plugin:pack produces collabora-{version}.zip + .sha256
  4. OpenBao signs the content hash → collabora-{version}.sig.json
  5. Zip, sha256, and sig.json uploaded to the generic package registry (store)
  6. Same artifacts attached to a Forgejo Release v{version} (operators)

The app installs plugins from the generic package registry at PACKAGE_STORE_URL.

Using Podman instead of Docker

# In .env (or export before running):
DOCKER_CMD=podman
./ldcmd up

ldcmd detects podman compose automatically.

License

This pack is source-available under the Functional Source License, Version 1.1, ALv2 Future License (FSL-1.1-ALv2). Copyright 2026 Oliver Maklott (Belowtoxic e.U.).

You may use, modify, and redistribute it for any purpose other than a Competing Use. Two years after a version is made available, that version is also licensed under the Apache License 2.0. Third-party files under vendor/ keep the license shipped with those files.