Skip to content

Commit

Permalink
fix: change the UI privacy configmap behavior (#3494)
Browse files Browse the repository at this point in the history
  • Loading branch information
lorenzo-cavazzi committed Feb 19, 2024
1 parent 677f17c commit 3fe5c3e
Show file tree
Hide file tree
Showing 6 changed files with 52 additions and 25 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -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
------

Expand Down
27 changes: 14 additions & 13 deletions docs/how-to-guides/admin/privacycookie.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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 <https://github.com/SwissDataScienceCenter/renku/blob/master/helm-chart/renku/templates/ui/ui-client-configmap.yaml>`_
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 <https://github.com/SwissDataScienceCenter/renku/blob/master/helm-chart/renku/templates/ui/ui-client-configmap.yaml>`_
will be used instead. You can start from it as a template to create your own
content.

The `Markdown syntax <https://en.wikipedia.org/wiki/Markdown>`_ is fully supported for the
privacy page content.
Expand Down
8 changes: 5 additions & 3 deletions helm-chart/renku/templates/ui/ui-client-configmap.yaml
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
Expand All @@ -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 }}
14 changes: 11 additions & 3 deletions helm-chart/renku/templates/ui/ui-client-deployment-template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
11 changes: 5 additions & 6 deletions helm-chart/renku/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand Down
11 changes: 11 additions & 0 deletions helm-chart/values.yaml.changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
* `<type: NEW|EDIT|DELETE> - *<resource name>*: <details>`

## 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
Expand Down

0 comments on commit 3fe5c3e

Please sign in to comment.