feat: connect Nextcloud to an office suite; 34.0.3:2 -> 34.0.3:3 - #139
Merged
Conversation
Adds an Office Suite action selecting Collabora Online or ONLYOFFICE Docs, a conditional running dependency on the chosen one, and a generated Apache config that serves it from Nextcloud's own origin. Serving the editor from Nextcloud's own address is what makes it work on LAN, a domain and Tor at once rather than on whichever single address the document server was told to advertise. ONLYOFFICE derives its public URLs per request from X-Forwarded-*; Collabora writes an absolute origin into its discovery document, which Nextcloud copies into the editor frame verbatim, so the config rewrites it to a relative URL on the way through (nextcloud/richdocuments#6019). The bridge IP joins trusted_domains while a suite is selected. A document server fetches and saves over the bridge, and Nextcloud otherwise answers every one of those requests with `Trusted domain error` — the editor opens and then fails to load the document, which no check on the Collabora side catches. The office-connectors health check fails while a second office connector app is enabled. richdocuments drops the Microsoft formats the moment it sees a rival (CapabilitiesService::hasOtherOOXMLApps), and the rival does not claim them unless it is configured too, so Word, Excel and PowerPoint open in neither and silently download. A check rather than a task, which can be dismissed while the breakage remains. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Both engines round-trip a complex Word document without losing anything — measured on calibre's demo.docx: identical text, and every table, cell, image, hyperlink, bookmark, footnote, endnote and field count preserved by each. They differ in how they write it back. ONLYOFFICE returns the file structurally byte-identical. LibreOffice resolves style-inherited formatting into direct formatting on each run (w:rPr 260 -> 826, w:rFonts 82 -> 503, w:color 66 -> 403), which is invisible on screen but stops later style changes cascading in Word. It converges after one pass rather than growing without bound. That is a narrow reason to spend four times the memory, so the action labels Collabora recommended and the instructions say when the other one is worth it. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
…y Registry The per-run formatting Collabora writes out costs nothing on one document — it is invisible on screen and repairable by hand. It only earns four times the memory across a large corpus of style-dependent documents that keeps cycling back to Word, so say that rather than "moves back and forth with Office". Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This was referenced Sep 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Connects Nextcloud to an office suite, via the two new packages
collabora-online-startos and
onlyoffice-docs-startos.
What it adds
runningdependency on the chosen service.startos-office.confand its four proxy modules, written into the container on every start, serving the document server from Nextcloud's own origin.office-connectorshealth check, present only while a suite is selected.The connector app itself stays user-installed, following the Talk/Coturn precedent already in this package.
Why the editor is served from Nextcloud's origin
Both document servers can only be told one browser-facing address, so any instance reachable at more than one — a LAN address and a public domain, or a
.onion— would get a working editor on exactly one of them. Proxying under Nextcloud's own origin removes the choice: the editor is always served from whichever address the browser already holds. It also means neither service needs an address, a certificate or a domain of its own, and both stay off the LAN entirely.ONLYOFFICE derives its public URLs per request from
X-Forwarded-Host/-Proto/-Prefix, so a prefix and those headers are all it needs. Collabora writes an absolute origin into its WOPI discovery document, which Nextcloud caches and copies into the editor frame verbatim — so the config rewrites that origin out withmod_substitute, leaving a root-relativeurlsrcthe browser resolves itself. Filed upstream as nextcloud/richdocuments#6019; if it lands, the rewrite can go.Two failures worth calling out
trusted_domains. The existing mapper excludes bridge addresses. A document server fetches and saves over the bridge, so without the bridge IP every one of those requests comes back{"error": "Trusted domain error.", "code": 15}— the editor opens and then fails to load the document. Nothing on the Collabora side catches this:richdocuments:activate-configpasses all four of its checks, because it only exercises discovery and capabilities, never the callback leg.A second office connector.
richdocumentsdrops the Microsoft formats out of its default-open capability whenever it findsonlyofficeorofficeonlineenabled (CapabilitiesService::hasOtherOOXMLApps), and the rival does not claim them unless it is configured too. Word, Excel and PowerPoint then open in neither and silently download, with nothing in Nextcloud saying why. Hence a failing health check naming the app to disable, rather than a task, which can be dismissed while the breakage remains.Verified on a dev box
richdocuments:activate-configpasses discovery, mimetype, capabilities and WOPI-server checks, with an empty public URL — which is what a relativeurlsrcproduces.occ onlyoffice:documentserver --checkreports the document server connected at/ds-vpath/, a real conversion round-trip that exercises the relative URL, the proxy, the JWT pairing and the download over the bridge./cool/wsand the encoded-slash compat form.