@zerothreatai/cli 1.0.0 → 2.0.0
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/dist/index.js +6 -11
- package/dist/src/actions/license-service.js +1 -1
- package/dist/src/config/api-config.js +12 -4
- package/package.json +2 -3
- package/.env.prod +0 -2
package/dist/index.js
CHANGED
|
@@ -8,17 +8,12 @@ const commander_1 = require("commander");
|
|
|
8
8
|
const menu_js_1 = __importDefault(require("./src/menu.js"));
|
|
9
9
|
const start_setup_js_1 = require("./src/commands/start-setup.js");
|
|
10
10
|
const dotenv_1 = require("dotenv");
|
|
11
|
-
(
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
.version("1.0.0");
|
|
18
|
-
commander_1.program
|
|
19
|
-
.command("menu")
|
|
20
|
-
.description("Show main menu")
|
|
21
|
-
.action(menu_js_1.default);
|
|
11
|
+
if (process.env.WORKING_ENVIRONMENT)
|
|
12
|
+
(0, dotenv_1.config)({
|
|
13
|
+
path: `.env`,
|
|
14
|
+
});
|
|
15
|
+
commander_1.program.name("zt").description("ZEROTHREAT AI CLI").version("1.0.0");
|
|
16
|
+
commander_1.program.command("menu").description("Show main menu").action(menu_js_1.default);
|
|
22
17
|
commander_1.program.command("start-setup").action(start_setup_js_1.startSetup);
|
|
23
18
|
if (!process.argv.slice(2).length) {
|
|
24
19
|
(0, menu_js_1.default)();
|
|
@@ -57,7 +57,6 @@ async function runCompose(args) {
|
|
|
57
57
|
});
|
|
58
58
|
}
|
|
59
59
|
async function firstIgnition(licenseKey, emailId) {
|
|
60
|
-
console.log(">> Running first docker setup ...");
|
|
61
60
|
let token = '';
|
|
62
61
|
const acrTokenService = new acr_token_service_1.default();
|
|
63
62
|
const machineId = (0, get_mac_1.getMachineId)();
|
|
@@ -68,6 +67,7 @@ async function firstIgnition(licenseKey, emailId) {
|
|
|
68
67
|
if (app_constants_1.dockerComposeAcr) {
|
|
69
68
|
COMPOSE_FILE = app_constants_1.dockerComposeAcr;
|
|
70
69
|
}
|
|
70
|
+
console.log(">> Setting up application ...");
|
|
71
71
|
await ensureNetwork();
|
|
72
72
|
await pullImages();
|
|
73
73
|
await runCompose(["up", "-d"]);
|
|
@@ -2,9 +2,17 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.API_CONFIG = void 0;
|
|
4
4
|
const API_CONFIG = () => {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
5
|
+
if (!process.env.WORKING_ENVIRONMENT) {
|
|
6
|
+
return {
|
|
7
|
+
licenseApi: `http://localhost:3201/api/license`,
|
|
8
|
+
onPremLicenseCloudeApi: `https://api.zerothreat.ai/api/on-prem/license`,
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
else {
|
|
12
|
+
return {
|
|
13
|
+
licenseApi: process.env.LICENSE_API,
|
|
14
|
+
onPremLicenseCloudeApi: process.env.CLOUD_API,
|
|
15
|
+
};
|
|
16
|
+
}
|
|
9
17
|
};
|
|
10
18
|
exports.API_CONFIG = API_CONFIG;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zerothreatai/cli",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"build": "node build.js",
|
|
@@ -26,8 +26,7 @@
|
|
|
26
26
|
"node-machine-id": "^1.1.12"
|
|
27
27
|
},
|
|
28
28
|
"files": [
|
|
29
|
-
"dist"
|
|
30
|
-
".env.prod"
|
|
29
|
+
"dist"
|
|
31
30
|
],
|
|
32
31
|
"bin": {
|
|
33
32
|
"zt": "./dist/index.js"
|
package/.env.prod
DELETED