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

Closed
wants to merge 9 commits into from

Conversation

mmilata
Copy link
Member

@mmilata 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

@mmahut
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
Copy link
Member

mmahut commented Jan 17, 2020

@GrahamcOfBorg build libreoffice-online

@mmahut
Copy link
Member

mmahut commented Feb 1, 2020

@GrahamcOfBorg build libreoffice-online

@nixos-discourse
Copy link

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
Copy link
Member

mmahut commented Feb 25, 2020

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

@mmahut mmahut requested a review from aanderse February 25, 2020 09:59
];

passthru = {
libreoffice = libreoffice-core;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
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
Copy link
Member

@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?

@sorki
Copy link
Member

sorki commented Feb 23, 2021

Added a simplified test without nextcloud. Sadly loolforkit now dumps core - https://gist.github.com/sorki/48997cb80f85b9f4bfde8dbc0e39e6fb which seems to be caused by the rebase. I've pushed a prior-rebase backup to https://github.com/otevrenamesta/nixpkgs/tree/lool-b to be able to bisect.

@Pacman99
Copy link
Contributor

I narrowed down my error further. The lool user cannot connect to the nix daemon to use nix-store. I was able to get the same error like this:

sudo -u lool bash
nix-store --query --requisites /nix/store/8bcc24znygvjgxxhn1hxlag753w112ck-libreoffice-7.0.4.2/

which outputs:

error: --- Error ----------------------------------------------------- nix-store
cannot open connection to remote store 'daemon': error: --- SysError -------------------------------------------------- nix-store
reading from file: Connection reset by peer

@sorki
Copy link
Member

sorki commented Mar 11, 2021

Maybe the chroot closure can be prepared before, so the nix-store --query call is not needed in service.

I was tracking down the SIGABRT issue and the last relevant strace message is the loolforkit service loading
/nix/store/gnrc4wjydnvz74mh6z683yd63k59sh7g-dejavu-fonts-2.37/share/fonts/truetype/DejaVuMathTeXGyre.ttf. Pretty weird.

@Pacman99
Copy link
Contributor

Pacman99 commented May 5, 2021

I figured out my issue, its because I had nix.allowedUsers set, so the lool user wasn't able to connect to the nix daemon.

I don't think this is something to worry about since allowedUsers is set to "*" by default and some other nixos modules work on this assumption.

@sorki
Copy link
Member

sorki commented May 6, 2021

I figured out my issue, its because I had nix.allowedUsers set, so the lool user wasn't able to connect to the nix daemon.

I don't think this is something to worry about since allowedUsers is set to "*" by default and some other nixos modules work on this assumption.

Sounds good.

Btw - you have this based on older commit or using this rebased version? If it's on the older one would you upload it somewhere or just paste the nixpkgs commit it is based on so I can possibly bisect between that and the commit this is currently based on?

@Pacman99
Copy link
Contributor

Pacman99 commented May 6, 2021

I believe I'm using an older commit:
a1cbe120c84d6b8125f889cef3713e2dd1762c14
But I'm not entirely sure because I just copied the files to my server's flake.

This is the module I'm using: https://gitlab.com/coffeetablebrothers/myrdd/-/blob/master/modules/loolwsd.nix
And in the same repo I coped over the libreoffice-online package into the pkgs folder.

@@ -1,4 +1,4 @@
{ stdenv, fetchurl, lib, pam, python3, libxslt, perl, ArchiveZip, box2d, gettext
{ stdenv, fetchurl, fetchFromGitHub, lib, pam, python3, libxslt, perl, ArchiveZip, box2d, gettext
Copy link
Contributor

@Pacman99 Pacman99 Jul 16, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
{ stdenv, fetchurl, fetchFromGitHub, lib, pam, python3, libxslt, perl, ArchiveZip, box2d, gettext
{ stdenv, fetchurl, fetchFromGitHub, fetchpatch, lib, pam, python3, libxslt, perl, ArchiveZip, box2d, gettext

needed for collabora's override.nix

@stale
Copy link

stale bot commented Apr 25, 2022

I marked this as stale due to inactivity. → More info

@stale stale bot added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Apr 25, 2022
@drupol
Copy link
Contributor

drupol commented Jul 26, 2022

What's the status of this ?

@stale stale bot removed the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Jul 26, 2022
@RaitoBezarius
Copy link
Member

How can I help to get this PR merged? It is super cool!

@mmilata
Copy link
Member Author

mmilata commented Dec 1, 2022

AFAIK nobody is working on this. To get it merged you'd need to take over the branch, update to latest nixpkgs & loolwsd, and address the outstanding issues ...

@drupol
Copy link
Contributor

drupol commented Dec 2, 2022

@RaitoBezarius You think need to talk with @Minion3665

@Minion3665
Copy link
Member

Thanks the the ping pol,

@RaitoBezarius I started looking at this in the summer but haven't worked on it for a while due to other responsibilities

I'd be happy to work with you on it now though if you're interested

@RaitoBezarius
Copy link
Member

Thanks the the ping pol,

@RaitoBezarius I started looking at this in the summer but haven't worked on it for a while due to other responsibilities

I'd be happy to work with you on it now though if you're interested

I might not have full bandwidth to drive the efforts by myself, but I am very interested into following the work and helping as much as I can. It would be really nice to have this in NixOS.

@Mic92
Copy link
Member

Mic92 commented Dec 18, 2022

Closing because of lack of activity from the author. Please re-open if you start working on this again.

@Mic92 Mic92 closed this Dec 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet