chore: move collabora-office to own file

This commit is contained in:
Felix Schröter 2023-09-29 22:45:34 +02:00
parent 3f073a83c4
commit 9aa9ef973f
Signed by: felschr
GPG key ID: 671E39E6744C807D
3 changed files with 36 additions and 33 deletions

View file

@ -31,6 +31,7 @@ in with builtins; {
../services/miniflux.nix ../services/miniflux.nix
../services/paperless.nix ../services/paperless.nix
../services/nextcloud.nix ../services/nextcloud.nix
../services/collabora-office.nix
../services/calibre-web.nix ../services/calibre-web.nix
../services/focalboard.nix ../services/focalboard.nix
]; ];

View file

@ -0,0 +1,35 @@
_:
{
virtualisation.oci-containers.containers.collabora-office = {
image = "docker.io/collabora/code";
ports = [ "9980:9980" ];
environment = let
mkAlias = domain:
"https://" + (builtins.replaceStrings [ "." ] [ "\\." ] domain)
+ ":443";
in {
server_name = "office.felschr.com";
aliasgroup1 = mkAlias "office.felschr.com";
aliasgroup2 = mkAlias "cloud.felschr.com";
extra_params = "--o:ssl.enable=false --o:ssl.termination=true";
};
extraOptions = [
"--network=host"
"--cap-add=MKNOD"
"--label=io.containers.autoupdate=registry"
];
};
services.nginx.virtualHosts."office.felschr.com" = {
forceSSL = true;
enableACME = true;
locations."/" = {
proxyPass = "http://127.0.0.1:9980";
proxyWebsockets = true;
extraConfig = ''
proxy_read_timeout 36000s;
'';
};
};
}

View file

@ -37,39 +37,6 @@ in {
}]; }];
}; };
# Office
# TODO move to own config
virtualisation.oci-containers.containers.collabora-office = {
image = "docker.io/collabora/code";
ports = [ "9980:9980" ];
environment = let
mkAlias = domain:
"https://" + (builtins.replaceStrings [ "." ] [ "\\." ] domain)
+ ":443";
in {
server_name = "office.felschr.com";
aliasgroup1 = mkAlias "office.felschr.com";
aliasgroup2 = mkAlias "cloud.felschr.com";
extra_params = "--o:ssl.enable=false --o:ssl.termination=true";
};
extraOptions = [
"--network=host"
"--cap-add=MKNOD"
"--label=io.containers.autoupdate=registry"
];
};
services.nginx.virtualHosts."office.felschr.com" = {
forceSSL = true;
enableACME = true;
locations."/" = {
proxyPass = "http://127.0.0.1:9980";
proxyWebsockets = true;
extraConfig = ''
proxy_read_timeout 36000s;
'';
};
};
# ensure that postgres is running *before* running the setup # ensure that postgres is running *before* running the setup
systemd.services."nextcloud-setup" = { systemd.services."nextcloud-setup" = {
requires = [ "postgresql.service" ]; requires = [ "postgresql.service" ];