blob: a74696239eb9439ca09378d20d3810cf99c33180 [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 = [
15 "--pull=newer"
16 ];
17 };
18 virtualisation.oci-containers.backend = "docker";
19
20 #Collabora Virtual Hosts
21 services.nginx.virtualHosts.${config.virtualisation.oci-containers.containers.collabora.environment.server_name} = {
22 serverAliases = [ "www.${config.virtualisation.oci-containers.containers.collabora.environment.server_name}" "docs.clicks.codes" "www.clicks.codes" ];
23 enableACME = true;
24 forceSSL = true;
25 addSSL = false;
26 listenAddresses = [ "0.0.0.0" ];
27
28 extraConfig = ''
29 location = / {
30 proxy_pass http://standard:9980;
31 proxy_set_header Host $host;
32 }
33
34 # static files
35 location ^~ /browser {
36 proxy_pass http://standard:9980;
37 proxy_set_header Host $host;
38 }
39
40 # WOPI discovery URL
41 location ^~ /hosting/discovery {
42 proxy_pass http://standard:9980;
43 proxy_set_header Host $host;
44 }
45
46 # Capabilities
47 location ^~ /hosting/capabilities {
48 proxy_pass http://standard:9980;
49 proxy_set_header Host $host;
50 }
51
52 # main websocket
53 location ~ ^/cool/(.*)/ws$ {
54 proxy_pass http://standard:9980;
55 proxy_set_header Upgrade $http_upgrade;
56 proxy_set_header Connection "Upgrade";
57 proxy_set_header Host $host;
58 proxy_read_timeout 36000s;
59 }
60
61 # download, presentation and image upload
62 location ~ ^/(c|l)ool {
63 proxy_pass http://standard:9980;
64 proxy_set_header Host $host;
65 }
66
67 # Admin Console websocket
68 location ^~ /cool/adminws {
69 proxy_pass http://standard:9980;
70 proxy_set_header Upgrade $http_upgrade;
71 proxy_set_header Connection "Upgrade";
72 proxy_set_header Host $host;
73 proxy_read_timeout 36000s;
74 }
75 '';
76 };
77}