This project is a virus scanner as a microservice with REST interface. It consists of ClamAV and NodeJS client for ClamAV.
ClamAV is used as a docker image. It runs:
clamd
daemon socket listening on port 3310;freshclam
signature database update tool in the background.
REST Client is a NodeJS application based on NestJS framework.
To run microservice you can use docker compose
. It will run Scanner service on port 3310 and API service on port 1337.
Usage:
docker-compose pull
docker-compose up -d
REST Client configuring is based on environment variables. See all variables here. In current implementation all variables are required and must be exposed before starting the REST Client.
ClamAV uses clamd.conf and freshclam.conf configuration files. You can change these before building the docker image. See the full documentation for clamd.conf and freshclam.conf.
To develop locally you can run ClamAV container in the background: docker-compose up -d scanner
.
To run REST Client manually on your machine need to:
- have NodeJS with version
> 11
andyarn
installed globally - enter to the client directory -
cd ./nodejs-rest-client
- install dependencies -
yarn install
- build project -
yarn build
- run project -
yarn start
To run unit tests use:
yarn test:unit
yarn test:unit:coverage
You can run client with variables from .env. Use yarn start:local
command instead yarn start
.
- This project is not production-ready.
- The running of the
clamd
andfreshclam
can take a little time. So clamav can be unavailable the first 20-30 seconds after starting.