Implementing environment variable option
This commit is contained in:
parent
f23269796a
commit
6f4799bb88
2 changed files with 31 additions and 0 deletions
14
Dockerfile
14
Dockerfile
|
@ -28,4 +28,18 @@ RUN mv /go/src/clamav-rest/clamav-rest /usr/bin/ && rm -Rf /go/src/clamav-rest
|
|||
|
||||
EXPOSE 9000
|
||||
|
||||
ENV MAX_SCAN_SIZE=100M
|
||||
ENV MAX_FILE_SIZE=25M
|
||||
ENV MAX_RECURSION=16
|
||||
ENV MAX_FILES=10000
|
||||
ENV MAX_EMBEDDEDPE=10M
|
||||
ENV MAX_HTMLNORMALIZE=10M
|
||||
ENV MAX_HTMLNOTAGS=2M
|
||||
ENV MAX_SCRIPTNORMALIZE=5M
|
||||
ENV MAX_ZIPTYPERCG=1M
|
||||
ENV MAX_PARTITIONS=50
|
||||
ENV MAX_ICONSPE=100
|
||||
ENV PCRE_MATCHLIMIT=100000
|
||||
ENV PCRE_RECMATCHLIMIT=2000
|
||||
|
||||
ENTRYPOINT [ "entrypoint.sh" ]
|
|
@ -1,4 +1,21 @@
|
|||
#!/bin/sh
|
||||
|
||||
# Replace values with environment variables in clamd.conf
|
||||
sed -i 's/^#MaxScanSize .*$/MaxScanSize '"$MAX_SCAN_SIZE"'/g' /etc/clamav/clamd.conf
|
||||
sed -i 's/^#StreamMaxLength .*$/StreamMaxLength '"$MAX_FILE_SIZE"'/g' /etc/clamav/clamd.conf
|
||||
sed -i 's/^#MaxFileSize .*$/MaxFileSize '"$MAX_FILE_SIZE"'/g' /etc/clamav/clamd.conf
|
||||
sed -i 's/^#MaxRecursion .*$/MaxRecursion '"$MAX_RECURSION"'/g' /etc/clamav/clamd.conf
|
||||
sed -i 's/^#MaxFiles .*$/MaxFiles '"$MAX_FILES"'/g' /etc/clamav/clamd.conf
|
||||
sed -i 's/^#MaxEmbeddedPE .*$/MaxEmbeddedPE '"$MAX_EMBEDDEDPE"'/g' /etc/clamav/clamd.conf
|
||||
sed -i 's/^#MaxHTMLNormalize .*$/MaxHTMLNormalize '"$MAX_HTMLNORMALIZE"'/g' /etc/clamav/clamd.conf
|
||||
sed -i 's/^#MaxHTMLNoTags.*$/MaxHTMLNoTags '"$MAX_HTMLNOTAGS"'/g' /etc/clamav/clamd.conf
|
||||
sed -i 's/^#MaxScriptNormalize .*$/MaxScriptNormalize '"$MAX_SCRIPTNORMALIZE"'/g' /etc/clamav/clamd.conf
|
||||
sed -i 's/^#MaxZipTypeRcg .*$/MaxZipTypeRcg '"$MAX_ZIPTYPERCG"'/g' /etc/clamav/clamd.conf
|
||||
sed -i 's/^#MaxPartitions .*$/MaxPartitions '"$MAX_PARTITIONS"'/g' /etc/clamav/clamd.conf
|
||||
sed -i 's/^#MaxIconsPE .*$/MaxIconsPE '"$MAX_ICONSPE"'/g' /etc/clamav/clamd.conf
|
||||
sed -i 's/^#PCREMatchLimit.*$/PCREMatchLimit '"$PCRE_MATCHLIMIT"'/g' /etc/clamav/clamd.conf
|
||||
sed -i 's/^#PCRERecMatchLimit .*$/PCRERecMatchLimit '"$PCRE_RECMATCHLIMIT"'/g' /etc/clamav/clamd.conf
|
||||
|
||||
freshclam -d &
|
||||
clamd &
|
||||
/usr/bin/clamav-rest &
|
||||
|
|
Loading…
Add table
Reference in a new issue