ClamAV private mirror
Go to file
sky 3ac357a45d Initial commit 2019-10-13 19:10:36 +08:00
.gitignore Initial commit 2019-10-13 19:10:36 +08:00
download_test.go Initial commit 2019-10-13 19:10:36 +08:00
download.go Initial commit 2019-10-13 19:10:36 +08:00
go.mod Initial commit 2019-10-13 19:10:36 +08:00
go.sum Initial commit 2019-10-13 19:10:36 +08:00
http.go Initial commit 2019-10-13 19:10:36 +08:00
main.go Initial commit 2019-10-13 19:10:36 +08:00
parser_test.go Initial commit 2019-10-13 19:10:36 +08:00
parsers.go Initial commit 2019-10-13 19:10:36 +08:00
README.md Initial commit 2019-10-13 19:10:36 +08:00
types.go Initial commit 2019-10-13 19:10:36 +08:00

ClamAV Private Mirror

license Build Status

How To Use

  • go build -v . && ./clamavpm m --primary= --seconard

What It Does

  1. Starts an asynchronous download of the current antivirus definitions.
    1. Downloads three databases:
      1. main
      2. bytecode
      3. daily
    2. Parses each database's header for similar versions.
    3. If there is a similar/related version, it also gets downloaded.
    4. Downloaded files are stored in-memory in a cache for client downloads.
  2. Initialises a cron job to download the new database definitions every hour.
  3. Starts the web server and serves from cache.
  4. Evicts files from cache every 3 hours to prevent stale definitions.

Mirrors

In order to function properly as a localised cache, you need to set the PRIMARY_MIRROR environment variable. Below is a short list of known mirrors.

If for some reason the primary mirror fails, if you set SECONDARY_MIRROR, it will try that one.

Contributing

  • Keep It Simple.
  • The standard testing library is awesome. Let's keep using it.

To unzip the CVD files: tail -c $(expr $(wc -c $FILE.cvd | awk '{print $1}') - 512) $FILE.cvd | tar zxvf -

Others

  • This project is forked and modified from github.com/mxplusb/clamav
  • Add multiple mirror supported
  • Save cvd to disk and load at startup