Skip to content

Commit 65fa05d

Browse files
committed
feat: option to enable remote embedding #3
1 parent 061e3b0 commit 65fa05d

3 files changed

Lines changed: 31 additions & 1 deletion

File tree

charts/cryptpad/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ type: application
2121
# This is the chart version. This version number should be incremented each time you make changes
2222
# to the chart and its templates, including the app version.
2323
# Versions are expected to follow Semantic Versioning (https://semver.org/)
24-
version: 0.0.9
24+
version: 0.0.10
2525

2626
# This is the version number of the application being deployed. This version number should be
2727
# incremented each time you make changes to the application. Versions are not expected to

charts/cryptpad/templates/cryptpad.yaml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,32 @@ spec:
3636
serviceAccountName: {{ include "cryptpad-helm.serviceAccountName" . }}
3737
securityContext:
3838
{{- toYaml .Values.podSecurityContext | nindent 8 }}
39+
initContainers:
40+
- name: init-{{ .Chart.Name }}
41+
securityContext:
42+
{{- toYaml .Values.securityContext | nindent 12 }}
43+
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
44+
imagePullPolicy: {{ .Values.image.pullPolicy }}
45+
command: ['/bin/sh', '-c']
46+
volumeMounts:
47+
- name: cryptpad-data
48+
mountPath: /cryptpad/data
49+
{{- if .Values.persistence.cryptpad.data.existingClaim }}
50+
persistentVolumeClaim:
51+
claimName: {{ tpl .Values.persistence.cryptpad.data.existingClaim $ }}
52+
{{- end }}
53+
args:
54+
- |
55+
FILE=/cryptpad/data/decrees/decree.ndjson
56+
mkdir -p /cryptpad/data/decrees
57+
VALUE='["ENABLE_EMBEDDING", [{{ .Values.enableEmbedding }}], "", 0]'
58+
if [ -f $FILE ] && [ $(grep -c "ENABLE_EMBEDDING" $FILE) -gt 0 ]
59+
then
60+
sed -i "s|.*ENABLE_EMBEDDING.*|$VALUE|g" "$FILE"
61+
else
62+
echo "$VALUE" >> "$FILE"
63+
fi
64+
3965
containers:
4066
- name: {{ .Chart.Name }}
4167
securityContext:

charts/cryptpad/values.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,9 @@ config:
8585
# "[cryptpad-user1@my.awesome.website/YZgXQxKR0Rcb6r6CmxHPdAGLVludrAF2lEnkbx1vVOo=]",
8686
# ]
8787

88+
# -- Allow documents and media be embedded on other websites. This will add an "Embed" option on the Share menu.
89+
enableEmbedding: false
90+
8891
# TODO: remove
8992
# Check values on https://github.com/xwiki-labs/cryptpad-docker#environment-variables
9093
# For CPAD_MAIN_DOMAIN and CPAD_SANDBOX_DOMAIN values httpUnsafeOrigin and httpSafeOrigin will be used.
@@ -254,3 +257,4 @@ persistence:
254257
labels: {}
255258
selector: {}
256259
dataSource: {}
260+

0 commit comments

Comments
 (0)