Skyler Grey | 22428b0 | 2023-11-19 13:20:56 +0000 | [diff] [blame] | 1 | { 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"; |
Skyler Grey | efb3ee2 | 2024-03-22 11:21:01 +0000 | [diff] [blame^] | 9 | aliasgroup2 = "https://www.nextcloud.clicks.codes:443"; |
Skyler Grey | 22428b0 | 2023-11-19 13:20:56 +0000 | [diff] [blame] | 10 | dictionaries = "en_US"; |
| 11 | extra_params = "--o:ssl.enable=false --o:ssl.termination=true"; |
| 12 | }; |
Skyler Grey | efb3ee2 | 2024-03-22 11:21:01 +0000 | [diff] [blame^] | 13 | extraOptions = [ |
Skyler Grey | 915067d | 2023-12-03 13:46:53 +0000 | [diff] [blame] | 14 | "--pull=always" |
Skyler Grey | 7bad08a | 2024-02-07 21:59:46 +0000 | [diff] [blame] | 15 | "--privileged" # needed for fast jail creation via bind mounts |
Skyler Grey | 22428b0 | 2023-11-19 13:20:56 +0000 | [diff] [blame] | 16 | ]; |
| 17 | }; |
| 18 | virtualisation.oci-containers.backend = "docker"; |
| 19 | |
| 20 | #Collabora Virtual Hosts |
Skyler Grey | efb3ee2 | 2024-03-22 11:21:01 +0000 | [diff] [blame^] | 21 | services.nginx.virtualHosts.${config.virtualisation.oci-containers.containers.collabora.environment.server_name} = |
| 22 | { |
| 23 | serverAliases = [ |
| 24 | "www.${config.virtualisation.oci-containers.containers.collabora.environment.server_name}" |
| 25 | "docs.clicks.codes" |
| 26 | "www.docs.clicks.codes" |
| 27 | ]; |
| 28 | enableACME = true; |
| 29 | forceSSL = true; |
| 30 | addSSL = false; |
| 31 | listenAddresses = [ "0.0.0.0" ]; |
Skyler Grey | 22428b0 | 2023-11-19 13:20:56 +0000 | [diff] [blame] | 32 | |
Skyler Grey | efb3ee2 | 2024-03-22 11:21:01 +0000 | [diff] [blame^] | 33 | extraConfig = '' |
| 34 | location = / { |
| 35 | proxy_pass http://standard:9980; |
| 36 | proxy_set_header Host $host; |
| 37 | } |
Skyler Grey | 22428b0 | 2023-11-19 13:20:56 +0000 | [diff] [blame] | 38 | |
Skyler Grey | efb3ee2 | 2024-03-22 11:21:01 +0000 | [diff] [blame^] | 39 | # static files |
| 40 | location ^~ /browser { |
| 41 | proxy_pass http://standard:9980; |
| 42 | proxy_set_header Host $host; |
| 43 | } |
Skyler Grey | 22428b0 | 2023-11-19 13:20:56 +0000 | [diff] [blame] | 44 | |
Skyler Grey | efb3ee2 | 2024-03-22 11:21:01 +0000 | [diff] [blame^] | 45 | # WOPI discovery URL |
| 46 | location ^~ /hosting/discovery { |
| 47 | proxy_pass http://standard:9980; |
| 48 | proxy_set_header Host $host; |
| 49 | } |
Skyler Grey | 22428b0 | 2023-11-19 13:20:56 +0000 | [diff] [blame] | 50 | |
Skyler Grey | efb3ee2 | 2024-03-22 11:21:01 +0000 | [diff] [blame^] | 51 | # Capabilities |
| 52 | location ^~ /hosting/capabilities { |
| 53 | proxy_pass http://standard:9980; |
| 54 | proxy_set_header Host $host; |
| 55 | } |
Skyler Grey | 22428b0 | 2023-11-19 13:20:56 +0000 | [diff] [blame] | 56 | |
Skyler Grey | efb3ee2 | 2024-03-22 11:21:01 +0000 | [diff] [blame^] | 57 | # main websocket |
| 58 | location ~ ^/cool/(.*)/ws$ { |
| 59 | proxy_pass http://standard:9980; |
| 60 | proxy_set_header Upgrade $http_upgrade; |
| 61 | proxy_set_header Connection "Upgrade"; |
| 62 | proxy_set_header Host $host; |
| 63 | proxy_read_timeout 36000s; |
| 64 | } |
Skyler Grey | 22428b0 | 2023-11-19 13:20:56 +0000 | [diff] [blame] | 65 | |
Skyler Grey | efb3ee2 | 2024-03-22 11:21:01 +0000 | [diff] [blame^] | 66 | # download, presentation and image upload |
| 67 | location ~ ^/(c|l)ool { |
| 68 | proxy_pass http://standard:9980; |
| 69 | proxy_set_header Host $host; |
| 70 | } |
Skyler Grey | 22428b0 | 2023-11-19 13:20:56 +0000 | [diff] [blame] | 71 | |
Skyler Grey | efb3ee2 | 2024-03-22 11:21:01 +0000 | [diff] [blame^] | 72 | # Admin Console websocket |
| 73 | location ^~ /cool/adminws { |
| 74 | proxy_pass http://standard:9980; |
| 75 | proxy_set_header Upgrade $http_upgrade; |
| 76 | proxy_set_header Connection "Upgrade"; |
| 77 | proxy_set_header Host $host; |
| 78 | proxy_read_timeout 36000s; |
| 79 | } |
| 80 | ''; |
| 81 | }; |
Skyler Grey | 22428b0 | 2023-11-19 13:20:56 +0000 | [diff] [blame] | 82 | } |