node-red-contrib-ipgeolocation 1.0.0 → 1.0.2
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.
- package/README.md +26 -14
- package/nodes/ipgeo-timezone.js +3 -3
- package/nodes/lib/api-client.js +1 -1
- package/package.json +20 -8
package/README.md
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
[](https://nodejs.org)
|
|
9
9
|
[](./LICENSE)
|
|
10
10
|
|
|
11
|
-
A complete, production-ready set of **Node-RED IP geolocation nodes**. Look up the country, city, latitude, and longitude of any IP address or domain, score IPs for proxy, VPN,
|
|
11
|
+
A complete, production-ready set of **Node-RED IP geolocation nodes**. Look up the country, city, latitude, and longitude of any IP address or domain, score IPs for proxy, VPN, Tor, and bot risk, resolve ASN and abuse-contact data, parse user-agent strings, and fetch timezone and astronomy data, all from low-code Node-RED flows.
|
|
12
12
|
|
|
13
13
|
---
|
|
14
14
|
|
|
@@ -37,11 +37,11 @@ A complete, production-ready set of **Node-RED IP geolocation nodes**. Look up t
|
|
|
37
37
|
|
|
38
38
|
- **Single IP geolocation:** resolve country, region, city, latitude, longitude, currency, and timezone for any IPv4, IPv6, or domain.
|
|
39
39
|
- **Bulk IP geolocation:** process up to 50,000 IP addresses in one request.
|
|
40
|
-
- **IP security and threat intelligence:** detect proxy, VPN,
|
|
40
|
+
- **IP security and threat intelligence:** detect proxy, VPN, Tor, bot, and threat scores for fraud prevention and access control.
|
|
41
41
|
- **Bulk security lookup:** score large IP lists in a single call.
|
|
42
42
|
- **Abuse contact lookup:** retrieve the abuse email, phone, and owning organization for an IP.
|
|
43
43
|
- **ASN lookup:** resolve Autonomous System details by IP or AS number.
|
|
44
|
-
- **
|
|
44
|
+
- **Time Zone API:** get timezone data by name, IP, coordinates, city, IATA code, ICAO code, or UN/LOCODE.
|
|
45
45
|
- **Astronomy API:** sunrise, sunset, moonrise, moonset, twilight phases, moon phase, and solar and lunar positions by coordinates, address, or IP.
|
|
46
46
|
- **User-agent parser:** identify browser, device, OS, and engine from a user-agent string.
|
|
47
47
|
- **Developer friendly:** dynamic `msg`, `flow`, and `global` inputs, an optional dedicated error output, automatic retries with exponential backoff, secure credential storage, and per-request credit reporting.
|
|
@@ -91,6 +91,13 @@ cd ~/.node-red
|
|
|
91
91
|
npm install node-red-contrib-ipgeolocation
|
|
92
92
|
```
|
|
93
93
|
|
|
94
|
+
For an existing installation, update the package and refresh its HTTP dependencies in the Node-RED user directory:
|
|
95
|
+
|
|
96
|
+
```bash
|
|
97
|
+
npm install node-red-contrib-ipgeolocation@latest
|
|
98
|
+
npm update axios follow-redirects
|
|
99
|
+
```
|
|
100
|
+
|
|
94
101
|
Restart Node-RED. All ten nodes appear under the **IPGeolocation** category in the palette.
|
|
95
102
|
|
|
96
103
|
---
|
|
@@ -159,7 +166,7 @@ Include modules:
|
|
|
159
166
|
|
|
160
167
|
| Module | Extra credits | Adds |
|
|
161
168
|
|--------|:---:|------|
|
|
162
|
-
| `security` | +2 | Proxy, VPN,
|
|
169
|
+
| `security` | +2 | Proxy, VPN, Tor, bot, threat score |
|
|
163
170
|
| `abuse` | +1 | Abuse contact (email, phone, org) |
|
|
164
171
|
| `user_agent` | 0 | Parsed user-agent |
|
|
165
172
|
| `geo_accuracy` | 0 | Accuracy radius and confidence |
|
|
@@ -184,7 +191,7 @@ const resolved = msg.payload.filter(r => r.ip);
|
|
|
184
191
|
|
|
185
192
|
### ipgeo-security: IP security and threat intelligence
|
|
186
193
|
|
|
187
|
-
Single-IP risk lookup: proxy, VPN,
|
|
194
|
+
Single-IP risk lookup: proxy, VPN, Tor, and bot detection plus a threat score, useful for fraud checks, login protection, and access control. Supports **Fields** and **Excludes**.
|
|
188
195
|
|
|
189
196
|
### ipgeo-bulk-security: bulk IP security
|
|
190
197
|
|
|
@@ -213,7 +220,7 @@ Looks up Autonomous System details. The **Query type** selects what gets sent:
|
|
|
213
220
|
|
|
214
221
|
Supports an **Include** list (`peers`, `downstreams`, `upstreams`, and more), overridable per message via `msg.ipgeo_include`, plus **Fields** and **Excludes**.
|
|
215
222
|
|
|
216
|
-
### ipgeo-timezone:
|
|
223
|
+
### ipgeo-timezone: Time Zone API
|
|
217
224
|
|
|
218
225
|
Seven lookup modes:
|
|
219
226
|
|
|
@@ -223,9 +230,9 @@ Seven lookup modes:
|
|
|
223
230
|
| IP address | `ip` | `8.8.8.8` |
|
|
224
231
|
| Address / city | `location` | `Paris, France` |
|
|
225
232
|
| Coordinates | `lat` + `long` | `48.8566`, `2.3522` |
|
|
226
|
-
| IATA airport | `
|
|
227
|
-
| ICAO airport | `
|
|
228
|
-
| UN/LOCODE | `
|
|
233
|
+
| IATA airport | `iata_code` | `CDG` |
|
|
234
|
+
| ICAO airport | `icao_code` | `LFPG` |
|
|
235
|
+
| UN/LOCODE | `lo_code` | `FRPAR` |
|
|
229
236
|
|
|
230
237
|
Returns `INVALID_INPUT` when the value required for the chosen mode is missing.
|
|
231
238
|
|
|
@@ -287,7 +294,7 @@ On failure, the node sets `msg.error` with a typed `code`, a readable `message`,
|
|
|
287
294
|
| `FORBIDDEN` | Plan restriction or origin not whitelisted (HTTP 403) |
|
|
288
295
|
| `NOT_FOUND` | Endpoint or resource not found (HTTP 404) |
|
|
289
296
|
| `VALIDATION` | Validation error (HTTP 422) |
|
|
290
|
-
| `LOCKED` |
|
|
297
|
+
| `LOCKED` | Private or bogon IP address (HTTP 423). Check that the input is a valid public IP and that your application resolved the visitor's address correctly. Localhost and private-network addresses cannot be geolocated. |
|
|
291
298
|
| `RATE_LIMITED` | Too many requests (HTTP 429) |
|
|
292
299
|
| `SERVER_ERROR` | API internal error (HTTP 500) |
|
|
293
300
|
| `HTTP_ERROR` | Any other non-2xx status |
|
|
@@ -363,20 +370,25 @@ Each node reports the real charge in `msg.ipgeo_credits`. See the [Credits Usage
|
|
|
363
370
|
## Development and testing
|
|
364
371
|
|
|
365
372
|
```bash
|
|
366
|
-
npm
|
|
373
|
+
npm ci # install the locked dependencies
|
|
367
374
|
npm test # run the mocha test suite
|
|
368
375
|
npm run coverage # run tests with an HTML and text coverage report
|
|
376
|
+
npm run audit:security # check runtime and development dependencies
|
|
377
|
+
npm run test:package # test fresh installs and upgrades of the packed npm package
|
|
378
|
+
npm run test:http # test HTTPS behavior with the locally installed Postman CLI
|
|
369
379
|
```
|
|
370
380
|
|
|
371
381
|
Tests use `mocha`, `node-red-node-test-helper`, `should`, and `nock`, with all HTTP fully mocked so the suite runs offline with no live API calls. Specs live in `test/**/*_spec.js` and cover the shared API client, the helpers, every node, and the bundled example flows.
|
|
372
382
|
|
|
383
|
+
`test:http` starts a local Postman simulation and checks real HTTPS requests, redirects, retries and timeouts. It uses test credentials and stops the proxy when the checks finish. `test:package` requires registry access to verify fresh installations and upgrades from version 1.0.1, including an existing lock with current Axios and an older redirect dependency.
|
|
384
|
+
|
|
373
385
|
---
|
|
374
386
|
|
|
375
387
|
## Frequently Asked Questions
|
|
376
388
|
|
|
377
389
|
<details>
|
|
378
390
|
<summary><strong>How do I get an IPGeolocation.io API key?</strong></summary>
|
|
379
|
-
Sign up for a free account at <code>app.ipgeolocation.io/signup</code>. The free
|
|
391
|
+
Sign up for a free account at <code>app.ipgeolocation.io/signup</code>. The free plan covers the lookup, timezone, astronomy, and user-agent nodes, within free-plan fields and options. Bulk, security, dedicated ASN, and abuse nodes require a paid plan.
|
|
380
392
|
</details>
|
|
381
393
|
|
|
382
394
|
<details>
|
|
@@ -390,8 +402,8 @@ Yes. Use the <code>ipgeo-bulk</code> node for geolocation lookups or the <code>i
|
|
|
390
402
|
</details>
|
|
391
403
|
|
|
392
404
|
<details>
|
|
393
|
-
<summary><strong>How do I detect VPNs, proxies, or
|
|
394
|
-
Use the <code>ipgeo-security</code> node, or enable the <code>security</code> include module when using <code>ipgeo-lookup</code>. The response includes fields indicating proxy usage, VPN detection,
|
|
405
|
+
<summary><strong>How do I detect VPNs, proxies, or Tor exit nodes?</strong></summary>
|
|
406
|
+
Use the <code>ipgeo-security</code> node, or enable the <code>security</code> include module when using <code>ipgeo-lookup</code>. The response includes fields indicating proxy usage, VPN detection, Tor exit node status, and other threat-related information.
|
|
395
407
|
</details>
|
|
396
408
|
|
|
397
409
|
<details>
|
package/nodes/ipgeo-timezone.js
CHANGED
|
@@ -32,9 +32,9 @@ const MODE_PARAM = {
|
|
|
32
32
|
ip: 'ip',
|
|
33
33
|
location: 'location',
|
|
34
34
|
coords: null, // lat + lng are separate params
|
|
35
|
-
iata: '
|
|
36
|
-
icao: '
|
|
37
|
-
unlocode: '
|
|
35
|
+
iata: 'iata_code',
|
|
36
|
+
icao: 'icao_code',
|
|
37
|
+
unlocode: 'lo_code', // UN/LO code is passed as 'location'
|
|
38
38
|
};
|
|
39
39
|
|
|
40
40
|
module.exports = function (RED) {
|
package/nodes/lib/api-client.js
CHANGED
|
@@ -76,7 +76,7 @@ function mapAxiosError(err) {
|
|
|
76
76
|
case 422: return new IPGeoError(
|
|
77
77
|
`Unprocessable entity: ${apiMsg || 'Validation error'}`, 'VALIDATION', 422, data);
|
|
78
78
|
case 423: return new IPGeoError(
|
|
79
|
-
`
|
|
79
|
+
`Private or bogon IP address: ${apiMsg || 'Localhost and private-network addresses cannot be geolocated'}`, 'LOCKED', 423, data);
|
|
80
80
|
case 429: return new IPGeoError(
|
|
81
81
|
`Rate limit exceeded: ${apiMsg || 'Too many requests'}`, 'RATE_LIMITED', 429, data);
|
|
82
82
|
case 500: return new IPGeoError(
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "node-red-contrib-ipgeolocation",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"description": "Node-RED nodes for the IPGeolocation.io v3 API: IP geolocation, security and threat intelligence (VPN, proxy, and TOR detection), abuse contacts, ASN lookup, bulk IP processing, timezone, astronomy, and user-agent parsing.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"node-red",
|
|
@@ -44,15 +44,15 @@
|
|
|
44
44
|
}
|
|
45
45
|
},
|
|
46
46
|
"dependencies": {
|
|
47
|
-
"axios": "^1.
|
|
47
|
+
"axios": "^1.21.0"
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
50
|
-
"@node-red/editor-client": "^
|
|
51
|
-
"mocha": "^
|
|
50
|
+
"@node-red/editor-client": "^4.1.17",
|
|
51
|
+
"mocha": "^12.0.2",
|
|
52
52
|
"nock": "^13.5.6",
|
|
53
|
-
"node-red": "^
|
|
53
|
+
"node-red": "^4.1.17",
|
|
54
54
|
"node-red-node-test-helper": "^0.3.6",
|
|
55
|
-
"nyc": "^
|
|
55
|
+
"nyc": "^18.0.0",
|
|
56
56
|
"should": "^13.2.3",
|
|
57
57
|
"sinon": "^17.0.1"
|
|
58
58
|
},
|
|
@@ -65,8 +65,20 @@
|
|
|
65
65
|
],
|
|
66
66
|
"scripts": {
|
|
67
67
|
"test": "mocha",
|
|
68
|
+
"test:http": "node test/run-http.js",
|
|
69
|
+
"test:package": "node test/package-install.js",
|
|
70
|
+
"audit:security": "node scripts/audit.js",
|
|
68
71
|
"test:watch": "mocha --watch",
|
|
69
72
|
"coverage": "nyc --reporter=text --reporter=html mocha",
|
|
70
|
-
"prepublishOnly": "npm test"
|
|
73
|
+
"prepublishOnly": "npm test && npm run audit:security"
|
|
74
|
+
},
|
|
75
|
+
"overrides": {
|
|
76
|
+
"@node-red/registry": {
|
|
77
|
+
"npm": "^11.21.1"
|
|
78
|
+
},
|
|
79
|
+
"multer": "^2.5.0",
|
|
80
|
+
"express": "^4.22.3",
|
|
81
|
+
"qs": "^6.17.0",
|
|
82
|
+
"body-parser@^1": "^1.20.9"
|
|
71
83
|
}
|
|
72
|
-
}
|
|
84
|
+
}
|