From 717127846338539f60ec6da8bbeb35df4af3f90e Mon Sep 17 00:00:00 2001 From: Julius Rickert Date: Thu, 3 Nov 2022 23:18:01 +0100 Subject: [PATCH] Add option to configure NGINX's trusted proxies (#151) * Add option to configure NGINX's trusted proxies Closes #150. Signed-off-by: Julius Rickert * Add NGINX's trustedProxies to README Signed-off-by: Julius Rickert * Bump chart version Signed-off-by: Julius Rickert Signed-off-by: Julius Rickert --- zammad/Chart.yaml | 2 +- zammad/README.md | 1 + zammad/templates/configmap-nginx.yaml | 5 +++++ zammad/values.yaml | 1 + 4 files changed, 8 insertions(+), 1 deletion(-) diff --git a/zammad/Chart.yaml b/zammad/Chart.yaml index 960d5649..21a5ea17 100644 --- a/zammad/Chart.yaml +++ b/zammad/Chart.yaml @@ -1,6 +1,6 @@ apiVersion: v2 name: zammad -version: 6.7.1 +version: 6.8.0 appVersion: 5.2.1 description: Zammad is a web based open source helpdesk/customer support system with many features to manage customer communication via several channels like telephone, facebook, twitter, chat and e-mails. home: https://zammad.org diff --git a/zammad/README.md b/zammad/README.md index 260845db..1a2de12f 100644 --- a/zammad/README.md +++ b/zammad/README.md @@ -52,6 +52,7 @@ The following table lists the configurable parameters of the zammad chart and th | `zammadConfig.memcached.enabled` | Use Memcached dependency | `true` | | `zammadConfig.memcached.host` | Memcached host | `zammad-memcached` | | `zammadConfig.memcached.port` | Memcached port | `11211` | +| `zammadConfig.nginx.trustedProxies` | Configure `set_real_ip_from` to trust proxies | `[]` | | `zammadConfig.nginx.websocketExtraHeaders` | Additional nginx headers for ws location | `[]` | | `zammadConfig.nginx.extraHeaders` | Additional nginx headers for / location | `[]` | | `zammadConfig.nginx.knowledgeBaseUrl` | Value of custom URL for knowledge base | `""` | diff --git a/zammad/templates/configmap-nginx.yaml b/zammad/templates/configmap-nginx.yaml index 4868ceb5..fdeba841 100644 --- a/zammad/templates/configmap-nginx.yaml +++ b/zammad/templates/configmap-nginx.yaml @@ -32,6 +32,11 @@ data: client_max_body_size 50M; + {{- /* Trusted proxies */}} + {{ range .Values.zammadConfig.nginx.trustedProxies }} + set_real_ip_from {{ . }}; + {{- end }} + {{- if .Values.zammadConfig.nginx.knowledgeBaseUrl }} {{ if hasPrefix "/" .Values.zammadConfig.nginx.knowledgeBaseUrl }} rewrite ^{{ .Values.zammadConfig.nginx.knowledgeBaseUrl }}(.*)$ /help$1 last; diff --git a/zammad/values.yaml b/zammad/values.yaml index b4a7bbc9..c24ef4a0 100644 --- a/zammad/values.yaml +++ b/zammad/values.yaml @@ -62,6 +62,7 @@ zammadConfig: host: zammad-memcached port: 11211 nginx: + trustedProxies: [] extraHeaders: [] # - 'HeaderName "Header Value"' websocketExtraHeaders: []