mirror of https://github.com/keeweb/keeweb.git
passing sha to VirusTotal
This commit is contained in:
parent
9f2a09cc97
commit
938f2be487
|
@ -762,6 +762,7 @@ module.exports = function (grunt) {
|
||||||
},
|
},
|
||||||
virustotal: {
|
virustotal: {
|
||||||
options: {
|
options: {
|
||||||
|
prefix: `keeweb.v${pkg.version}-${sha}.`,
|
||||||
timeout: 10 * 60 * 1000,
|
timeout: 10 * 60 * 1000,
|
||||||
get apiKey() {
|
get apiKey() {
|
||||||
return require('./keys/virus-total.json').apiKey;
|
return require('./keys/virus-total.json').apiKey;
|
||||||
|
|
|
@ -21,13 +21,13 @@ module.exports = function (grunt) {
|
||||||
|
|
||||||
const timeStarted = Date.now();
|
const timeStarted = Date.now();
|
||||||
|
|
||||||
const { apiKey, timeout = 60 * 1000 } = opt;
|
const { apiKey, prefix, timeout = 60 * 1000 } = opt;
|
||||||
const interval = 5000;
|
const interval = 5000;
|
||||||
|
|
||||||
const headers = { 'x-apikey': apiKey };
|
const headers = { 'x-apikey': apiKey };
|
||||||
|
|
||||||
const fileData = fs.readFileSync(file);
|
const fileData = fs.readFileSync(file);
|
||||||
const fileName = path.basename(file);
|
const fileName = (prefix || '') + path.basename(file);
|
||||||
|
|
||||||
const form = new FormData();
|
const form = new FormData();
|
||||||
form.append('file', fileData, fileName);
|
form.append('file', fileData, fileName);
|
||||||
|
|
Loading…
Reference in New Issue