Closed RangaSamudrala closed 9 months ago
In the file configmap.yaml, we add the below section:
{{ if .Values.userPatches }}
{{- if .Values.userPatches.enabled }}
user-patches.sh: |
#!/bin/bash
##
# This user patches script runs right before starting the daemons. That means, all the other configuration is in place, so the script can make final adjustments.
# If you modify any supervisord configuration, make sure to run "supervisorctl update" or "supervisorctl reload" afterwards.
# To enable the script, you must save it in your config directory as "user-patches.sh".
##
{{- range .Values.userPatches.commands }}
{{ . }} && \
{{- end }}
echo "user-patches.sh successfully executed"
{{- end }}
{{- end }}
In values.yaml, we add the below section:
userPatches:
enabled: false
commands: []
That sounds like a good improvement :) Would you be willing to submit a PR?
I have zero experience submitting a PR in an open source project. I presume this also requires writing test cases, etc. I will look into but will take time.
Yes, you can do this now by adding it to a mail-config volume. See https://github.com/docker-mailserver/docker-mailserver-helm/blob/master/charts/docker-mailserver/README.md#volume
While using this helm chart, I have encountered permissions issues. For example, during startup, the script sets ownership of /var/mail to 5000:5000 (docker:docker). This results in sieve scripts to fail with permission issues. There is an article about being able to fix these kinds of issues using user_patches . The default user-patch script looks as documented here. Some thing like
We should provide support for this in helm chart. Logic should be similar to how it is for am-i-healthy.sh in the file configmap.yaml.
The user should then be able to override these using values.