From ca44e0c385984b6fbc4feaa2cf63cfe43fa65690 Mon Sep 17 00:00:00 2001 From: sonicaj Date: Tue, 19 Oct 2021 20:13:52 +0500 Subject: [PATCH] Update service name usages in nginx configuration --- test/collabora/1.0.0/questions.yaml | 4 ++-- test/collabora/1.0.0/templates/nginx-conf.yaml | 16 ++++++++++------ 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/test/collabora/1.0.0/questions.yaml b/test/collabora/1.0.0/questions.yaml index 5fcf46624d..96bbaaaec3 100644 --- a/test/collabora/1.0.0/questions.yaml +++ b/test/collabora/1.0.0/questions.yaml @@ -64,7 +64,7 @@ questions: description: 'e.g. "--o:welcome.enable=false", See more on /etc/loolwsd/loowsd.xml. Separate params with space' schema: type: string - default: "--o:welcome.enable=false --o:user_interface.mode=notebookbar --o:ssl.termination=true --o:ssl.enable=false --o:net.proto=IPv4" + default: "--o:welcome.enable=false --o:user_interface.mode=notebookbar --o:ssl.termination=true --o:ssl.enable=false --o:net.proto=IPv4 --o:net.post_allow.host[0]=.+ --o:storage.wopi.host[0]=.+" - variable: DONT_GEN_SSL_CERT label: "DONT_GEN_SSL_CERT" description: "When set to true it does NOT generate an SSL cert, you have to use your own" @@ -82,7 +82,6 @@ questions: schema: type: string default: '' - valid_chars: '^$|^[a-z]{1,}\\{1}\.{1}[a-z]{1,}\\{1}\.{1}[a-z]{1,}$' - variable: certificate description: "Collabora Certificate" @@ -92,6 +91,7 @@ questions: type: int $ref: - "definitions/certificate" + null: false - variable: extraAppVolumeMounts label: "Collabora Extra Host Path Volumes" diff --git a/test/collabora/1.0.0/templates/nginx-conf.yaml b/test/collabora/1.0.0/templates/nginx-conf.yaml index bf651f7450..c5e3fe889c 100644 --- a/test/collabora/1.0.0/templates/nginx-conf.yaml +++ b/test/collabora/1.0.0/templates/nginx-conf.yaml @@ -1,3 +1,7 @@ +{{- $serviceName := include "common.names.fullname" . -}} + {{- if hasKey .Values "nameSuffix" -}} + {{- $serviceName = (printf "%v-%v" $serviceName .Values.nameSuffix) -}} +{{- end -}} apiVersion: v1 kind: ConfigMap metadata: @@ -63,14 +67,14 @@ data: # static files location ^~ /loleaflet { - proxy_pass http://collabora:9980; + proxy_pass http://{{ $serviceName }}:9980; proxy_set_header Host $host; # proxy_set_header Referer "http://nginx"; } # WOPI discovery URL location ^~ /hosting/discovery { - set $upstream_collabora collabora; + set $upstream_collabora {{ $serviceName }}; proxy_pass http://$upstream_collabora:9980; proxy_set_header Host $http_host; # proxy_set_header Referer "http://nginx"; @@ -78,14 +82,14 @@ data: # Capabilities location ^~ /hosting/capabilities { - proxy_pass http://collabora:9980; + proxy_pass http://{{ $serviceName }}:9980; proxy_set_header Host $host; # proxy_set_header Referer "http://nginx"; } # main websocket location ~ ^/lool/(.*)/ws$ { - proxy_pass http://collabora:9980; + proxy_pass http://{{ $serviceName }}:9980; proxy_set_header Host $host; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "Upgrade"; @@ -95,14 +99,14 @@ data: # download, presentation and image upload location ~ ^/lool { - proxy_pass http://collabora:9980; + proxy_pass http://{{ $serviceName }}:9980; proxy_set_header Host $host; proxy_set_header Referer "http://nginx"; } # Admin Console websocket location ^~ /lool/adminws { - proxy_pass http://collabora:9980; + proxy_pass http://{{ $serviceName }}:9980; proxy_set_header Host $host; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "Upgrade";