@readystack/vagrantfile-eol-box-lint 1.0.0 → 1.0.1

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 (3) hide show
  1. package/README.md +1 -1
  2. package/license.js +22 -2
  3. package/package.json +2 -2
package/README.md CHANGED
@@ -48,7 +48,7 @@ Tools: `check_text` and `check_file` (free) · `check_dir` (licence). The agent
48
48
 
49
49
  The folder sweep, reports and CI mode need one licence — one payment, no subscription. Set `READYSTACK_LICENSE=<key>` or run `--license <key>` once.
50
50
 
51
- [Get a licence](https://buy.polar.sh/polar_cl_V7QtBX4V2E3XUIKVrEbN77vUFPXzkCCMtGEOl17yhbk)
51
+ [Get a licence](https://getreadystack.com/api/buy/cl/polar_cl_V7QtBX4V2E3XUIKVrEbN77vUFPXzkCCMtGEOl17yhbk)
52
52
 
53
53
 
54
54
  <!-- vagrantfile eol -->
package/license.js CHANGED
@@ -3,7 +3,7 @@
3
3
  const https = require('https'), fs = require('fs'), path = require('path'), os = require('os');
4
4
  const ORG_ID = 'a5cdf664-d8e7-4f87-8895-056717aaba17';
5
5
  const BENEFIT_ID = '8ce887e6-02cd-4911-8bfb-46a9545b731c'; // s142 — this product's Polar benefit (s140 law: ask with benefit_id, or one key opens every product)
6
- const BUY_URL = 'https://buy.polar.sh/polar_cl_V7QtBX4V2E3XUIKVrEbN77vUFPXzkCCMtGEOl17yhbk';
6
+ const BUY_URL = 'https://getreadystack.com/api/buy/cl/polar_cl_V7QtBX4V2E3XUIKVrEbN77vUFPXzkCCMtGEOl17yhbk';
7
7
  const SLUG = 'vagrantfile-eol-box-lint';
8
8
  const GRACE_MS = 30 * 24 * 3600 * 1000; // after a successful check, 30 days work offline
9
9
  const RECHECK_MS = 7 * 24 * 3600 * 1000; // re-ask Polar every 7 days (refunds / cancellations)
@@ -11,8 +11,28 @@ function storePath() { return path.join(process.env.READYSTACK_HOME || path.join
11
11
  function load() { try { return JSON.parse(fs.readFileSync(storePath(), 'utf8')); } catch (e) { return {}; } }
12
12
  function save(o) { try { fs.mkdirSync(path.dirname(storePath()), { recursive: true }); fs.writeFileSync(storePath(), JSON.stringify(o)); } catch (e) { /* read-only home: still works for this run */ } }
13
13
  const ALL_BENEFIT_ID = '22692551-5203-4467-b1a3-e33cdba6589d'; // s149 2026-09-17 — 팀 키(전 린터 한 키 · Polar benefit) · 상품 benefit 다음에 한 번 더 묻는다
14
+ // s170 2026-09-29 — ask OUR worker first (/api/lic): keys bought on Whop open here (a price-tier key binds to the first tool it opens · the team key opens every tool). Then the old Polar check.
14
15
  function validate(key) {
15
- return validate1(key, BENEFIT_ID).then(function (r) { return (r.ok || r.offline || !/^[0-9a-f-]{36}$/.test(ALL_BENEFIT_ID)) ? r : validate1(key, ALL_BENEFIT_ID); });
16
+ return validateHub(key).then(function (h) {
17
+ if (h.ok) return h;
18
+ return validate1(key, BENEFIT_ID).then(function (r) { return (r.ok || r.offline || !/^[0-9a-f-]{36}$/.test(ALL_BENEFIT_ID)) ? r : validate1(key, ALL_BENEFIT_ID); })
19
+ .then(function (r) { return r.ok ? r : { ok: false, offline: !!(h.offline || r.offline) }; });
20
+ });
21
+ }
22
+ function validateHub(key) {
23
+ return new Promise(function (resolve) {
24
+ const req = https.request({ hostname: 'getreadystack.com', path: '/api/lic?key=' + encodeURIComponent(key) + '&slug=' + encodeURIComponent(SLUG),
25
+ method: 'GET', timeout: 8000, headers: { 'accept': 'application/json', 'user-agent': 'readystack-cli/' + SLUG } }, function (res) {
26
+ let buf = ''; res.on('data', function (d) { buf += d; });
27
+ res.on('end', function () {
28
+ if (res.statusCode !== 200) return resolve({ ok: false, offline: res.statusCode >= 500 });
29
+ try { const j = JSON.parse(buf); resolve({ ok: !!(j && j.ok), offline: false }); } catch (e) { resolve({ ok: false, offline: false }); }
30
+ });
31
+ });
32
+ req.on('timeout', function () { req.destroy(); resolve({ ok: false, offline: true }); });
33
+ req.on('error', function () { resolve({ ok: false, offline: true }); });
34
+ req.end();
35
+ });
16
36
  }
17
37
  function validate1(key, ben) {
18
38
  return new Promise(function (resolve) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@readystack/vagrantfile-eol-box-lint",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "6 findings in 1 file: boxes past end of support, with the date and the box to move to",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "publishConfig": {
@@ -17,7 +17,7 @@
17
17
  "devops"
18
18
  ],
19
19
  "homepage": "https://getreadystack.com",
20
- "funding": "https://buy.polar.sh/polar_cl_V7QtBX4V2E3XUIKVrEbN77vUFPXzkCCMtGEOl17yhbk",
20
+ "funding": "https://getreadystack.com/api/buy/cl/polar_cl_V7QtBX4V2E3XUIKVrEbN77vUFPXzkCCMtGEOl17yhbk",
21
21
  "bin": {
22
22
  "vagrantfile-eol-box-lint": "cli.js"
23
23
  },