Commit b09629ba authored by Chris Croome's avatar Chris Croome

Number of ClamAV threads *.5 the number of CPUs

parent 8d77255f
- name: Gather hardware facts
- hardware
- name: Check we have the number of virtual CPUs
var: ansible_processor_vcpus
verbosity: 1
- name: "Set a fact for the numver of ClamAV threads based on half the number of CPUs rounded upo to the nearest whole number"
nextcloud_clamav_threads: "{{ ( ansible_processor_vcpus * 0.5 ) | round(0, 'ceil') | int }}"
- name: Print the max ClamAV threads
var: nextcloud_clamav_threads
verbosity: 1
- name: ClamAV packages present
pkg: "{{ item }}"
state: latest
- clamav
- clamav-daemon
- clamav
- clamav-daemon
state: present
- name: Custom clamd.conf in place
src: templates/clamd.conf.j2
dest: /etc/clamav/clamd.conf
backup: yes
- name: Check if files_antivirus app is installed
command: "php occ config:app:get files_antivirus installed_version"
......@@ -42,3 +66,7 @@
become_user: www-data
when: files_antivirus_enabled.stdout != "yes"
- name: Restart clamav-daemon
name: clamav-daemon
state: restarted
#Automatically Generated by clamav-daemon postinst
#To reconfigure clamd run #dpkg-reconfigure clamav-daemon
#Please read /usr/share/doc/clamav-daemon/README.Debian.gz for details
LocalSocket /var/run/clamav/clamd.ctl
FixStaleSocket true
LocalSocketGroup clamav
LocalSocketMode 666
# TemporaryDirectory is not set to its default /tmp here to make overriding
# the default with environment variables TMPDIR/TMP/TEMP possible
User clamav
ScanMail true
ScanArchive true
ArchiveBlockEncrypted false
MaxDirectoryRecursion 15
FollowDirectorySymlinks false
FollowFileSymlinks false
ReadTimeout 180
MaxThreads {{ nextcloud_clamav_threads }}
MaxConnectionQueueLength 15
LogSyslog false
LogRotate true
LogFacility LOG_LOCAL6
LogClean false
LogVerbose false
PreludeEnable no
PreludeAnalyzerName ClamAV
DatabaseDirectory /var/lib/clamav
OfficialDatabaseOnly false
SelfCheck 3600
Foreground false
Debug false
ScanPE true
MaxEmbeddedPE 10M
ScanOLE2 true
ScanPDF true
ScanHTML true
MaxHTMLNormalize 10M
MaxHTMLNoTags 2M
MaxScriptNormalize 5M
MaxZipTypeRcg 1M
ScanSWF true
DetectBrokenExecutables false
ExitOnOOM false
LeaveTemporaryFiles false
AlgorithmicDetection true
ScanELF true
IdleTimeout 30
CrossFilesystems true
PhishingSignatures true
PhishingScanURLs true
PhishingAlwaysBlockSSLMismatch false
PhishingAlwaysBlockCloak false
PartitionIntersection false
DetectPUA false
ScanPartialMessages false
HeuristicScanPrecedence false
StructuredDataDetection false
CommandReadTimeout 5
SendBufTimeout 200
MaxQueue 100
ExtendedDetectionInfo true
OLE2BlockMacros false
ScanOnAccess false
AllowAllMatchScan true
ForceToDisk false
DisableCertCheck false
DisableCache false
MaxScanSize 100M
MaxFileSize 25M
MaxRecursion 16
MaxFiles 10000
MaxPartitions 50
MaxIconsPE 100
PCREMatchLimit 10000
PCRERecMatchLimit 5000
PCREMaxFileSize 25M
ScanXMLDOCS true
ScanHWP3 true
MaxRecHWP3 16
StreamMaxLength 25M
LogFile /var/log/clamav/clamav.log
LogTime true
LogFileUnlock false
LogFileMaxSize 0
Bytecode true
BytecodeSecurity TrustSigned
BytecodeTimeout 60000
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment