diff --git a/README.md b/README.md index 666b06b1aa..104cd59edc 100644 --- a/README.md +++ b/README.md @@ -208,6 +208,12 @@ proxies][other-proxy]. [haproxy-proxy]: https://zulip.readthedocs.io/en/latest/production/reverse-proxies.html#haproxy-configuration [other-proxy]: https://zulip.readthedocs.io/en/latest/production/reverse-proxies.html#other-proxies +**Additional puppet classes**. If you need to do additional puppet classes, you can set `ADDITIONAL_PUPPET_CLASSES` to a comma-separated list of puppet classes. This will tell Zulip to run the puppet classes under `[additional_puppet_classes]` in `zulip.conf`. +For example: `ADDITIONAL_PUPPET_CLASSES="zulip::postfix_localmail"`. + +**Mail name**. If you need to set the mail name to used in [Local delivery setup for incoming email integration](https://zulip.readthedocs.io/en/latest/production/email-gateway.html#local-delivery-setup), you can set `MAILNAME` to the mail name. This will tell Zulip to add the mail name configuration under `[postfix]` in `zulip.conf`. + + ### Manual configuration The way the environment variables configuration process described in diff --git a/entrypoint.sh b/entrypoint.sh index 22fd3c7f80..332dcf3169 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -146,6 +146,34 @@ puppetConfiguration() { crudini --set /etc/zulip/zulip.conf loadbalancer ips "${LOADBALANCER_IPS}" fi + local requireUpdateApt=false + + if [ -n "$ADDITIONAL_PUPPET_CLASSES" ]; then + echo "Add additional puppet classes" + current_classes=$(crudini --get /etc/zulip/zulip.conf machine puppet_classes) + if [ -n "$current_classes" ]; then + echo "Add additional puppet classes to existing" + crudini --set /etc/zulip/zulip.conf machine puppet_classes "${current_classes}, ${ADDITIONAL_PUPPET_CLASSES}" + else + echo "No existing puppet classes, just setting" + crudini --set /etc/zulip/zulip.conf machine puppet_classes "${ADDITIONAL_PUPPET_CLASSES}" + fi + requireUpdateApt=true + else + echo "No additional puppet classes." + fi + + if [ -n "$MAILNAME" ]; then + echo "Setup mail name for postfix" + crudini --set /etc/zulip/zulip.conf postfix mailname "${MAILNAME}" + else + echo "No config for mail name for postfix" + fi + + if [ "$requireUpdateApt" = true ]; then + apt update + fi + /home/zulip/deployments/current/scripts/zulip-puppet-apply -f } configureCerts() {