grepleaks 1.4.2 → 1.4.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.
- package/bin/grepleaks.js +11 -5
- package/package.json +1 -1
package/bin/grepleaks.js
CHANGED
|
@@ -8,7 +8,7 @@ const http = require('http');
|
|
|
8
8
|
const archiver = require('archiver');
|
|
9
9
|
const readline = require('readline');
|
|
10
10
|
|
|
11
|
-
const API_URL = '
|
|
11
|
+
const API_URL = 'https://grepleaks.com';
|
|
12
12
|
const CONFIG_FILE = '.grepleaksrc';
|
|
13
13
|
|
|
14
14
|
// Colors for terminal output
|
|
@@ -177,7 +177,7 @@ function submitScanJob(zipPath, apiKey, projectName) {
|
|
|
177
177
|
const url = new URL(`${API_URL}/api/v1/scan/async`);
|
|
178
178
|
const options = {
|
|
179
179
|
hostname: url.hostname,
|
|
180
|
-
port: url.port ||
|
|
180
|
+
port: url.port || 443,
|
|
181
181
|
path: url.pathname,
|
|
182
182
|
method: 'POST',
|
|
183
183
|
headers: {
|
|
@@ -187,7 +187,7 @@ function submitScanJob(zipPath, apiKey, projectName) {
|
|
|
187
187
|
},
|
|
188
188
|
};
|
|
189
189
|
|
|
190
|
-
const req =
|
|
190
|
+
const req = https.request(options, (res) => {
|
|
191
191
|
let data = '';
|
|
192
192
|
res.on('data', (chunk) => data += chunk);
|
|
193
193
|
res.on('end', () => {
|
|
@@ -223,7 +223,7 @@ function pollForCompletion(jobId, apiKey, maxAttempts = 60) {
|
|
|
223
223
|
const url = new URL(`${API_URL}/api/v1/scan/${jobId}/status`);
|
|
224
224
|
const options = {
|
|
225
225
|
hostname: url.hostname,
|
|
226
|
-
port: url.port ||
|
|
226
|
+
port: url.port || 443,
|
|
227
227
|
path: url.pathname,
|
|
228
228
|
method: 'GET',
|
|
229
229
|
headers: {
|
|
@@ -231,7 +231,7 @@ function pollForCompletion(jobId, apiKey, maxAttempts = 60) {
|
|
|
231
231
|
},
|
|
232
232
|
};
|
|
233
233
|
|
|
234
|
-
const req =
|
|
234
|
+
const req = https.request(options, (res) => {
|
|
235
235
|
let data = '';
|
|
236
236
|
res.on('data', (chunk) => data += chunk);
|
|
237
237
|
res.on('end', () => {
|
|
@@ -532,6 +532,12 @@ async function main() {
|
|
|
532
532
|
case '-h':
|
|
533
533
|
help();
|
|
534
534
|
break;
|
|
535
|
+
case 'version':
|
|
536
|
+
case '--version':
|
|
537
|
+
case '-v':
|
|
538
|
+
const pkg = require('../package.json');
|
|
539
|
+
console.log(`grepleaks v${pkg.version}`);
|
|
540
|
+
break;
|
|
535
541
|
default:
|
|
536
542
|
help();
|
|
537
543
|
}
|