| { config, ... }: { |
| #Collabora Containers |
| virtualisation.oci-containers.containers.collabora = { |
| image = "collabora/code:latest"; |
| ports = [ "9980:9980/tcp" ]; |
| environment = { |
| server_name = "collabora.clicks.codes"; |
| aliasgroup1 = "https://nextcloud.clicks.codes:443"; |
| aliasgroup2 = "https://cloud.clicks.codes:443"; |
| aliasgroup3 = "https://docs.clicks.codes:443"; |
| dictionaries = "en_US"; |
| extra_params = "--o:ssl.enable=false --o:ssl.termination=true"; |
| }; |
| extraOptions = [ |
| "--pull=newer" |
| ]; |
| }; |
| virtualisation.oci-containers.backend = "docker"; |
| |
| #Collabora Virtual Hosts |
| services.nginx.virtualHosts.${config.virtualisation.oci-containers.containers.collabora.environment.server_name} = { |
| serverAliases = [ "www.${config.virtualisation.oci-containers.containers.collabora.environment.server_name}" "docs.clicks.codes" "www.clicks.codes" ]; |
| enableACME = true; |
| forceSSL = true; |
| addSSL = false; |
| listenAddresses = [ "0.0.0.0" ]; |
| |
| extraConfig = '' |
| location = / { |
| proxy_pass http://standard:9980; |
| proxy_set_header Host $host; |
| } |
| |
| # static files |
| location ^~ /browser { |
| proxy_pass http://standard:9980; |
| proxy_set_header Host $host; |
| } |
| |
| # WOPI discovery URL |
| location ^~ /hosting/discovery { |
| proxy_pass http://standard:9980; |
| proxy_set_header Host $host; |
| } |
| |
| # Capabilities |
| location ^~ /hosting/capabilities { |
| proxy_pass http://standard:9980; |
| proxy_set_header Host $host; |
| } |
| |
| # main websocket |
| location ~ ^/cool/(.*)/ws$ { |
| proxy_pass http://standard:9980; |
| proxy_set_header Upgrade $http_upgrade; |
| proxy_set_header Connection "Upgrade"; |
| proxy_set_header Host $host; |
| proxy_read_timeout 36000s; |
| } |
| |
| # download, presentation and image upload |
| location ~ ^/(c|l)ool { |
| proxy_pass http://standard:9980; |
| proxy_set_header Host $host; |
| } |
| |
| # Admin Console websocket |
| location ^~ /cool/adminws { |
| proxy_pass http://standard:9980; |
| proxy_set_header Upgrade $http_upgrade; |
| proxy_set_header Connection "Upgrade"; |
| proxy_set_header Host $host; |
| proxy_read_timeout 36000s; |
| } |
| ''; |
| }; |
| } |