Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nixos/loolwsd: init - LibreOffice/Collabora Online #77383

Open
wants to merge 6 commits into
base: master
from

Conversation

@mmilata
Copy link
Contributor

mmilata commented Jan 9, 2020

This PR adds LibreOffice Online service which can be integrated into Nextcloud for collaborative document editing.

It also adds Collabora Online CODE service which is a LibreOffice Online variant that is intended to be more stable and has available commercial support. Originally it was not my intention to package both but it's what I ended up with during the quest for reliable service, even got permission from Collabora to package it. Question for reviewers: should NixOS ship both packages or just the upstream one (LibreOffice Online)? The downside to adding Collabora Online is that it adds third LibreOffice variant to eat Hydra compute resources.

There are three parts:

  • libreoffice-online package that provides websocket daemon interfacing with LibreOffice API, and javascript frontend that can talk to the daemon
  • NixOS module for running the daemon with optional nginx reverse proxy
  • (optional) collabora-office package, a third variant of LibreOffice, and collabora-online which is the libreoffice-online package built from different git branch and against the collabora-office package

Rendered part of NixOS manual describing setup with NextCloud

Motivation for this change

Self-hosted collaborative document editing on NixOS.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is > b up to date
  • Fits CONTRIBUTING.md.
TODO
  • crash on Insert > Image
  • crash on Download As PDF
  • add setup instructions to Nextcloud module documentation
    • document that Insert > Image does not work with self-signed certificate
  • font file build grep hack
  • speed up chroot initialization
    • LO_PATH cannot be hardlinked because it points to /nix/store (cross-device, different owner), also it's set at compile time
    • try to minimize the closure copied to /var/lib/lool/systemplate
  • enable systemd sandboxing options
  • set DICPATH to point to hunspell dictionaries
  • build underlying libreoffice-core with unnecessary features disabled (e.g. gui)
  • tests are disabled
  • check with Collabora wrt trademark compliance

    From: Jan Holesovsky <kendy at collabora dot com>
    I confirm it is OK to use the Collabora name for the CODE NixOS
    packages, provided that

    • you keep the limits on the documents & connections, and
    • you use the CODE branding for the builds
@mmilata mmilata force-pushed the otevrenamesta:lool branch from f4d1779 to 7a0c433 Jan 9, 2020
@ofborg ofborg bot requested a review from 7c6f434c Jan 9, 2020
@mmahut mmahut self-assigned this Jan 17, 2020
@mmahut

This comment has been minimized.

Copy link
Member

mmahut commented Jan 17, 2020

Thank you for working on this, it would be very useful to have this in nixpkgs.

@mmahut

This comment has been minimized.

Copy link
Member

mmahut commented Jan 17, 2020

@GrahamcOfBorg build libreoffice-online

@mmilata mmilata force-pushed the otevrenamesta:lool branch 2 times, most recently from 3ed9955 to abacc29 Jan 30, 2020
@mmahut

This comment has been minimized.

Copy link
Member

mmahut commented Feb 1, 2020

@GrahamcOfBorg build libreoffice-online

@mmilata mmilata force-pushed the otevrenamesta:lool branch 6 times, most recently from 4f19807 to 567a545 Feb 3, 2020
mmilata added 3 commits Jan 9, 2020
Add LibreOffice WebSocket Daemon.
collabora-online: init
@mmilata mmilata force-pushed the otevrenamesta:lool branch from ccf6399 to 691b292 Feb 24, 2020
@mmilata mmilata marked this pull request as ready for review Feb 24, 2020
@mmilata mmilata requested a review from Infinisil as a code owner Feb 24, 2020
@mmilata mmilata requested a review from mmahut Feb 24, 2020
@nixos-discourse

This comment has been minimized.

Copy link

nixos-discourse commented Feb 24, 2020

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/prs-ready-for-review-may-2019/3032/120

@mmahut

This comment has been minimized.

Copy link
Member

mmahut commented Feb 25, 2020

@GrahamcOfBorg build libreoffice-online collabora-office collabora-online

@mmahut mmahut requested a review from aanderse Feb 25, 2020
];

passthru = {
libreoffice = libreoffice-core;

This comment has been minimized.

Copy link
@mmilata

mmilata Mar 12, 2020

Author Contributor

Probably have to add libreoffice-core to propagatedBuildInputs? I don't see it in nix-store -qR /nix/store/xyz-libreofficeonline and ldd loolwsd doesn't show it either.

@mmahut

This comment has been minimized.

Copy link
Member

mmahut commented Mar 13, 2020

@aanderse I know you are pretty busy, but would you be able to glance at this, please?

@aanderse

This comment has been minimized.

Copy link
Contributor

aanderse commented Mar 13, 2020

@aanderse I know you are pretty busy, but would you be able to glance at this, please?

@mmahut the big problem for me to review this is that the application in this PR is so massive. To move forward with this PR I would suggest we break it down into fairly topic specific areas to review and find subject experts on each of those topics. I would also suggest we find someone with more than basic LibreOffice/Collabora Online experience to review this as well.

If a test could be written that would also be fantastic - even if that test can't be executed by the bot, it would give people the ability to setup a basic config, in a container perhaps, and run the test locally, poke around the internals, ensure everything is working as it should be.

I think this module would be of high value to the NixOS ecosystem, but without proper review and validation the best I could suggest is that maybe this make its way to NUR and gestate there... so shall break this PR down into conceptual components and find some subject experts to review individual parts?

@mmilata

This comment has been minimized.

Copy link
Contributor Author

mmilata commented Mar 20, 2020

@aanderse thanks for looking into this peculiar piece of software. I've added a simple test, though I can't get it to run on my system (even though in libvirt qemu almost identical configuration works fine), investigating. Anyway there's not much to test (without using something like Selenium) besides the service successfully starting.

Please let me know what to do to make this easier. I can provide access to a VM where this is deployed to anyone interested, just send me your ssh key over IRC (my nick is b42). If this turns out to be difficult I agree we can move this to NUR for the time being.

mmilata added 2 commits Mar 20, 2020
Some of them are very large and they are not used because we pass
--without-fonts to configure.
@7c6f434c

This comment has been minimized.

Copy link
Member

7c6f434c commented Mar 20, 2020

For the record, we do have a VM test where a web browser is launched, then some keystrokes are sent to click the desired element, then OCR verifies if the expected text is on the screen. WebDriver would be indeed better in this case, but probably doesn't have an example to start with.

@Mic92

This comment has been minimized.

Copy link
Contributor

Mic92 commented Mar 20, 2020

For the record, we do have a VM test where a web browser is launched, then some keystrokes are sent to click the desired element, then OCR verifies if the expected text is on the screen. WebDriver would be indeed better in this case, but probably doesn't have an example to start with.

That sounds quite brittle. I would prefer a simpler test.

Author: Martin Milata <martin@martinmilata.cz>
Date: Thu Jan 30 17:44:31 2020 +0100

tdf#129895: handle symlinks when populating chroot

This comment has been minimized.

Copy link
@Mic92

Mic92 Mar 20, 2020

Contributor

Did you also send this to upstream?

This comment has been minimized.

Copy link
@mmilata
#else
std::string forKitPath = Path(Application::instance().commandPath()).parent().toString() + "loolforkit";
+
+ const char *envPath = std::getenv("LOOL_FORKIT_PATH");

This comment has been minimized.

Copy link
@Mic92

Mic92 Mar 20, 2020

Contributor

Upstream might also accept this one.

@@ -0,0 +1,4675 @@
# This file has been generated by node2nix 1.7.0. Do not edit!

This comment has been minimized.

Copy link
@Mic92

Mic92 Mar 20, 2020

Contributor

I would prefer this one to be integrated into pkgs/development/node-packages/node-packages-v10.json:

We do this for other packages as well, i.e.:

, { "iosevka-build-deps": "../../data/fonts/iosevka" }

Thanks!

@Mic92

This comment has been minimized.

Copy link
Contributor

Mic92 commented Mar 20, 2020

One question regarding libreoffice-online and collabora-office: Which one do we need for nextcloud and what is the functional difference.

@Mic92

This comment has been minimized.

Copy link
Contributor

Mic92 commented Mar 20, 2020

I would have a beefy machine to compile this beast.

@Mic92 Mic92 self-assigned this Mar 20, 2020
@mmilata

This comment has been minimized.

Copy link
Contributor Author

mmilata commented Mar 20, 2020

One question regarding libreoffice-online and collabora-office: Which one do we need for nextcloud and what is the functional difference.

For nextcloud you can choose between libreoffice-online (which has libreoffice-fresh as a dependency) or collabora-online (which has collabora-office) as a dependency. The collabora-* packages are based on older version of LibreOffice and are supposed to be more stable/polished. I think most nextcloud users use collabora-online because they have docker image available that is easy to use.

@Mic92

This comment has been minimized.

Copy link
Contributor

Mic92 commented Mar 20, 2020

One question regarding libreoffice-online and collabora-office: Which one do we need for nextcloud and what is the functional difference.

For nextcloud you can choose between libreoffice-online (which has libreoffice-fresh as a dependency) or collabora-online (which has collabora-office) as a dependency. The collabora-* packages are based on older version of LibreOffice and are supposed to be more stable/polished. I think most nextcloud users use collabora-online because they have docker image available that is easy to use.

Ok. Does libreoffice-online has any other use cases that might be relevant for nixpkgs? Otherwise I would go with collobora-online.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

6 participants
You can’t perform that action at this time.