Skip to content

Commit

Permalink
feat: option to enable remote embedding #3
Browse files Browse the repository at this point in the history
  • Loading branch information
gsautner committed Sep 27, 2023
1 parent 061e3b0 commit 65fa05d
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 1 deletion.
2 changes: 1 addition & 1 deletion charts/cryptpad/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.0.9
version: 0.0.10

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
Expand Down
26 changes: 26 additions & 0 deletions charts/cryptpad/templates/cryptpad.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,32 @@ spec:
serviceAccountName: {{ include "cryptpad-helm.serviceAccountName" . }}
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
initContainers:
- name: init-{{ .Chart.Name }}
securityContext:
{{- toYaml .Values.securityContext | nindent 12 }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
command: ['/bin/sh', '-c']
volumeMounts:
- name: cryptpad-data
mountPath: /cryptpad/data
{{- if .Values.persistence.cryptpad.data.existingClaim }}
persistentVolumeClaim:
claimName: {{ tpl .Values.persistence.cryptpad.data.existingClaim $ }}
{{- end }}
args:
- |
FILE=/cryptpad/data/decrees/decree.ndjson
mkdir -p /cryptpad/data/decrees
VALUE='["ENABLE_EMBEDDING", [{{ .Values.enableEmbedding }}], "", 0]'
if [ -f $FILE ] && [ $(grep -c "ENABLE_EMBEDDING" $FILE) -gt 0 ]
then
sed -i "s|.*ENABLE_EMBEDDING.*|$VALUE|g" "$FILE"
else
echo "$VALUE" >> "$FILE"
fi
containers:
- name: {{ .Chart.Name }}
securityContext:
Expand Down
4 changes: 4 additions & 0 deletions charts/cryptpad/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,9 @@ config:
# "[[email protected]/YZgXQxKR0Rcb6r6CmxHPdAGLVludrAF2lEnkbx1vVOo=]",
# ]

# -- Allow documents and media be embedded on other websites. This will add an "Embed" option on the Share menu.
enableEmbedding: false

# TODO: remove
# Check values on https://github.com/xwiki-labs/cryptpad-docker#environment-variables
# For CPAD_MAIN_DOMAIN and CPAD_SANDBOX_DOMAIN values httpUnsafeOrigin and httpSafeOrigin will be used.
Expand Down Expand Up @@ -254,3 +257,4 @@ persistence:
labels: {}
selector: {}
dataSource: {}

0 comments on commit 65fa05d

Please sign in to comment.