Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion templates/bridge-whatsapp/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,14 @@ data:
# the command prefix completely like in user management rooms is not possible.
management: {{ .Values.bridges.whatsapp.relaybot.management }}
# List of users to invite to all created rooms that include the relaybot.
invites: {{ .Values.bridges.whatsapp.relaybot.invites }}
{{- if .Values.bridges.whatsapp.relaybot.invites }}
invites:{{- if .Values.bridges.whatsapp.relaybot.invites }}
{{- range initial .Values.bridges.whatsapp.relaybot.invites }}
- {{ . | quote }}
{{- end }}
- {{ last .Values.bridges.whatsapp.relaybot.invites | quote }}
{{- end }}
{{- end }}
# The formats to use when sending messages to WhatsApp via the relaybot.
message_formats:
m.text: "<b>{{ "{{ .Sender.Displayname }}" }}</b>: {{ "{{ .Message }}" }}"
Expand Down
8 changes: 4 additions & 4 deletions templates/bridge-whatsapp/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,17 +56,17 @@ spec:
image: "{{ .Values.bridges.whatsapp.image.repository }}:{{ .Values.bridges.whatsapp.image.tag }}"
imagePullPolicy: {{ .Values.bridges.whatsapp.image.pullPolicy }}
command: ["sh"]
args: ["-c", "cp /load/config.yaml /data/config.yaml"]
args: ["-c", "cp /load/config.yaml /data/config.yaml; touch /bridges/whatsapp.yaml; chown 1000:1000 /data/config.yaml /bridges/whatsapp.yaml"]
volumeMounts:
- name: data
mountPath: /data
- name: config
mountPath: /load
readOnly: true
- name: bridges
mountPath: /bridges
securityContext:
capabilities:
drop:
- ALL
runAsUser: 0
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've tried very hard to run as many containers rootless as possible in this chart. I don't see why this container should need to manually fiddle with file permissions. What's the context behind this change? And why is it only needed for the WhatsApp bridge?

Copy link
Author

@arpagon arpagon Oct 9, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've tried very hard to run as many containers rootless as possible in this chart.

I'm really appreciate that.. Sorry, this Is related with #46... On my primary Environment (Ubunut CDK over Openstack and Cinder) get:
image
$ kubectl logs pod/matrixtest-bridge-whatsapp-6d7b9c87-77lsl -c generate-config Failed to save registration: open /bridges/whatsapp.yaml: permission denied

readOnlyRootFilesystem: true
allowPrivilegeEscalation: false
- name: "generate-config"
Expand Down