_configuration.tpl 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. {{- define "collabora.configuration" -}}
  2. {{- $fullname := (include "ix.v1.common.lib.chart.names.fullname" $) }}
  3. {{- $nginx := printf "https://%s-nginx:%v" $fullname .Values.collaboraNetwork.webPort -}}
  4. {{- if .Values.collaboraNetwork.certificateID }}
  5. configmap:
  6. nginx-conf:
  7. enabled: true
  8. data:
  9. nginx.conf: |
  10. events {
  11. worker_connections 1024;
  12. }
  13. http {
  14. include mime.types;
  15. default_type application/octet-stream;
  16. # Types to enable gzip compression on
  17. gzip_types
  18. text/plain
  19. text/css
  20. text/js
  21. text/xml
  22. text/javascript
  23. application/javascript
  24. application/x-javascript
  25. application/json
  26. application/xml
  27. application/rss+xml
  28. image/svg+xml;
  29. sendfile on;
  30. client_max_body_size 1000m;
  31. keepalive_timeout 65;
  32. # Disable tokens for security (#23684)
  33. server_tokens off;
  34. gzip on;
  35. client_body_temp_path /var/tmp/firmware;
  36. server {
  37. server_name {{ $nginx }};
  38. listen 0.0.0.0:{{ .Values.collaboraNetwork.webPort }} default_server ssl http2;
  39. ssl_certificate "/etc/certs/server.crt";
  40. ssl_certificate_key "/etc/certs/server.key";
  41. ssl_session_timeout 120m;
  42. ssl_session_cache shared:ssl:16m;
  43. ssl_protocols TLSv1.2 TLSv1.3;
  44. ssl_prefer_server_ciphers on;
  45. ssl_ciphers EECDH+ECDSA+AESGCM:EECDH+aRSA+AESGCM:EECDH+ECDSA:EDH+aRSA:EECDH:!RC4:!aNULL:!eNULL:!LOW:!3DES:!MD5:!EXP:!PSK:!SRP:!DSS:!SHA1:!SHA256:!SHA384;
  46. add_header Strict-Transport-Security max-age=31536000;
  47. location = /robots.txt {
  48. add_header Content-Type text/plain;
  49. proxy_set_header Referer {{ $nginx | quote }};
  50. return 200 "User-agent: *\nDisallow: /loleaflet/*\n";
  51. }
  52. # static files
  53. location ^~ /browser {
  54. proxy_pass http://{{ $fullname }}:9980;
  55. proxy_set_header Host $host;
  56. # proxy_set_header Referer {{ $nginx | quote }};
  57. }
  58. # WOPI discovery URL
  59. location ^~ /hosting/discovery {
  60. set $upstream_collabora {{ $fullname }};
  61. proxy_pass http://$upstream_collabora:9980;
  62. proxy_set_header Host $http_host;
  63. # proxy_set_header Referer {{ $nginx | quote }};
  64. }
  65. # Capabilities
  66. location ^~ /hosting/capabilities {
  67. proxy_pass http://{{ $fullname }}:9980;
  68. proxy_set_header Host $host;
  69. # proxy_set_header Referer {{ $nginx | quote }};
  70. }
  71. # main websocket
  72. location ~ ^/cool/(.*)/ws$ {
  73. proxy_pass http://{{ $fullname }}:9980;
  74. proxy_set_header Host $host;
  75. proxy_set_header Upgrade $http_upgrade;
  76. proxy_set_header Connection "Upgrade";
  77. # proxy_set_header Referer {{ $nginx | quote }};
  78. proxy_read_timeout 36000s;
  79. }
  80. # download, presentation and image upload
  81. location ~ ^/(c|l)ool {
  82. proxy_pass http://{{ $fullname }}:9980;
  83. proxy_set_header Host $host;
  84. proxy_set_header Referer {{ $nginx | quote }};
  85. }
  86. # Admin Console websocket
  87. location ^~ /cool/adminws {
  88. proxy_pass http://{{ $fullname }}:9980;
  89. proxy_set_header Host $host;
  90. proxy_set_header Upgrade $http_upgrade;
  91. proxy_set_header Connection "Upgrade";
  92. # proxy_set_header Referer {{ $nginx | quote }};
  93. proxy_read_timeout 36000s;
  94. }
  95. }
  96. }
  97. scaleCertificate:
  98. collabora-cert:
  99. enabled: true
  100. id: {{ .Values.collaboraNetwork.certificateID }}
  101. {{- end -}}
  102. {{- end -}}