Kaynağa Gözat

Update service name usages in nginx configuration

sonicaj 3 yıl önce
ebeveyn
işleme
ca44e0c385

+ 2 - 2
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"

+ 10 - 6
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";