mirror of
https://github.com/truenas/charts.git
synced 2026-11-24 23:21:05 +00:00
Properly configure certificate to be used with collabora application
This commit is contained in:
1 parent
f4639626d5
commit
270e996be3
7 files changed
+82
-44
No files matched your search
@@ -64,7 +64,7 @@ questions:
|
|||||||
description: 'e.g. "--o:welcome.enable=false", See more on /etc/loolwsd/loowsd.xml. Separate params with space'
|
description: 'e.g. "--o:welcome.enable=false", See more on /etc/loolwsd/loowsd.xml. Separate params with space'
|
||||||
schema:
|
schema:
|
||||||
type: string
|
type: string
|
||||||
default: "--o:welcome.enable=false --o:user_interface.mode=notebookbar --o:ssl.termination=true --o:ssl.enable=false"
|
default: "--o:welcome.enable=false --o:user_interface.mode=notebookbar --o:ssl.termination=true --o:ssl.enable=false --o:net.proto=IPv4"
|
||||||
- variable: DONT_GEN_SSL_CERT
|
- variable: DONT_GEN_SSL_CERT
|
||||||
label: "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"
|
description: "When set to true it does NOT generate an SSL cert, you have to use your own"
|
||||||
@@ -84,6 +84,15 @@ questions:
|
|||||||
default: ''
|
default: ''
|
||||||
valid_chars: '^$|^[a-z]{1,}\\{1}\.{1}[a-z]{1,}\\{1}\.{1}[a-z]{1,}$'
|
valid_chars: '^$|^[a-z]{1,}\\{1}\.{1}[a-z]{1,}\\{1}\.{1}[a-z]{1,}$'
|
||||||
|
|
||||||
|
- variable: certificate
|
||||||
|
description: "Collabora Certificate"
|
||||||
|
label: "Certificate"
|
||||||
|
group: "Collabora Configuration"
|
||||||
|
schema:
|
||||||
|
type: int
|
||||||
|
$ref:
|
||||||
|
- "definitions/certificate"
|
||||||
|
|
||||||
- variable: extraAppVolumeMounts
|
- variable: extraAppVolumeMounts
|
||||||
label: "Collabora Extra Host Path Volumes"
|
label: "Collabora Extra Host Path Volumes"
|
||||||
group: "Storage"
|
group: "Storage"
|
||||||
|
|||||||
@@ -4,3 +4,37 @@ Retrieve secret name for secure credentials
|
|||||||
{{- define "secretName" -}}
|
{{- define "secretName" -}}
|
||||||
{{- print "credentials" -}}
|
{{- print "credentials" -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Retrieve true/false if certificate is configured
|
||||||
|
*/}}
|
||||||
|
{{- define "certAvailable" -}}
|
||||||
|
{{- if .Values.certificate -}}
|
||||||
|
{{- $values := (. | mustDeepCopy) -}}
|
||||||
|
{{- $_ := set $values "commonCertOptions" (dict "certKeyName" $values.Values.certificate) -}}
|
||||||
|
{{- template "common.resources.cert_present" $values -}}
|
||||||
|
{{- else -}}
|
||||||
|
{{- false -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Retrieve public key of certificate
|
||||||
|
*/}}
|
||||||
|
{{- define "cert.publicKey" -}}
|
||||||
|
{{- $values := (. | mustDeepCopy) -}}
|
||||||
|
{{- $_ := set $values "commonCertOptions" (dict "certKeyName" $values.Values.certificate "publicKey" true) -}}
|
||||||
|
{{ include "common.resources.cert" $values }}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Retrieve private key of certificate
|
||||||
|
*/}}
|
||||||
|
{{- define "cert.privateKey" -}}
|
||||||
|
{{- $values := (. | mustDeepCopy) -}}
|
||||||
|
{{- $_ := set $values "commonCertOptions" (dict "certKeyName" $values.Values.certificate) -}}
|
||||||
|
{{ include "common.resources.cert" $values }}
|
||||||
|
{{- end -}}
|
||||||
@@ -6,10 +6,6 @@ metadata:
|
|||||||
rollme: {{ randAlphaNum 5 | quote }}
|
rollme: {{ randAlphaNum 5 | quote }}
|
||||||
data:
|
data:
|
||||||
config: |-
|
config: |-
|
||||||
load_module modules/ngx_http_uploadprogress_module.so;
|
|
||||||
user www-data www-data;
|
|
||||||
worker_processes 1;
|
|
||||||
|
|
||||||
events {
|
events {
|
||||||
worker_connections 1024;
|
worker_connections 1024;
|
||||||
}
|
}
|
||||||
@@ -32,33 +28,24 @@ data:
|
|||||||
application/rss+xml
|
application/rss+xml
|
||||||
image/svg+xml;
|
image/svg+xml;
|
||||||
|
|
||||||
# reserve 1MB under the name 'proxied' to track uploads
|
|
||||||
upload_progress proxied 1m;
|
|
||||||
|
|
||||||
sendfile on;
|
sendfile on;
|
||||||
#tcp_nopush on;
|
|
||||||
client_max_body_size 1000m;
|
client_max_body_size 1000m;
|
||||||
|
|
||||||
#keepalive_timeout 0;
|
|
||||||
keepalive_timeout 65;
|
keepalive_timeout 65;
|
||||||
|
|
||||||
# Disable tokens for security (#23684)
|
# Disable tokens for security (#23684)
|
||||||
server_tokens off;
|
server_tokens off;
|
||||||
|
|
||||||
gzip on;
|
gzip on;
|
||||||
#upload_store /var/tmp/firmware;
|
|
||||||
client_body_temp_path /var/tmp/firmware;
|
client_body_temp_path /var/tmp/firmware;
|
||||||
|
|
||||||
error_log syslog:server=unix:/var/run/log,nohostname;
|
|
||||||
access_log syslog:server=unix:/var/run/log,nohostname;
|
|
||||||
|
|
||||||
server {
|
server {
|
||||||
server_name localhost;
|
server_name nginx;
|
||||||
listen 0.0.0.0:443 default_server ssl http2;
|
listen 0.0.0.0:443 default_server ssl http2;
|
||||||
listen [::]:443 default_server ssl http2;
|
listen [::]:443 default_server ssl http2;
|
||||||
|
|
||||||
ssl_certificate "/nginx.crt";
|
ssl_certificate "/etc/nginx/server.crt";
|
||||||
ssl_certificate_key "/nginx.key";
|
ssl_certificate_key "/etc/nginx/server.key";
|
||||||
|
|
||||||
ssl_session_timeout 120m;
|
ssl_session_timeout 120m;
|
||||||
ssl_session_cache shared:ssl:16m;
|
ssl_session_cache shared:ssl:16m;
|
||||||
@@ -68,10 +55,6 @@ data:
|
|||||||
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;
|
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;
|
||||||
add_header Strict-Transport-Security max-age=31536000;
|
add_header Strict-Transport-Security max-age=31536000;
|
||||||
|
|
||||||
# Security Headers
|
|
||||||
add_header X-Content-Type-Options nosniff;
|
|
||||||
add_header X-XSS-Protection "1";
|
|
||||||
|
|
||||||
location = /robots.txt {
|
location = /robots.txt {
|
||||||
add_header Content-Type text/plain;
|
add_header Content-Type text/plain;
|
||||||
proxy_set_header Referer "http://nginx";
|
proxy_set_header Referer "http://nginx";
|
||||||
@@ -80,9 +63,8 @@ data:
|
|||||||
|
|
||||||
# static files
|
# static files
|
||||||
location ^~ /loleaflet {
|
location ^~ /loleaflet {
|
||||||
set $upstream_collabora collabora;
|
proxy_pass http://collabora:9980;
|
||||||
proxy_pass http://$upstream_collabora:9980;
|
proxy_set_header Host $host;
|
||||||
proxy_set_header Host $http_host;
|
|
||||||
proxy_set_header Referer "http://nginx";
|
proxy_set_header Referer "http://nginx";
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -96,38 +78,34 @@ data:
|
|||||||
|
|
||||||
# Capabilities
|
# Capabilities
|
||||||
location ^~ /hosting/capabilities {
|
location ^~ /hosting/capabilities {
|
||||||
set $upstream_collabora collabora;
|
proxy_pass http://collabora:9980;
|
||||||
proxy_pass http://$upstream_collabora:9980;
|
proxy_set_header Host $host;
|
||||||
proxy_set_header Host $http_host;
|
|
||||||
proxy_set_header Referer "http://nginx";
|
proxy_set_header Referer "http://nginx";
|
||||||
}
|
}
|
||||||
|
|
||||||
# main websocket
|
# main websocket
|
||||||
location ~ ^/lool/(.*)/ws$ {
|
location ~ ^/lool/(.*)/ws$ {
|
||||||
set $upstream_collabora collabora;
|
proxy_pass http://collabora:9980;
|
||||||
proxy_pass http://$upstream_collabora:9980;
|
proxy_set_header Host $host;
|
||||||
proxy_set_header Upgrade $http_upgrade;
|
proxy_set_header Upgrade $http_upgrade;
|
||||||
proxy_set_header Connection "Upgrade";
|
proxy_set_header Connection "Upgrade";
|
||||||
proxy_set_header Host $http_host;
|
|
||||||
proxy_set_header Referer "http://nginx";
|
proxy_set_header Referer "http://nginx";
|
||||||
proxy_read_timeout 36000s;
|
proxy_read_timeout 36000s;
|
||||||
}
|
}
|
||||||
|
|
||||||
# download, presentation and image upload
|
# download, presentation and image upload
|
||||||
location ~ ^/lool {
|
location ~ ^/lool {
|
||||||
set $upstream_collabora collabora;
|
proxy_pass http://collabora:9980;
|
||||||
proxy_pass http://$upstream_collabora:9980;
|
proxy_set_header Host $host;
|
||||||
proxy_set_header Host $http_host;
|
|
||||||
proxy_set_header Referer "http://nginx";
|
proxy_set_header Referer "http://nginx";
|
||||||
}
|
}
|
||||||
|
|
||||||
# Admin Console websocket
|
# Admin Console websocket
|
||||||
location ^~ /lool/adminws {
|
location ^~ /lool/adminws {
|
||||||
set $upstream_collabora collabora;
|
proxy_pass http://collabora:9980;
|
||||||
proxy_pass http://$upstream_collabora:9980;
|
proxy_set_header Host $host;
|
||||||
proxy_set_header Upgrade $http_upgrade;
|
proxy_set_header Upgrade $http_upgrade;
|
||||||
proxy_set_header Connection "Upgrade";
|
proxy_set_header Connection "Upgrade";
|
||||||
proxy_set_header Host $http_host;
|
|
||||||
proxy_set_header Referer "http://nginx";
|
proxy_set_header Referer "http://nginx";
|
||||||
proxy_read_timeout 36000s;
|
proxy_read_timeout 36000s;
|
||||||
}
|
}
|
||||||
@@ -136,8 +114,8 @@ data:
|
|||||||
server {
|
server {
|
||||||
listen 0.0.0.0:80;
|
listen 0.0.0.0:80;
|
||||||
listen [::]:80;
|
listen [::]:80;
|
||||||
server_name localhost;
|
server_name nginx;
|
||||||
return 307 https://$host:443$request_uri;
|
return 307 https://$host:{{ .Values.nodePort }}}$request_uri;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -13,6 +13,13 @@ spec: {{ include "common.deployment.common_spec" $values | nindent 2 }}
|
|||||||
mountPath: /etc/nginx/nginx.conf
|
mountPath: /etc/nginx/nginx.conf
|
||||||
readOnly: true
|
readOnly: true
|
||||||
subPath: config
|
subPath: config
|
||||||
|
- name: certs
|
||||||
|
mountPath: /etc/nginx/server.crt
|
||||||
|
subPath: certPublicKey
|
||||||
|
- name: certs
|
||||||
|
mountPath: /etc/nginx/server.key
|
||||||
|
subPath: certPrivateKey
|
||||||
|
|
||||||
ports:
|
ports:
|
||||||
- name: http
|
- name: http
|
||||||
containerPort: 80
|
containerPort: 80
|
||||||
@@ -22,6 +29,9 @@ spec: {{ include "common.deployment.common_spec" $values | nindent 2 }}
|
|||||||
protocol: TCP
|
protocol: TCP
|
||||||
volumes:
|
volumes:
|
||||||
- name: configuration
|
- name: configuration
|
||||||
configMap:
|
configMap:
|
||||||
defaultMode: 0700
|
defaultMode: 0700
|
||||||
name: "nginx-config"
|
name: "nginx-config"
|
||||||
|
- name: certs
|
||||||
|
secret:
|
||||||
|
secretName: {{ include "secretName" . }}
|
||||||
@@ -1,6 +1,7 @@
|
|||||||
{{ $port := .Values.nodePort }}
|
{{ $port := .Values.nodePort }}
|
||||||
{{ $ports := list }}
|
{{ $ports := list }}
|
||||||
{{ $ports = mustAppend $ports (dict "name" "https" "port" $port "nodePort" $port "targetPort" "collabora") }}
|
{{ $ports = mustAppend $ports (dict "name" "https" "port" $port "nodePort" $port "targetPort" "https") }}
|
||||||
{{ $params := (. | mustDeepCopy) }}
|
{{ $params := (. | mustDeepCopy) }}
|
||||||
{{ $_ := set $params "common" (dict "nameSuffix" "nginx") "commonService" (dict "ports" $ports "type" "NodePort" ) }}
|
{{ $_ := set $params "common" (dict "nameSuffix" "nginx") }}
|
||||||
|
{{ $_2 := set $params "commonService" (dict "ports" $ports "type" "NodePort" ) }}
|
||||||
{{ include "common.classes.service" $params }}
|
{{ include "common.classes.service" $params }}
|
||||||
@@ -7,3 +7,9 @@ type: Opaque
|
|||||||
data:
|
data:
|
||||||
username: {{ .Values.config.username | b64enc | quote }}
|
username: {{ .Values.config.username | b64enc | quote }}
|
||||||
password: {{ .Values.config.password | b64enc | quote }}
|
password: {{ .Values.config.password | b64enc | quote }}
|
||||||
|
{{ if eq (include "certAvailable" .) "true" }}
|
||||||
|
certPublicKey: {{ (include "cert.publicKey" .) | toString | b64enc | quote }}
|
||||||
|
certPrivateKey: {{ (include "cert.privateKey" .) | toString | b64enc | quote }}
|
||||||
|
{{ else }}
|
||||||
|
{{ fail "No certificate configured for Collabora" }}
|
||||||
|
{{ end }}
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
{{ $port := .Values.nodePort }}
|
{{ $port := .Values.nodePort }}
|
||||||
{{ $ports := list }}
|
{{ $ports := list }}
|
||||||
{{ $ports = mustAppend $ports (dict "name" "collabora" "port" $port "nodePort" $port "targetPort" "collabora") }}
|
{{ $ports = mustAppend $ports (dict "name" "collabora" "port" 9980 "targetPort" "collabora") }}
|
||||||
{{ $params := . }}
|
{{ $params := . }}
|
||||||
{{ $_ := set $params "commonService" (dict "ports" $ports "type" "ClusterIP" ) }}
|
{{ $_ := set $params "commonService" (dict "ports" $ports "type" "ClusterIP" ) }}
|
||||||
{{ include "common.classes.service" $params }}
|
{{ include "common.classes.service" $params }}
|
||||||
Reference in new issue
Block a user