purgatory v0.1.0
Purgatory
Getting Started
Prerequisites
Make sure you have clamscan
installed on your OS. Instructions can be found here. Ensure you can actually call clamscan -h
from the user you're executing your Express server as, since this package makes use of the child_process
module.
Installation
Run npm install
for testing, but this project by itself has no dependencies, as it's pretty simple. If you want faster Promises, replace the default Promise implmentation with Bluebird.
Testing
Run node test.js
to start up a simple test server.
- Upload a regular file.
- Upload the EICAR test file.
- Observe the different responses.
Usage
As show in test.js
, Purgatory - once initialized with options - makes use of two middleware functions: condemn
and condemnMany
. Add these after multer
middleware for single and multiple files, respectively. Purgatory will respond with the output of the scan with a req.edict
for the next function in Express. This allows you read information about the results of the scan and act accordingly.
Note that the scans currently take a while for each file, so I'll probably add some kind of POST hook later on so everything is smoother from a user perspective.
Contributing
There are some todos which I'll add later, especially with regards to options.
Authors
License
MIT