secure-repo 1.0.7 → 1.0.9

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/bin/cli.js +32 -28
  3. package/package.json +6 -1
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # ShipSecure
2
2
 
3
- [Website](https://shipsecure.sebiomo.com) | [Get the Pro Pack](https://buy.polar.sh/polar_cl_q7Wa3Gcng42437OoTx4wHVNyMMyYv0WbtobUv145EZH)
3
+ [Website](https://shipsecure.app) | [Get the Pro Pack](https://buy.polar.sh/polar_cl_q7Wa3Gcng42437OoTx4wHVNyMMyYv0WbtobUv145EZH)
4
4
 
5
5
  **Drop production-grade security standards into any repository in 30 seconds.**
6
6
 
package/bin/cli.js CHANGED
@@ -10,7 +10,8 @@ const FREE_DIR = path.join(TEMPLATES_DIR, "free");
10
10
 
11
11
  const POLAR_ORGANIZATION_ID = "d55baa70-3a94-4549-901a-2b4c920ff122";
12
12
 
13
- const PRO_ZIP_URL = "https://github.com/sebiomoa/shipsecure/releases/latest/download/shipsecure-pro.zip";
13
+ // Pro download endpoint (server-side proxy — token never ships in client code)
14
+ const PRO_DOWNLOAD_URL = "https://shipsecure.app/api/download-pro";
14
15
 
15
16
  const args = process.argv.slice(2);
16
17
  const command = args[0];
@@ -173,37 +174,40 @@ function verifyLicense(licenseKey) {
173
174
  }
174
175
 
175
176
  // ============================================================
176
- // Download file from URL
177
+ // Download pro zip via server-side proxy
177
178
  // ============================================================
178
- function downloadFile(url, destPath) {
179
+ function downloadProZip(destPath, licenseKey) {
179
180
  return new Promise((resolve, reject) => {
180
- const file = fs.createWriteStream(destPath);
181
-
182
- function follow(url) {
183
- https.get(url, (res) => {
184
- // Follow redirects
185
- if (res.statusCode >= 300 && res.statusCode < 400 && res.headers.location) {
186
- follow(res.headers.location);
187
- return;
188
- }
189
-
190
- if (res.statusCode !== 200) {
191
- reject(new Error(`Download failed (HTTP ${res.statusCode})`));
192
- return;
193
- }
181
+ const parsed = new URL(PRO_DOWNLOAD_URL);
182
+ const postData = JSON.stringify({ license_key: licenseKey });
183
+ const opts = {
184
+ hostname: parsed.hostname,
185
+ path: parsed.pathname,
186
+ method: "POST",
187
+ headers: {
188
+ "User-Agent": "secure-repo-cli",
189
+ "Content-Type": "application/json",
190
+ "Content-Length": Buffer.byteLength(postData),
191
+ },
192
+ };
194
193
 
195
- res.pipe(file);
196
- file.on("finish", () => {
197
- file.close();
198
- resolve();
194
+ const req = https.request(opts, (res) => {
195
+ if (res.statusCode !== 200) {
196
+ let body = "";
197
+ res.on("data", (chunk) => (body += chunk));
198
+ res.on("end", () => {
199
+ reject(new Error(`Download failed (HTTP ${res.statusCode}): ${body}`));
199
200
  });
200
- }).on("error", (err) => {
201
- fs.unlink(destPath, () => {});
202
- reject(new Error(`Download error: ${err.message}`));
203
- });
204
- }
201
+ return;
202
+ }
203
+ const file = fs.createWriteStream(destPath);
204
+ res.pipe(file);
205
+ file.on("finish", () => { file.close(); resolve(); });
206
+ });
205
207
 
206
- follow(url);
208
+ req.on("error", (err) => reject(new Error(`Network error: ${err.message}`)));
209
+ req.write(postData);
210
+ req.end();
207
211
  });
208
212
  }
209
213
 
@@ -300,7 +304,7 @@ async function init() {
300
304
  console.log("\n Downloading pro templates...");
301
305
 
302
306
  try {
303
- await downloadFile(PRO_ZIP_URL, zipPath);
307
+ await downloadProZip(zipPath, licenseKey);
304
308
  const proResult = installFromZip(zipPath, outputDir, force);
305
309
 
306
310
  const totalCopied = freeResult.copied + proResult.copied;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "secure-repo",
3
- "version": "1.0.7",
3
+ "version": "1.0.9",
4
4
  "description": "Drop production-grade security standards into any repo. Audit your repo for security issues. Templates for AI-assisted development.",
5
5
  "bin": {
6
6
  "secure-repo": "./bin/cli.js"
@@ -24,6 +24,11 @@
24
24
  ],
25
25
  "author": "sebiomoa",
26
26
  "license": "MIT",
27
+ "homepage": "https://shipsecure.app",
28
+ "repository": {
29
+ "type": "git",
30
+ "url": "https://github.com/sebiomoa/shipsecure"
31
+ },
27
32
  "files": [
28
33
  "bin/",
29
34
  "templates/free/"