From 3fe5c3e24045b3cbdb5d5e8daed9d029b159d78f Mon Sep 17 00:00:00 2001 From: Lorenzo Cavazzi <43481553+lorenzo-cavazzi@users.noreply.github.com> Date: Fri, 16 Feb 2024 15:11:43 +0100 Subject: [PATCH] fix: change the UI privacy configmap behavior (#3494) --- CHANGELOG.rst | 6 +++++ docs/how-to-guides/admin/privacycookie.rst | 27 ++++++++++--------- .../templates/ui/ui-client-configmap.yaml | 8 +++--- .../ui/ui-client-deployment-template.yaml | 14 +++++++--- helm-chart/renku/values.yaml | 11 ++++---- helm-chart/values.yaml.changelog.md | 11 ++++++++ 6 files changed, 52 insertions(+), 25 deletions(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 2237a00aa2..3c37c9b94e 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -1,5 +1,11 @@ .. _changelog: +0.48.1 +------ + +Renku ``0.48.1`` only changes how the Terms of Use and Privacy Policy sections +can be customized by administrators. + 0.48.0 ------ diff --git a/docs/how-to-guides/admin/privacycookie.rst b/docs/how-to-guides/admin/privacycookie.rst index 6c9c904090..1e2472f7ed 100644 --- a/docs/how-to-guides/admin/privacycookie.rst +++ b/docs/how-to-guides/admin/privacycookie.rst @@ -9,19 +9,20 @@ Privacy page and Terms of Use The UI can be configured to show a `Privacy Policy` and `Terms of Use`. These are displayed under the `Help` section of the UI. -For each of these, the content is read from a ``ConfigMap``. You need to configure -the values in ``ui.client.privacy.page`` to enable the feature and set the reference -ConfigMap name and key. If ``ui.client.privacy.page.enabled`` is ``true``, then the privacy -policy and terms of use will be shown in the UI, with content taken from the ConfigMap -specified by ``ui.client.privacy.page.configMapName`` at the key -``ui.client.privacy.page.configMapPolicyKey`` for the privacy policy and -``ui.client.privacy.page.configMapTermsKey`` for the terms of use. - -.. note:: - - If you don't set the ConfigMap name and key, - `a sample `_ - will be used instead. You can start from it as a template to create your customized ConfigMap. +For each of these, the content is read from the ``privacy-and-terms`` ConfigMap. +You need to configure the values in ``ui.client.privacy.page`` to enable the feature. +If ``ui.client.privacy.page.enabled`` is ``true``, then the privacy +policy and terms of use will be shown in the UI. + +Mind that you need to customize the content by either changing the ``privacy_statement`` +and the ``terms`` keys in the ``privacy-and-terms`` ConfigMap, or assign a valid Markdown +text to ``ui.client.privacy.page.privacyPolicyContent`` and +``ui.client.privacy.page.termsContent``. + +If you don't customize the text, +`a sample `_ +will be used instead. You can start from it as a template to create your own +content. The `Markdown syntax `_ is fully supported for the privacy page content. diff --git a/helm-chart/renku/templates/ui/ui-client-configmap.yaml b/helm-chart/renku/templates/ui/ui-client-configmap.yaml index 75c0e3cfcd..89b46d1f0a 100644 --- a/helm-chart/renku/templates/ui/ui-client-configmap.yaml +++ b/helm-chart/renku/templates/ui/ui-client-configmap.yaml @@ -1,14 +1,14 @@ apiVersion: v1 kind: ConfigMap metadata: - name: {{ template "renku.fullname" . }}-privacy-sample + name: {{ template "renku.fullname" . }}-privacy-and-terms labels: app: ui chart: {{ template "renku.chart" . }} release: {{ .Release.Name }} heritage: {{ .Release.Service }} data: - privacy_statement: | + sample_privacy_statement: | # Privacy statement The content of this page is only a template. ## Information @@ -25,7 +25,7 @@ data: ## Apply the changes If you edit the ConfigMap content and you don't upgrade the deployment from helm, keep in mind that the ui pod needs to be manually re-deployed in order to apply the changes to the privacy page. - terms: | + sample_terms: | # Terms of Use The content of this page is only a template. ## Information @@ -41,3 +41,5 @@ data: ## Apply the changes If you edit the ConfigMap content and you don't upgrade the deployment from helm, keep in mind that the ui pod needs to be manually re-deployed in order to apply the changes to the terms page. + privacy_statement: {{ .Values.ui.client.privacy.page.privacyPolicyContent | default ("") | quote }} + terms: {{ .Values.ui.client.privacy.page.termsContent | default ("") | quote }} diff --git a/helm-chart/renku/templates/ui/ui-client-deployment-template.yaml b/helm-chart/renku/templates/ui/ui-client-deployment-template.yaml index ae58ef7a41..334660a7da 100644 --- a/helm-chart/renku/templates/ui/ui-client-deployment-template.yaml +++ b/helm-chart/renku/templates/ui/ui-client-deployment-template.yaml @@ -29,11 +29,19 @@ spec: volumes: - name: privacy configMap: - name: {{ .Values.ui.client.privacy.page.configMapName | default (printf "%s-privacy-sample" (include "renku.fullname" .)) | quote }} + name: {{ printf "%s-privacy-and-terms" (include "renku.fullname" .) | quote }} items: - - key: {{ .Values.ui.client.privacy.page.configMapPolicyKey | default (printf "privacy_statement") | quote }} + {{- if .Values.ui.client.privacy.page.privacyPolicyContent }} + - key: "privacy_statement" + {{- else }} + - key: "sample_privacy_statement" + {{- end }} path: statement.md - - key: {{ .Values.ui.client.privacy.page.configMapTermsKey | default (printf "terms") | quote }} + {{- if .Values.ui.client.privacy.page.termsContent }} + - key: "terms" + {{- else }} + - key: "sample_terms" + {{- end }} path: terms.md {{- end }} diff --git a/helm-chart/renku/values.yaml b/helm-chart/renku/values.yaml index f5f5e750b1..b0ae4d8269 100644 --- a/helm-chart/renku/values.yaml +++ b/helm-chart/renku/values.yaml @@ -692,15 +692,14 @@ ui: dsn: "" environment: "" sampleRate: 0 # number between 0 and 1. (e.g., to send 20% of transactions, set 0.2.) - # If you want to enable the privacy page, please create also a configMap and set its name in the - # privacy.page.configMapName value. As a reference, you can use the sample configMap generated when - # enabling the feature. privacy: + # If you want to enable the Privacy Policy and Terms of Service pages, you shoud add your custom content + # in privacyPolicyContent and termsContent. Markdown is supported. + # As a reference, you can use the "ui-client-configmap" configMap content in the "sample" sections. page: enabled: false - #configMapName: privacy-page - #configMapPolicyKey: privacy_statement - #configMapTermsKey: terms + #privacyPolicyContent: "" + #termsContent: "" banner: enabled: false content: | diff --git a/helm-chart/values.yaml.changelog.md b/helm-chart/values.yaml.changelog.md index c4b2e1b961..41fdf5ee1d 100644 --- a/helm-chart/values.yaml.changelog.md +++ b/helm-chart/values.yaml.changelog.md @@ -5,6 +5,17 @@ For changes that require manual steps other than changing values, please check o Please follow this convention when adding a new row * ` - **:
` +## Upgrading to Renku 0.48.1 + +The handling of privacy policy and terms of service content has been fine tuned. + +* DELETE `ui.client.privacy.page.configMapName` has been removed. +* DELETE `ui.client.privacy.page.configMapPolicyKey` has been removed. +* DELETE `ui.client.privacy.page.configMapTermsKey` has been removed. +* NEW ``ui.client.privacy.page.privacyPolicyContent`` to customize the content of the Privacy Policy page (supports Markdown). +* NEW ``ui.client.privacy.page.termsContent`` to customize the content of the Terms of Use page (supports Markdown). + + ## Upgrading to Renku 0.48.0 The handling of privacy policy and terms of service content has been slightly changed to make