diff --git a/README.md b/README.md index 5e7a281..79f2228 100644 --- a/README.md +++ b/README.md @@ -21,6 +21,7 @@ The following enviroment variables can be used to customize the setup: * `OVERPASS_TIME` - set the maximum amount of time units (available time). * `OVERPASS_SPACE` - set the maximum amount of RAM (available space) in bytes. * `OVERPASS_MAX_TIMEOUT` - set the maximum timeout for queries (default: 1000s). Translates to send/recv timeout for fastcgi_wrap. +* `OVERPASS_MAX_SIZE` - set the maximum size for queries (default: 10M). Translates to nginx [`client_max_body_size`](https://nginx.org/en/docs/http/ngx_http_core_module.html#client_max_body_size). * `OVERPASS_USE_AREAS` - if `false` initial area generation and the area updater process will be disabled. Default `true`. * `OVERPASS_HEALTHCHECK` - shell commands to execute to verify that image is healthy. `exit 1` in case of failures, `exit 0` when container is healthy. Default healthcheck queries overpass and verifies that there is reponse returned * `OVERPASS_STOP_AFTER_INIT` - if `false` the container will keep runing after init is complete. Otherwise container will be stopped after initialization process is complete. Default `true` diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh index 27dde4d..e4e999f 100755 --- a/docker-entrypoint.sh +++ b/docker-entrypoint.sh @@ -10,6 +10,7 @@ OVERPASS_CLONE_SOURCE=${OVERPASS_CLONE_SOURCE:-https://dev.overpass-api.de/api_d # this is used by other processes, so needs to be exported export OVERPASS_MAX_TIMEOUT=${OVERPASS_MAX_TIMEOUT:-1000s} +export OVERPASS_MAX_SIZE=${OVERPASS_MAX_SIZE:-10M} if [[ "$OVERPASS_META" == "attic" ]]; then META="--keep-attic" @@ -127,7 +128,7 @@ if [[ ! -f /db/init_done ]]; then fi # shellcheck disable=SC2016 # ignore SC2016 (variables within single quotes) as this is exactly what we want to do here -envsubst '${OVERPASS_MAX_TIMEOUT}' /etc/nginx/nginx.conf +envsubst '${OVERPASS_MAX_TIMEOUT} ${OVERPASS_MAX_SIZE}' /etc/nginx/nginx.conf echo "Starting supervisord process" exec /usr/bin/supervisord -c /etc/supervisor/conf.d/supervisord.conf diff --git a/etc/nginx-overpass.conf.template b/etc/nginx-overpass.conf.template index 7f0d47d..53c6035 100644 --- a/etc/nginx-overpass.conf.template +++ b/etc/nginx-overpass.conf.template @@ -58,6 +58,8 @@ http { fastcgi_pass unix:/nginx/fcgiwrap.socket; fastcgi_read_timeout ${OVERPASS_MAX_TIMEOUT}; fastcgi_send_timeout ${OVERPASS_MAX_TIMEOUT}; + + client_max_body_size ${OVERPASS_MAX_SIZE}; } location /api/ {