diff --git a/core/README.md b/core/README.md index fcee306..9c54ab4 100644 --- a/core/README.md +++ b/core/README.md @@ -61,6 +61,18 @@ standard version of docker-compose.yaml from this repository. - `HYPERKITTY_URL`: Default value is `http://mailman-web:8000/hyperkitty` +In case of a need for fine tuning of REST API web-server that uses [Gunicorn](https://docs.gunicorn.org/en/stable/settings.html) (e.g. for raising of timeouts) `/opt/mailman/core/gunicorn-extra.cfg` file could be provided holding necessary configuration options. + +Configuration file, [shipped with Mailman Core](https://gitlab.com/mailman/mailman/-/blob/master/src/mailman/config/gunicorn.cfg), is used by default. + +For example, to increase the default 30 sec timeout, which won't work for some API calls to highly populated lists, provide the following `gunicorn-extra.cfg` file: + +``` +[gunicorn] +graceful_timeout = 30 +timeout = 300 +``` + Running Mailman-Core ==================== @@ -103,6 +115,7 @@ hostname: $MM_HOSTNAME port: $MAILMAN_REST_PORT admin_user: $MAILMAN_REST_USER admin_pass: $MAILMAN_REST_PASSWORD +configuration: /etc/gunicorn.cfg [archiver.hyperkitty] class: mailman_hyperkitty.Archiver diff --git a/core/docker-entrypoint.sh b/core/docker-entrypoint.sh index cda6cbc..c0d8d38 100755 --- a/core/docker-entrypoint.sh +++ b/core/docker-entrypoint.sh @@ -123,6 +123,7 @@ hostname: $MM_HOSTNAME port: $MAILMAN_REST_PORT admin_user: $MAILMAN_REST_USER admin_pass: $MAILMAN_REST_PASSWORD +configuration: /etc/gunicorn.cfg [archiver.hyperkitty] class: mailman_hyperkitty.Archiver @@ -131,6 +132,10 @@ configuration: /etc/mailman-hyperkitty.cfg EOF +# Generate a basic gunicorn.cfg. +SITE_DIR=$(python3 -c 'import site; print(site.getsitepackages()[0])') +cp "${SITE_DIR}/mailman/config/gunicorn.cfg" /etc/gunicorn.cfg + # Generate a basic configuration to use exim cat > /tmp/exim-mailman.cfg <> /etc/mailman.cfg fi +if [[ -e /opt/mailman/gunicorn-extra.cfg ]] +then + echo "Found [webserver] configuration file at /opt/mailman/gunicorn-extra.cfg" + cat /opt/mailman/gunicorn-extra.cfg > /etc/gunicorn.cfg +fi if [[ ! -v HYPERKITTY_API_KEY ]]; then echo "HYPERKITTY_API_KEY not defined, please set this environment variable..."