blob: e76613bcea9490eaa86b3ae363b6f6ad33d78ab3 [file] [log] [blame]
Skyler Grey22428b02023-11-19 13:20:56 +00001{ config, ... }: {
2 #Collabora Containers
3 virtualisation.oci-containers.containers.collabora = {
4 image = "collabora/code:latest";
5 ports = [ "9980:9980/tcp" ];
6 environment = {
7 server_name = "collabora.clicks.codes";
8 aliasgroup1 = "https://nextcloud.clicks.codes:443";
9 aliasgroup2 = "https://cloud.clicks.codes:443";
10 aliasgroup3 = "https://docs.clicks.codes:443";
11 dictionaries = "en_US";
12 extra_params = "--o:ssl.enable=false --o:ssl.termination=true";
13 };
14 extraOptions = [
Skyler Grey915067d2023-12-03 13:46:53 +000015 "--pull=always"
Skyler Grey7bad08a2024-02-07 21:59:46 +000016 "--privileged" # needed for fast jail creation via bind mounts
Skyler Grey22428b02023-11-19 13:20:56 +000017 ];
18 };
19 virtualisation.oci-containers.backend = "docker";
20
21 #Collabora Virtual Hosts
22 services.nginx.virtualHosts.${config.virtualisation.oci-containers.containers.collabora.environment.server_name} = {
23 serverAliases = [ "www.${config.virtualisation.oci-containers.containers.collabora.environment.server_name}" "docs.clicks.codes" "www.clicks.codes" ];
24 enableACME = true;
25 forceSSL = true;
26 addSSL = false;
27 listenAddresses = [ "0.0.0.0" ];
28
29 extraConfig = ''
30 location = / {
31 proxy_pass http://standard:9980;
32 proxy_set_header Host $host;
33 }
34
35 # static files
36 location ^~ /browser {
37 proxy_pass http://standard:9980;
38 proxy_set_header Host $host;
39 }
40
41 # WOPI discovery URL
42 location ^~ /hosting/discovery {
43 proxy_pass http://standard:9980;
44 proxy_set_header Host $host;
45 }
46
47 # Capabilities
48 location ^~ /hosting/capabilities {
49 proxy_pass http://standard:9980;
50 proxy_set_header Host $host;
51 }
52
53 # main websocket
54 location ~ ^/cool/(.*)/ws$ {
55 proxy_pass http://standard:9980;
56 proxy_set_header Upgrade $http_upgrade;
57 proxy_set_header Connection "Upgrade";
58 proxy_set_header Host $host;
59 proxy_read_timeout 36000s;
60 }
61
62 # download, presentation and image upload
63 location ~ ^/(c|l)ool {
64 proxy_pass http://standard:9980;
65 proxy_set_header Host $host;
66 }
67
68 # Admin Console websocket
69 location ^~ /cool/adminws {
70 proxy_pass http://standard:9980;
71 proxy_set_header Upgrade $http_upgrade;
72 proxy_set_header Connection "Upgrade";
73 proxy_set_header Host $host;
74 proxy_read_timeout 36000s;
75 }
76 '';
77 };
78}