passing sha to VirusTotal

This commit is contained in:
antelle 2020-12-16 21:12:48 +01:00
parent 9f2a09cc97
commit 938f2be487
No known key found for this signature in database
GPG Key ID: 63C9777AAB7C563C
2 changed files with 3 additions and 2 deletions

View File

@ -762,6 +762,7 @@ module.exports = function (grunt) {
},
virustotal: {
options: {
prefix: `keeweb.v${pkg.version}-${sha}.`,
timeout: 10 * 60 * 1000,
get apiKey() {
return require('./keys/virus-total.json').apiKey;

View File

@ -21,13 +21,13 @@ module.exports = function (grunt) {
const timeStarted = Date.now();
const { apiKey, timeout = 60 * 1000 } = opt;
const { apiKey, prefix, timeout = 60 * 1000 } = opt;
const interval = 5000;
const headers = { 'x-apikey': apiKey };
const fileData = fs.readFileSync(file);
const fileName = path.basename(file);
const fileName = (prefix || '') + path.basename(file);
const form = new FormData();
form.append('file', fileData, fileName);