docs-editing: Nextcloud never learns the editor exists — install richdocuments + point wopi_url at Collabora when Document editing is placed #413

Closed
opened 2026-08-10 20:30:55 +00:00 by ben · 1 comment
Owner

The gap

The docs-editing port deploys Collabora Online end to end (internal/clan/docsediting.go + docsediting_attach.go, #226 lineage): coolwsd on the ruled host, mesh-only behind the front door (ADR 0074), admin secret over a clan var, and a WOPI storage allow-list that names files.<apex> as the one host permitted to embed the editor.

But the coupling's other half has no code: nothing installs the richdocuments app in Nextcloud or sets its wopi_url, so a community that ticks Document editing gets a running Collabora that trusts Nextcloud — and a Nextcloud that has never heard of the editor. No edit button on any document. grep -rn "richdocuments\|wopi_url" internal/ comes back empty.

(Found 2026-08-10 while answering "does the files deploy include Collabora?" against the GREEN nextcloud provision drive 20260810T144654Z — the drive deployed files alone; both services together would still not give in-Nextcloud editing.)

What to build

When both files and docs-editing are placed for the community, the files node grows a nextcloud-richdocuments oneshot — the third of its kind beside nextcloud-oidc (ADR 0150) and nextcloud-brand (DDR 0007) in internal/clan/files.go, same discipline throughout:

  • occ app:install richdocuments || occ app:enable richdocuments (install-or-enable, the user_oidc guard shape),
  • occ config:app:set richdocuments wopi_url --value="https://docs-editing.<apex>" — the editor host derived through the ONE hostname authority (ADR 0113), never retyped; this is the mirror of DocsEditingConfig.FilesHost flowing the other way,
  • idempotent, create-or-update, re-run safe (ADR 0062),
  • ordered after nextcloud-setup.service like its siblings.

Attach-time join: the render needs to know docs-editing is placed when it renders the files node (and vice-versa — a later AttachDocsEditing when files is already active must also land the Nextcloud side). Follow the existing live-set / attach shape; whichever side attaches second completes the pair.

Private-path wrinkle to carry (the split-horizon lesson, drive 20260810T134228Z): Nextcloud fetches from wopi_url server-side, and Collabora calls back to files.<apex> server-side too. Both hosts resolve loopback in-guest via the T2 /etc/hosts wiring and are served by the front door with the community-CA chain the guest already trusts, so no new bridge should be needed — but say so in a comment and let the drive prove it, don't assume silently.

Acceptance

  • Render tests in internal/clan/files_test.go (or a sibling): both-placed renders the oneshot with the derived wopi_url; files-alone renders NOTHING richdocuments (this drive's shape stays byte-identical).
  • With both services placed on the private path: occ app:list shows richdocuments enabled, occ config:app:get richdocuments wopi_url reads https://docs-editing.<apex>, and Collabora's /hosting/discovery answers over the front door.
  • Out of scope here, noted for the e2e arc: a drive leg that ticks both services and opens a document in the editor (extends provision-nextcloud.live.spec.ts).

Pointers

  • internal/clan/files.go — the two oneshot precedents to copy (nextcloud-oidc, nextcloud-brand).
  • internal/clan/docsediting.go / docsediting_attach.go — the Collabora side + the FilesHost derivation to mirror.
  • ADR 0074 (stateless, front-door-governed), ADR 0113 (hostname authority), ADR 0062 (idempotent re-runs), ADR 0150 / DDR 0007 (the oneshot pattern).
  • NOTE: the current provisioning truth (incl. the split-horizon fixes) lives UNPUSHED on the bridge worktree worktree-bridge-cse_01PLKLFxEnGVFCawokpodMEo until Ben merges — build on top of that once it lands on main.
## The gap The docs-editing port deploys Collabora Online end to end (`internal/clan/docsediting.go` + `docsediting_attach.go`, #226 lineage): coolwsd on the ruled host, mesh-only behind the front door (ADR 0074), admin secret over a clan var, and a WOPI storage allow-list that names `files.<apex>` as the one host permitted to embed the editor. But the coupling's **other half has no code**: nothing installs the `richdocuments` app in Nextcloud or sets its `wopi_url`, so a community that ticks *Document editing* gets a running Collabora that trusts Nextcloud — and a Nextcloud that has never heard of the editor. No edit button on any document. `grep -rn "richdocuments\|wopi_url" internal/` comes back empty. (Found 2026-08-10 while answering "does the files deploy include Collabora?" against the GREEN nextcloud provision drive `20260810T144654Z` — the drive deployed files alone; both services together would still not give in-Nextcloud editing.) ## What to build When **both** files and docs-editing are placed for the community, the files node grows a `nextcloud-richdocuments` oneshot — the third of its kind beside `nextcloud-oidc` (ADR 0150) and `nextcloud-brand` (DDR 0007) in `internal/clan/files.go`, same discipline throughout: - `occ app:install richdocuments || occ app:enable richdocuments` (install-or-enable, the user_oidc guard shape), - `occ config:app:set richdocuments wopi_url --value="https://docs-editing.<apex>"` — the editor host derived through the ONE hostname authority (ADR 0113), never retyped; this is the mirror of `DocsEditingConfig.FilesHost` flowing the other way, - idempotent, create-or-update, re-run safe (ADR 0062), - ordered after `nextcloud-setup.service` like its siblings. Attach-time join: the render needs to know docs-editing is placed when it renders the files node (and vice-versa — a later `AttachDocsEditing` when files is already active must also land the Nextcloud side). Follow the existing live-set / attach shape; whichever side attaches second completes the pair. Private-path wrinkle to carry (the split-horizon lesson, drive `20260810T134228Z`): Nextcloud fetches from `wopi_url` **server-side**, and Collabora calls back to `files.<apex>` server-side too. Both hosts resolve loopback in-guest via the T2 /etc/hosts wiring and are served by the front door with the community-CA chain the guest already trusts, so no new bridge should be needed — but say so in a comment and let the drive prove it, don't assume silently. ## Acceptance - Render tests in `internal/clan/files_test.go` (or a sibling): both-placed renders the oneshot with the derived `wopi_url`; files-alone renders NOTHING richdocuments (this drive's shape stays byte-identical). - With both services placed on the private path: `occ app:list` shows richdocuments enabled, `occ config:app:get richdocuments wopi_url` reads `https://docs-editing.<apex>`, and Collabora's `/hosting/discovery` answers over the front door. - Out of scope here, noted for the e2e arc: a drive leg that ticks both services and opens a document in the editor (extends `provision-nextcloud.live.spec.ts`). ## Pointers - `internal/clan/files.go` — the two oneshot precedents to copy (`nextcloud-oidc`, `nextcloud-brand`). - `internal/clan/docsediting.go` / `docsediting_attach.go` — the Collabora side + the FilesHost derivation to mirror. - ADR 0074 (stateless, front-door-governed), ADR 0113 (hostname authority), ADR 0062 (idempotent re-runs), ADR 0150 / DDR 0007 (the oneshot pattern). - NOTE: the current provisioning truth (incl. the split-horizon fixes) lives UNPUSHED on the bridge worktree `worktree-bridge-cse_01PLKLFxEnGVFCawokpodMEo` until Ben merges — build on top of that once it lands on main.
Author
Owner

Landed as df7c496 on main.

The docs-editing coupling's other half now exists — grep -rn "richdocuments\|wopi_url" internal/ is no longer empty:

  • internal/clan/files.go: FilesConfig.DocsEditingHost + renderNextcloudRichdocuments — a nextcloud-richdocuments oneshot (third of its kind beside nextcloud-oidc/nextcloud-brand), emitted ONLY when a docs-editing host is set: occ app:install richdocuments || occ app:enable richdocuments, then occ config:app:set richdocuments wopi_url --value="https://docs-editing.<apex>" — the editor host derived through the ONE hostname authority (ADR 0113), ordered after nextcloud-setup.service, idempotent/re-run safe (ADR 0062). Files alone renders NOTHING richdocuments (byte-identical drive).
  • internal/clan/files_attach.go: FilesLiveSet.DocsEditing → AttachFiles derives docs-editing.<apex> from the SAME apex through the SAME authority (the mirror of docsediting.go deriving files.<apex>); refused, never fabricated, if the apex yields no editor host.
  • internal/clan/docsediting_attach.go: documents the pair-completion — whichever service attaches second, the orchestrator (holding both live sets) re-runs AttachFiles with DocsEditing set; docs-editing's own render declares the WOPI allow-list.
  • Private-path split-horizon carried in a comment (both legs SERVER-SIDE over the front door on the community-CA chain, no new bridge — the drive proves it, AC2).

AC1 (render tests) green: internal/clan/files_test.go (both-placed renders the oneshot with the derived wopi_url; files-alone renders NOTHING richdocuments; ordered+idempotent oneshot) and internal/clan/files_attach_test.go (derived editor host / no-coupling). go test ./internal/clan/ ./internal/provision/ passes.

AC2 (live private-path check) and the both-ticked edit-a-document e2e drive leg remain the noted out-of-scope e2e follow-up (extends provision-nextcloud.live.spec.ts).

Landed as df7c496 on `main`. The docs-editing coupling's other half now exists — `grep -rn "richdocuments\|wopi_url" internal/` is no longer empty: - **`internal/clan/files.go`**: `FilesConfig.DocsEditingHost` + `renderNextcloudRichdocuments` — a `nextcloud-richdocuments` oneshot (third of its kind beside `nextcloud-oidc`/`nextcloud-brand`), emitted ONLY when a docs-editing host is set: `occ app:install richdocuments || occ app:enable richdocuments`, then `occ config:app:set richdocuments wopi_url --value="https://docs-editing.<apex>"` — the editor host derived through the ONE hostname authority (ADR 0113), ordered after `nextcloud-setup.service`, idempotent/re-run safe (ADR 0062). Files alone renders NOTHING richdocuments (byte-identical drive). - **`internal/clan/files_attach.go`**: `FilesLiveSet.DocsEditing` → `AttachFiles` derives `docs-editing.<apex>` from the SAME apex through the SAME authority (the mirror of `docsediting.go` deriving `files.<apex>`); refused, never fabricated, if the apex yields no editor host. - **`internal/clan/docsediting_attach.go`**: documents the pair-completion — whichever service attaches second, the orchestrator (holding both live sets) re-runs `AttachFiles` with `DocsEditing` set; docs-editing's own render declares the WOPI allow-list. - Private-path split-horizon carried in a comment (both legs SERVER-SIDE over the front door on the community-CA chain, no new bridge — the drive proves it, AC2). **AC1 (render tests)** green: `internal/clan/files_test.go` (both-placed renders the oneshot with the derived `wopi_url`; files-alone renders NOTHING richdocuments; ordered+idempotent oneshot) and `internal/clan/files_attach_test.go` (derived editor host / no-coupling). `go test ./internal/clan/ ./internal/provision/` passes. **AC2** (live private-path check) and the both-ticked edit-a-document e2e drive leg remain the noted out-of-scope e2e follow-up (extends `provision-nextcloud.live.spec.ts`).
ben closed this issue 2026-08-10 20:43:20 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Matou/idss#413
No description provided.