diff --git a/docs/homelab.md b/docs/homelab.md index c57420c..8851d59 100644 --- a/docs/homelab.md +++ b/docs/homelab.md @@ -7,6 +7,16 @@ All of this configuration should be part of the backups, so it's only required t ### NextCloud +#### General + 1. Configured users -2. Configured the bookmarks app for internet access so it can fetch previews. + +#### Bookmarks app + +1. Configured the bookmarks app for internet access so it can fetch previews. + +#### Richdocuments app + +1. Configure URL of Collabora Online Server to point to the server +2. Configure Allow list to only allow 172.17.0.2 (IP of the collabora docker container) diff --git a/modules/nixos/adguard/default.nix b/modules/nixos/adguard/default.nix index 156bc19..b1fbfb4 100644 --- a/modules/nixos/adguard/default.nix +++ b/modules/nixos/adguard/default.nix @@ -121,6 +121,10 @@ in { domain = "adguard.ritter.family"; answer = config.my.homelab.directions.ip; } + { + domain = "collabora.ritter.family"; + answer = config.my.homelab.directions.ip; + } { domain = "fritz-box.ritter.family"; answer = config.my.homelab.directions.ip; diff --git a/modules/nixos/nextcloud/default.nix b/modules/nixos/nextcloud/default.nix index 1f23745..6131874 100644 --- a/modules/nixos/nextcloud/default.nix +++ b/modules/nixos/nextcloud/default.nix @@ -8,6 +8,7 @@ in { imports = [ ./memories.nix + ./richdocuments.nix ]; options.my.modules.nextcloud = { diff --git a/modules/nixos/nextcloud/richdocuments.nix b/modules/nixos/nextcloud/richdocuments.nix new file mode 100644 index 0000000..6b8aab0 --- /dev/null +++ b/modules/nixos/nextcloud/richdocuments.nix @@ -0,0 +1,44 @@ +{ + config, + lib, + ... +}: { + config = lib.mkIf config.services.nextcloud.enable { + # See https://collabora-online-for-nextcloud.readthedocs.io/en/latest/install/ + services.nextcloud = { + extraApps = { + inherit (config.services.nextcloud.package.packages.apps) richdocuments; + }; + }; + + virtualisation.oci-containers = lib.mkIf config.services.nextcloud.enable { + backend = "docker"; + containers = { + collabora-code = { + image = "collabora/code:24.04.7.2.1"; + ports = ["9980:9980"]; + environment = { + extra_params = "--o:ssl.enable=false --o:ssl.termination=true"; + }; + extraOptions = ["--cap-add=MKNOD"]; + }; + }; + }; + + systemd.services.nginx = { + after = ["docker-collabora-code.service"]; + requires = ["docker-collabora-code.service"]; + }; + + my.modules.https-proxy = { + enable = true; + configurations = [ + { + fqdn = "collabora.${config.my.host.name}.ritter.family"; + target = "http://localhost:9980"; + proxyWebsockets = true; + } + ]; + }; + }; +} diff --git a/systems/aarch64-linux/directions/configuration.nix b/systems/aarch64-linux/directions/configuration.nix index 5d6c233..476136d 100644 --- a/systems/aarch64-linux/directions/configuration.nix +++ b/systems/aarch64-linux/directions/configuration.nix @@ -19,6 +19,11 @@ https-proxy = { enable = true; configurations = [ + { + fqdn = "collabora.ritter.family"; + target = "https://collabora.srv-prod-2.ritter.family"; + proxyWebsockets = true; + } { fqdn = "fritz-box.ritter.family"; target = "https://${config.my.homelab.fritz-box.ip}";