From 0aa15262d4eaba3efc6d5ae8aee18a36755908ff Mon Sep 17 00:00:00 2001 From: Anthony LC Date: Tue, 15 Sep 2026 17:12:22 +0200 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8(helm)=20allow=20disallowing=20search?= =?UTF-8?q?=20engine=20indexing=20per=20instance?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add an optional ConfigMap-backed robots.txt mounted into the frontend static export (frontend.robotsTxt.enabled/content), following the same pattern as backend.themeCustomization, and enable it with a full Disallow on the feature review-app environment. --- CHANGELOG.md | 4 ++++ src/helm/env.d/feature/values.impress.yaml.gotmpl | 6 ++++++ src/helm/impress/README.md | 2 ++ src/helm/impress/templates/frontend_deployment.yaml | 11 +++++++++++ src/helm/impress/templates/robots_txt_cm.yaml | 10 ++++++++++ src/helm/impress/values.yaml | 8 ++++++++ 6 files changed, 41 insertions(+) create mode 100644 src/helm/impress/templates/robots_txt_cm.yaml diff --git a/CHANGELOG.md b/CHANGELOG.md index ee49ea8c7..7b8a53e10 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,10 @@ and this project adheres to ## [Unreleased] +### Added + +- ✨(helm) allow disallowing search engine indexing per instance #2694 + ## [v5.7.0] - 2026-09-15 ### Added diff --git a/src/helm/env.d/feature/values.impress.yaml.gotmpl b/src/helm/env.d/feature/values.impress.yaml.gotmpl index 910480e61..996f92846 100644 --- a/src/helm/env.d/feature/values.impress.yaml.gotmpl +++ b/src/helm/env.d/feature/values.impress.yaml.gotmpl @@ -134,6 +134,12 @@ frontend: replicas: 1 + robotsTxt: + enabled: true + content: | + User-agent: * + Disallow: / + image: repository: lasuite/impress-frontend pullPolicy: Always diff --git a/src/helm/impress/README.md b/src/helm/impress/README.md index 66fa3c3bf..e64004999 100644 --- a/src/helm/impress/README.md +++ b/src/helm/impress/README.md @@ -216,6 +216,8 @@ | `frontend.extraVolumes` | Additional volumes to mount on the frontend. | `[]` | | `frontend.pdb.enabled` | Enable pdb on frontend | `true` | | `frontend.serviceAccountName` | Optional service account name to use for frontend pods | `nil` | +| `frontend.robotsTxt.enabled` | Enable serving a custom robots.txt file from the frontend, e.g. to disallow indexing of non-production instances | `false` | +| `frontend.robotsTxt.content` | Content of the robots.txt file | `"User-agent: *\nAllow: /\n"` | ### posthog diff --git a/src/helm/impress/templates/frontend_deployment.yaml b/src/helm/impress/templates/frontend_deployment.yaml index 487a3c08b..43eaa349d 100644 --- a/src/helm/impress/templates/frontend_deployment.yaml +++ b/src/helm/impress/templates/frontend_deployment.yaml @@ -97,6 +97,12 @@ spec: subPath: {{ .subPath | default "" }} readOnly: {{ .readOnly }} {{- end }} + {{- if .Values.frontend.robotsTxt.enabled }} + - name: robots-txt + mountPath: /app/robots.txt + subPath: robots.txt + readOnly: true + {{- end }} {{- with .Values.frontend.nodeSelector }} nodeSelector: {{- toYaml . | nindent 8 }} @@ -148,6 +154,11 @@ spec: emptyDir: {} {{- end }} {{- end }} + {{- if .Values.frontend.robotsTxt.enabled }} + - name: robots-txt + configMap: + name: docs-frontend-robots-txt + {{- end }} --- {{ if .Values.frontend.pdb.enabled }} apiVersion: policy/v1 diff --git a/src/helm/impress/templates/robots_txt_cm.yaml b/src/helm/impress/templates/robots_txt_cm.yaml new file mode 100644 index 000000000..5ee670270 --- /dev/null +++ b/src/helm/impress/templates/robots_txt_cm.yaml @@ -0,0 +1,10 @@ +{{- if .Values.frontend.robotsTxt.enabled }} +apiVersion: v1 +kind: ConfigMap +metadata: + name: docs-frontend-robots-txt + namespace: {{ .Release.Namespace }} +data: + robots.txt: | + {{- .Values.frontend.robotsTxt.content | nindent 4 }} +{{- end }} diff --git a/src/helm/impress/values.yaml b/src/helm/impress/values.yaml index fb45fbec9..9a257faf9 100644 --- a/src/helm/impress/values.yaml +++ b/src/helm/impress/values.yaml @@ -573,6 +573,14 @@ frontend: ## @param frontend.serviceAccountName Optional service account name to use for frontend pods serviceAccountName: null + ## @param frontend.robotsTxt.enabled Enable serving a custom robots.txt file from the frontend, e.g. to disallow indexing of non-production instances + ## @param frontend.robotsTxt.content Content of the robots.txt file + robotsTxt: + enabled: false + content: | + User-agent: * + Allow: / + ## @section posthog posthog: