From 5411281d95c1e56e003ddc8b4b10939ded6b6210 Mon Sep 17 00:00:00 2001 From: Manuel Thalmann Date: Wed, 4 Dec 2024 16:59:30 +0100 Subject: [PATCH] Fix collabora service --- .../docker/services/nextcloud/main.fish | 34 +++++++++++++++++-- 1 file changed, 32 insertions(+), 2 deletions(-) diff --git a/scripts/Common/Software/docker/services/nextcloud/main.fish b/scripts/Common/Software/docker/services/nextcloud/main.fish index 1bca8410..bbff0f9d 100644 --- a/scripts/Common/Software/docker/services/nextcloud/main.fish +++ b/scripts/Common/Software/docker/services/nextcloud/main.fish @@ -93,10 +93,40 @@ begin end end - function getServiceLocations -V services -a index + function getServiceLocations -V services -V office -a index set -l i (math (math (math $index - 1) / 2 "*" 3) + 1) set -l name $services[$i] - printf "%s\0" "$name" / + + if [ "$name" != "$office" ] + printf "%s\0" "$name" / "" + else + printf "%s\0" \ + "$name" "^~ /browser" "static files" \ + "$name" "^~ /hosting/discovery" "WOPI discovery URL" \ + "$name" "^~ /hosting/capabilities" "Capabilities" \ + "$name" "~ ^/cool/(.*)/ws\$" "main websocket" \ + "$name" "~ ^/(c|l)ool" "download, presentation and image upload" \ + "$name" "^~ /cool/adminws" "Admin Console websocket" + end + end + + function getServiceLocationConfig -a domain s location -V office -V flood + if [ "$s" = "$office" ] + set -l argv $argv[4..] + getServiceDefaultProxy $domain $s "$location" --scheme https $argv + else + getServiceDefaultProxy $argv --path "$location" + end + end + + function getExtraLocationSettings -a domain s location -V service + if string match --regex '^(~ \^|\^~ )/cool/(.*)ws\$?$' "$location" >/dev/null + printf "%s\n" \ + '# Websocket' \ + "proxy_http_version 1.1;" \ + 'proxy_set_header Upgrade $http_upgrade;' \ + 'proxy_set_header Connection "upgrade";' + end end function getExtraBackupPatterns