@roflsec/fail2scan 0.0.11 → 0.0.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/bin/daemon.js +3 -7
  2. package/package.json +1 -1
package/bin/daemon.js CHANGED
@@ -4,17 +4,13 @@ const fs = require('fs'), path = require('path'), os = require('os');
4
4
  const { execFile, spawn } = require('child_process');
5
5
  const { promisify } = require('util');
6
6
  const execFileP = promisify(execFile);
7
- require('dotenv').config({ quiet:true})
7
+ require('dotenv').config({ quiet:true });
8
8
  const IPGeolocationAPI = require("ip-geolocation-api-javascript-sdk");
9
9
 
10
- // ----------- Geo setup (fixed) -----------
11
10
  const geoApi = new IPGeolocationAPI(process.env.IPGEO_API_KEY, true);
12
11
  const getGeo = async (ip) => {
13
12
  return new Promise((resolve, reject) => {
14
- geoApi.getGeolocation(
15
- (res) => resolve(res),
16
- { ip, fields: "geo,time_zone,currency,asn,security" }
17
- );
13
+ geoApi.getGeolocation(resolve, { ip, fields: "geo,time_zone,currency,asn,security" });
18
14
  });
19
15
  };
20
16
 
@@ -67,7 +63,7 @@ function extractIpFromLine(line){
67
63
  return null;
68
64
  }
69
65
 
70
- // -------------------- nmap helpers (parallel support) --------------------
66
+ // -------------------- nmap helpers --------------------
71
67
  function spawnOneNmap(args, outFile) {
72
68
  return new Promise((resolve, reject) => {
73
69
  const proc = spawn('nmap', args, { stdio: ['ignore', 'pipe', 'pipe'] });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@roflsec/fail2scan",
3
- "version": "0.0.11",
3
+ "version": "0.0.12",
4
4
  "description": "Fail2Scan daemon - watches fail2ban logs and scans banned IPs using nmap, dig and whois.",
5
5
  "bin": {
6
6
  "fail2scan-daemon": "./bin/daemon.js"