Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gunicorn, clamd: make timeouts configurable via env vars #172

Draft
wants to merge 9 commits into
base: main
Choose a base branch
from
Draft
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
5 changes: 5 additions & 0 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,11 @@ RUN groupadd -r notify && \
useradd -r -g notify -ms /bin/bash notify && \
usermod -a -G clamav notify && \
chown -R notify:notify /home/vcap

# allow final amendments to clamd.conf at startup
RUN chown notify:clamav /etc/clamav/clamd.conf && \
chmod 0644 /etc/clamav/clamd.conf

USER notify

RUN mkdir /home/vcap/logs
Expand Down
3 changes: 3 additions & 0 deletions gunicorn_config.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import os

from notifications_utils.gunicorn_defaults import set_gunicorn_defaults

set_gunicorn_defaults(globals())


workers = 4
timeout = int(os.getenv("HTTP_SERVE_TIMEOUT_SECONDS", 30))
6 changes: 6 additions & 0 deletions scripts/run_app_ecs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,12 @@ echo "Run script pid: $$"

trap "on_exit" EXIT

TMP_CLAMD_CONF=$(mktemp)
sed '/^MaxScanTime.*/d' /etc/clamav/clamd.conf > "$TMP_CLAMD_CONF"
cat "$TMP_CLAMD_CONF" - >> /etc/clamav/clamd.conf <<EOF
MaxScanTime ${CLAMD_MAX_SCAN_TIME_MS:-50}
EOF

start_clamd

# The application has to start first!
Expand Down