From 58f883b09e2e5874cb5ccb25c6a058ac72994727 Mon Sep 17 00:00:00 2001 From: pazpi Date: Wed, 4 Feb 2026 13:40:14 +0100 Subject: [PATCH] Configure collabora host --- hosts/caddy/default.nix | 6 ++++++ hosts/collabora/default.nix | 30 ++++++++++++++++++++++++++ hosts/hosts.nix | 9 ++++++++ hosts/parameters.nix | 1 + modules/services/nextcloud.nix | 39 +--------------------------------- 5 files changed, 47 insertions(+), 38 deletions(-) create mode 100644 hosts/collabora/default.nix diff --git a/hosts/caddy/default.nix b/hosts/caddy/default.nix index 5f8ed8a..16fee28 100644 --- a/hosts/caddy/default.nix +++ b/hosts/caddy/default.nix @@ -86,6 +86,12 @@ in host = p.hosts.nextcloud; }; + collabora-online.proxy = { + enable = true; + domain = p.domains.public; + host = p.hosts.collabora; + }; + paperless.proxy = { enable = true; domain = p.domains.public; diff --git a/hosts/collabora/default.nix b/hosts/collabora/default.nix new file mode 100644 index 0000000..aee2a13 --- /dev/null +++ b/hosts/collabora/default.nix @@ -0,0 +1,30 @@ +{ + config, + pkgs, + lib, + ... +}: +let + p = import ../parameters.nix; +in +{ + + my = { + utils = { + commons.enable = true; + lxc-standard.enable = true; + }; + + services.collabora-online = { + enable = true; + }; + + virtualisation.proxmox.enable = true; + }; + + # Extra packages + environment.systemPackages = with pkgs; [ ]; + + system.stateVersion = "24.11"; +} + diff --git a/hosts/hosts.nix b/hosts/hosts.nix index 8b006da..98e776b 100644 --- a/hosts/hosts.nix +++ b/hosts/hosts.nix @@ -204,6 +204,15 @@ ]; }; + collabora = { + module = ./collabora; + tags = [ + "lxc" + "bacco" + "collabora" + ]; + }; + # Special hosts (non-LXC or local deployment) # deadbeef = { # module = ./deadbeef; diff --git a/hosts/parameters.nix b/hosts/parameters.nix index 7f9267a..4135c59 100644 --- a/hosts/parameters.nix +++ b/hosts/parameters.nix @@ -33,6 +33,7 @@ in n8n = "n8n.${private-domain}"; ilpost-podcast = "ilpost-podcast.${private-domain}"; librenms = "librenms.${private-domain}"; + collabora = "collabora.${private-domain}"; }; email = "davide@${public-domain}"; } diff --git a/modules/services/nextcloud.nix b/modules/services/nextcloud.nix index 7fc7318..ba8fe3e 100644 --- a/modules/services/nextcloud.nix +++ b/modules/services/nextcloud.nix @@ -47,14 +47,6 @@ in ''; }; - officeSubdomain = lib.mkOption { - default = "office"; - type = lib.types.str; - description = '' - The subdomain where Collabora Online is reachable - ''; - }; - host = lib.mkOption { default = "localhost"; type = lib.types.str; @@ -106,11 +98,6 @@ in "OC\\Preview\\HEIC" "OC\\Preview\\Movie" ]; - memories = { - exiftool = "${lib.getExe pkgs.exiftool}"; - vod.ffmpeg = "${lib.getExe pkgs.ffmpeg-headless}"; - vod.ffprobe = "${pkgs.ffmpeg-headless}/bin/ffprobe"; - }; }; phpOptions = { @@ -143,7 +130,7 @@ in contacts calendar cookbook - cospend + # cospend tasks richdocuments ; @@ -151,27 +138,10 @@ in }; - collabora-online = { - enable = true; - settings = { - host = [ - ''127\.0\.0\.1'' - ]; - storage.wopi."@allow" = true; - }; - # hostname = "office.${cfg.proxy.domain}"; - }; - }; networking.firewall.allowedTCPPorts = [ 80 - config.services.collabora-online.port - ]; - - environment.systemPackages = with pkgs; [ - exiftool - ffmpeg ]; systemd.services."nextcloud-setup" = { @@ -187,13 +157,6 @@ in reverse_proxy http://${host}:80 import cloudflare_${domain} ''; - virtualHosts."${officeSubdomain}.${domain}".extraConfig = '' - import cloudflare_${domain} - reverse_proxy http://${host}:${toString config.services.collabora-online.port} { - # Required to circumvent bug of Onlyoffice loading mixed non-https content - header_up X-Forwarded-Proto https - } - ''; }; }) ];