@platforma-sdk/bootstrap 3.1.5 → 3.1.7
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/assets/compose-backend.yaml +2 -0
- package/dist/core.d.ts.map +1 -1
- package/dist/index.js +7 -7
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +122 -118
- package/dist/index.mjs.map +1 -1
- package/package.json +4 -4
package/dist/index.mjs
CHANGED
|
@@ -4,8 +4,8 @@ var l = (a, e, t) => $r(a, typeof e != "symbol" ? e + "" : e, t);
|
|
|
4
4
|
import { Flags as v, Command as L, Args as K } from "@oclif/core";
|
|
5
5
|
import F from "node:os";
|
|
6
6
|
import f, { createWriteStream as Lr } from "node:fs";
|
|
7
|
-
import m, { resolve as
|
|
8
|
-
import { execSync as
|
|
7
|
+
import m, { resolve as Ar } from "node:path";
|
|
8
|
+
import { execSync as Ie, spawn as Ir, spawnSync as mr } from "node:child_process";
|
|
9
9
|
import ge from "winston";
|
|
10
10
|
import { randomBytes as Or } from "node:crypto";
|
|
11
11
|
import Z from "readline-sync";
|
|
@@ -17,7 +17,7 @@ import { getDefaultPlVersion as fe } from "@milaboratories/pl-deployments";
|
|
|
17
17
|
import dr from "yaml";
|
|
18
18
|
import Tr from "node:https";
|
|
19
19
|
import * as xr from "tar";
|
|
20
|
-
const
|
|
20
|
+
const A = {
|
|
21
21
|
"log-level": v.string({
|
|
22
22
|
description: "logging level",
|
|
23
23
|
default: "info",
|
|
@@ -89,16 +89,16 @@ const me = {
|
|
|
89
89
|
storage: v.string({
|
|
90
90
|
description: "specify path on host to be used as storage for all Platforma Backend data"
|
|
91
91
|
})
|
|
92
|
-
},
|
|
92
|
+
}, pr = {
|
|
93
93
|
"minio-presign-host": v.boolean({
|
|
94
94
|
description: "use 'minio' host instead of 'localhost' in presign URLs"
|
|
95
95
|
})
|
|
96
|
-
},
|
|
96
|
+
}, pe = {
|
|
97
97
|
mount: v.string({
|
|
98
98
|
multiple: !0,
|
|
99
99
|
description: "things to be mounted into platforma docker container. Targets will appear inside the container under the same absolute paths"
|
|
100
100
|
})
|
|
101
|
-
},
|
|
101
|
+
}, ye = {
|
|
102
102
|
"pl-log-file": v.file({
|
|
103
103
|
description: "specify path for Platforma Backend log file"
|
|
104
104
|
})
|
|
@@ -174,7 +174,7 @@ function Cr(a) {
|
|
|
174
174
|
function G(a) {
|
|
175
175
|
throw new Error("this should never happen");
|
|
176
176
|
}
|
|
177
|
-
function
|
|
177
|
+
function I(a = "debug") {
|
|
178
178
|
return ge.createLogger({
|
|
179
179
|
level: a,
|
|
180
180
|
format: ge.format.printf(({ level: e, message: t }) => {
|
|
@@ -208,8 +208,8 @@ function Se(a, e) {
|
|
|
208
208
|
function Br(a) {
|
|
209
209
|
try {
|
|
210
210
|
if (F.platform() !== "win32")
|
|
211
|
-
return
|
|
212
|
-
const e = `wmic process where processid=${a} get Caption`, t =
|
|
211
|
+
return Ie(`ps -p ${a} -o comm=`, { encoding: "utf8" }).trim();
|
|
212
|
+
const e = `wmic process where processid=${a} get Caption`, t = Ie(e, { encoding: "utf8" }).split(`
|
|
213
213
|
`);
|
|
214
214
|
return t.length <= 1 ? "" : t[1].trim();
|
|
215
215
|
} catch {
|
|
@@ -217,15 +217,15 @@ function Br(a) {
|
|
|
217
217
|
}
|
|
218
218
|
}
|
|
219
219
|
function Ur(a) {
|
|
220
|
-
const e =
|
|
220
|
+
const e = Ie(`docker compose ls --filter name=${a} --format json`, { encoding: "utf8" }).trim(), t = JSON.parse(e);
|
|
221
221
|
for (const r of t)
|
|
222
222
|
if (r.Name === a)
|
|
223
223
|
return r;
|
|
224
224
|
}
|
|
225
|
-
const Oe = ["Python"],
|
|
225
|
+
const Oe = ["Python"], yr = ["Tengo", "Python"], Gr = N.union([N.literal("Tengo"), N.literal("Python")]), Jr = N.object({
|
|
226
226
|
npmOrgName: N.string().min(1),
|
|
227
|
-
orgName: N.string().min(1),
|
|
228
|
-
blockName: N.string().min(1),
|
|
227
|
+
orgName: N.string().min(1, { message: "Organization name must be provided" }),
|
|
228
|
+
blockName: N.string().min(1, { message: "Block name must be provided" }),
|
|
229
229
|
softwarePlatforms: N.array(Gr).refine((a) => new Set(a).size === a.length, {
|
|
230
230
|
message: "Must be an array of unique software platforms"
|
|
231
231
|
})
|
|
@@ -239,7 +239,7 @@ async function Hr(a) {
|
|
|
239
239
|
"platforma-block-boilerplate-main",
|
|
240
240
|
s
|
|
241
241
|
);
|
|
242
|
-
const i =
|
|
242
|
+
const i = yr.filter((o) => n.indexOf(o) < 0), c = Oe.length == i.length;
|
|
243
243
|
a.info(`Keep platforms '${n}', remove: '${i}'. Will remove all platforms? ${c}`);
|
|
244
244
|
for (const o of i)
|
|
245
245
|
await zr(s, o);
|
|
@@ -260,12 +260,16 @@ function Wr() {
|
|
|
260
260
|
const e = Z.question('Write an organization name, e.g. "my-org": '), t = Z.question('Write a name of the block, e.g. "hello-world": '), r = Z.keyInYN("Create package for block's software?");
|
|
261
261
|
let n = ["Tengo"];
|
|
262
262
|
if (r)
|
|
263
|
-
for (; n.length <
|
|
264
|
-
const
|
|
265
|
-
if (
|
|
266
|
-
n.push(Oe[
|
|
263
|
+
for (; n.length < yr.length; ) {
|
|
264
|
+
const i = Z.keyInSelect(Oe, "Choose software platform:");
|
|
265
|
+
if (i < 0) break;
|
|
266
|
+
n.push(Oe[i]);
|
|
267
267
|
}
|
|
268
|
-
|
|
268
|
+
n = Array.from(new Set(n)).sort();
|
|
269
|
+
const s = Jr.safeParse({ npmOrgName: a, orgName: e, blockName: t, softwarePlatforms: n });
|
|
270
|
+
if (!s.success && s.error.issues.length)
|
|
271
|
+
throw new Error(s.error.issues.map((i) => i.message).join("; "));
|
|
272
|
+
return s.data;
|
|
269
273
|
}
|
|
270
274
|
async function qr(a, e, t) {
|
|
271
275
|
const n = await (await fetch(a)).blob(), s = await _.mkdtemp(m.join(F.tmpdir(), "create-repo")), i = m.join(s, "packed-repo.zip"), c = Rr.toWeb(Lr(i));
|
|
@@ -334,16 +338,16 @@ async function ee(a, e) {
|
|
|
334
338
|
}
|
|
335
339
|
const re = class re extends L {
|
|
336
340
|
async run() {
|
|
337
|
-
const { flags: e } = await this.parse(re), t =
|
|
341
|
+
const { flags: e } = await this.parse(re), t = I(e["log-level"]);
|
|
338
342
|
await Hr(t);
|
|
339
343
|
}
|
|
340
344
|
};
|
|
341
345
|
l(re, "description", "Helps to create a new block by downloading a block's template."), l(re, "examples", ["<%= name %>"]), l(re, "flags", {
|
|
342
|
-
...
|
|
346
|
+
...A
|
|
343
347
|
});
|
|
344
348
|
let Re = re;
|
|
345
349
|
function wr(...a) {
|
|
346
|
-
return
|
|
350
|
+
return Ar(__dirname, "..", ...a);
|
|
347
351
|
}
|
|
348
352
|
function Q(...a) {
|
|
349
353
|
return wr("assets", ...a);
|
|
@@ -481,7 +485,7 @@ function Qr(a, e, t, r) {
|
|
|
481
485
|
cmd: ${JSON.stringify([e, ...t])}
|
|
482
486
|
wd: ${(c = r.cwd) == null ? void 0 : c.toString()}`
|
|
483
487
|
), r.env = { ...process.env, ...r.env }, a.debug(" spawning child process");
|
|
484
|
-
const n =
|
|
488
|
+
const n = Ir(e, t, r);
|
|
485
489
|
let s = !1;
|
|
486
490
|
const i = () => {
|
|
487
491
|
n.kill("SIGINT"), s = !0;
|
|
@@ -497,7 +501,7 @@ function Xr(a, e, t, r) {
|
|
|
497
501
|
opts: ${JSON.stringify(r)}`
|
|
498
502
|
), r.env = { ...process.env, ...r.env }, mr(e, t, r);
|
|
499
503
|
}
|
|
500
|
-
function
|
|
504
|
+
function Ae(a, e, t, r, n) {
|
|
501
505
|
const s = f.readFileSync(a, { encoding: "utf-8" }), i = dr.parse(s.toString());
|
|
502
506
|
if (!i.services)
|
|
503
507
|
throw new Error(`file '${a}' seems to be not a docker-compose file or has unsupported version`);
|
|
@@ -605,15 +609,15 @@ function X(a, e, t) {
|
|
|
605
609
|
}
|
|
606
610
|
}
|
|
607
611
|
function et(a, e) {
|
|
608
|
-
var w,
|
|
612
|
+
var w, p, P, S, k, y, $, le, Ge, Je, He, We, qe, ze, Ye, Ve, Ke, Qe, Xe, Ze, er, rr, tr, ar, nr, sr, ir, cr, or, lr;
|
|
609
613
|
const t = (e == null ? void 0 : e.localRoot) ?? u.instanceDir("default"), r = {
|
|
610
614
|
level: ((w = e == null ? void 0 : e.log) == null ? void 0 : w.level) ?? "info",
|
|
611
|
-
path: ((
|
|
615
|
+
path: ((p = e == null ? void 0 : e.log) == null ? void 0 : p.path) ?? `${t}/logs/platforma.log`
|
|
612
616
|
}, n = {
|
|
613
617
|
listen: ((P = e == null ? void 0 : e.grpc) == null ? void 0 : P.listen) ?? "localhost:6345",
|
|
614
618
|
tls: {
|
|
615
619
|
enable: de((k = (S = e == null ? void 0 : e.grpc) == null ? void 0 : S.tls) == null ? void 0 : k.enable, !1),
|
|
616
|
-
clientAuthMode: (($ = (
|
|
620
|
+
clientAuthMode: (($ = (y = e == null ? void 0 : e.grpc) == null ? void 0 : y.tls) == null ? void 0 : $.clientAuthMode) ?? "NoAuth",
|
|
617
621
|
certFile: ((Ge = (le = e == null ? void 0 : e.grpc) == null ? void 0 : le.tls) == null ? void 0 : Ge.certFile) ?? `${t}/certs/tls.cert`,
|
|
618
622
|
keyFile: ((He = (Je = e == null ? void 0 : e.grpc) == null ? void 0 : Je.tls) == null ? void 0 : He.keyFile) ?? `${t}/certs/tls.key`,
|
|
619
623
|
...(We = e == null ? void 0 : e.grpc) == null ? void 0 : We.tls
|
|
@@ -809,24 +813,24 @@ function st(a, e) {
|
|
|
809
813
|
return new Promise((o, d) => {
|
|
810
814
|
c.on("response", (g) => {
|
|
811
815
|
if (!g.statusCode) {
|
|
812
|
-
const
|
|
813
|
-
c.destroy(), d(
|
|
816
|
+
const p = new Error("failed to download archive: no HTTP status code in response from server");
|
|
817
|
+
c.destroy(), d(p);
|
|
814
818
|
return;
|
|
815
819
|
}
|
|
816
820
|
if (g.statusCode !== 200) {
|
|
817
|
-
const
|
|
818
|
-
c.destroy(), d(
|
|
821
|
+
const p = new Error(`failed to download archive: ${g.statusCode} ${g.statusMessage}`);
|
|
822
|
+
c.destroy(), d(p);
|
|
819
823
|
return;
|
|
820
824
|
}
|
|
821
825
|
const h = parseInt(g.headers["content-length"] || "0", 10);
|
|
822
826
|
let b = 0;
|
|
823
827
|
const w = f.createWriteStream(i);
|
|
824
|
-
g.pipe(w), g.on("data", (
|
|
825
|
-
b +=
|
|
828
|
+
g.pipe(w), g.on("data", (p) => {
|
|
829
|
+
b += p.length;
|
|
826
830
|
const P = b / h * 100;
|
|
827
831
|
r && process.stdout.write(` downloading: ${P.toFixed(2)}%\r`);
|
|
828
|
-
}), g.on("error", (
|
|
829
|
-
f.unlinkSync(i), a.error(`Failed to download Platforma Binary: ${
|
|
832
|
+
}), g.on("error", (p) => {
|
|
833
|
+
f.unlinkSync(i), a.error(`Failed to download Platforma Binary: ${p.message}`), c.destroy(), d(p);
|
|
830
834
|
}), w.on("finish", () => {
|
|
831
835
|
w.close(), a.info(" ... download done."), c.destroy(), o(i);
|
|
832
836
|
});
|
|
@@ -917,7 +921,7 @@ ${r}`);
|
|
|
917
921
|
return this.startInstance(e);
|
|
918
922
|
}
|
|
919
923
|
createLocal(e, t) {
|
|
920
|
-
var o, d, g, h, b, w,
|
|
924
|
+
var o, d, g, h, b, w, p, P, S, k;
|
|
921
925
|
const r = (t == null ? void 0 : t.binaryPath) ?? ct(t == null ? void 0 : t.version, "binaries", "platforma");
|
|
922
926
|
let n = t == null ? void 0 : t.configPath;
|
|
923
927
|
const s = (t == null ? void 0 : t.workdir) ?? (n ? process.cwd() : u.instanceDir(e));
|
|
@@ -935,17 +939,17 @@ ${r}`);
|
|
|
935
939
|
}
|
|
936
940
|
});
|
|
937
941
|
const i = et(this.getLastJwt(), t == null ? void 0 : t.configOptions);
|
|
938
|
-
this.logger.debug(" checking license..."), this.checkLicense((P = (
|
|
942
|
+
this.logger.debug(" checking license..."), this.checkLicense((P = (p = t == null ? void 0 : t.configOptions) == null ? void 0 : p.license) == null ? void 0 : P.value, (k = (S = t == null ? void 0 : t.configOptions) == null ? void 0 : S.license) == null ? void 0 : k.file);
|
|
939
943
|
const c = [
|
|
940
944
|
`${i.localRoot}/packages`,
|
|
941
945
|
`${i.localRoot}/packages-local`,
|
|
942
946
|
`${i.localRoot}/blocks-local`
|
|
943
947
|
];
|
|
944
948
|
i.storages.primary.type === "FS" && c.push(i.storages.primary.rootPath), i.storages.library.type === "FS" && (c.push(i.storages.library.rootPath), i.hacks.libraryDownloadable = !1), i.storages.work.type === "FS" && c.push(i.storages.work.rootPath), this.logger.debug(" creating pl state directories...");
|
|
945
|
-
for (const
|
|
946
|
-
f.existsSync(
|
|
947
|
-
for (const
|
|
948
|
-
|
|
949
|
+
for (const y of c)
|
|
950
|
+
f.existsSync(y) || (this.logger.debug(` '${y}'`), f.mkdirSync(y, { recursive: !0 }));
|
|
951
|
+
for (const y of i.core.auth.drivers)
|
|
952
|
+
y.driver === "htpasswd" && (f.existsSync(y.path) || (this.logger.debug(` installing default 'users.htpasswd' to ${y.path}...`), f.copyFileSync(Q("users.htpasswd"), y.path)));
|
|
949
953
|
return n || (n = m.join(i.localRoot, "config.yaml"), this.logger.debug(` rendering configuration '${n}'...`), f.writeFileSync(n, rt(i))), u.setInstanceInfo(e, {
|
|
950
954
|
type: "process",
|
|
951
955
|
upCommands: [
|
|
@@ -996,7 +1000,7 @@ ${r}`);
|
|
|
996
1000
|
createMinio(e, t) {
|
|
997
1001
|
this.logger.debug(" creating docker compose for minio service...");
|
|
998
1002
|
const r = Q("compose-backend.yaml"), n = u.instanceDir(e, "compose-minio.yaml");
|
|
999
|
-
|
|
1003
|
+
Ae(
|
|
1000
1004
|
r,
|
|
1001
1005
|
n,
|
|
1002
1006
|
`pl-${e}-minio`,
|
|
@@ -1054,8 +1058,8 @@ ${r}`);
|
|
|
1054
1058
|
this.logger.debug("creating platforma instance in 'docker s3' mode...");
|
|
1055
1059
|
const n = Q("compose-backend.yaml"), s = (r == null ? void 0 : r.image) ?? gr(r == null ? void 0 : r.version);
|
|
1056
1060
|
this.checkLicense(r == null ? void 0 : r.license, r == null ? void 0 : r.licenseFile);
|
|
1057
|
-
const i = (...
|
|
1058
|
-
const $ = i(
|
|
1061
|
+
const i = (...y) => m.join(t, ...y), c = (y) => {
|
|
1062
|
+
const $ = i(y);
|
|
1059
1063
|
return Se($, { mode: "0775" }), $;
|
|
1060
1064
|
}, o = i("logs", "platforma.log");
|
|
1061
1065
|
f.existsSync(o) || (f.mkdirSync(m.dirname(o), { recursive: !0 }), f.writeFileSync(o, ""));
|
|
@@ -1067,17 +1071,17 @@ ${r}`);
|
|
|
1067
1071
|
if (h.type !== "S3")
|
|
1068
1072
|
throw new Error(`${h.type} storage type is not supported for library storage`);
|
|
1069
1073
|
h.presignEndpoint = `http://${d}:9000`;
|
|
1070
|
-
const b = c("db"), w = c("work"),
|
|
1071
|
-
f.existsSync(
|
|
1074
|
+
const b = c("db"), w = c("work"), p = i("users.htpasswd");
|
|
1075
|
+
f.existsSync(p) || f.copyFileSync(Q("users.htpasswd"), p);
|
|
1072
1076
|
const P = i("compose.yaml");
|
|
1073
1077
|
f.existsSync(P) && this.logger.info(`replacing docker compose file ${P}`);
|
|
1074
1078
|
const S = [];
|
|
1075
|
-
for (const
|
|
1079
|
+
for (const y of (r == null ? void 0 : r.customMounts) ?? [])
|
|
1076
1080
|
S.push({
|
|
1077
|
-
hostPath:
|
|
1078
|
-
containerPath:
|
|
1081
|
+
hostPath: y.hostPath,
|
|
1082
|
+
containerPath: y.containerPath ?? y.hostPath
|
|
1079
1083
|
});
|
|
1080
|
-
|
|
1084
|
+
Ae(n, P, `pl-${e}`, /* @__PURE__ */ new Map([
|
|
1081
1085
|
["minio", {}],
|
|
1082
1086
|
["backend", {
|
|
1083
1087
|
platform: r == null ? void 0 : r.platformOverride,
|
|
@@ -1088,12 +1092,13 @@ ${r}`);
|
|
|
1088
1092
|
MINIO_IMAGE: "quay.io/minio/minio",
|
|
1089
1093
|
MINIO_STORAGE: c("minio"),
|
|
1090
1094
|
PL_IMAGE: s,
|
|
1091
|
-
PL_AUTH_HTPASSWD_PATH:
|
|
1095
|
+
PL_AUTH_HTPASSWD_PATH: p,
|
|
1092
1096
|
PL_LICENSE: r == null ? void 0 : r.license,
|
|
1093
1097
|
PL_LICENSE_FILE: r == null ? void 0 : r.licenseFile,
|
|
1094
1098
|
PL_LOG_LEVEL: (r == null ? void 0 : r.logLevel) ?? "info",
|
|
1095
1099
|
PL_LOG_DIR: m.dirname(o),
|
|
1096
1100
|
PL_LOG_ROTATION_ENABLED: "true",
|
|
1101
|
+
PL_RUNNER_WD_CACHE_ON_FAILURE: "1h",
|
|
1097
1102
|
PL_DATA_DB_ROOT: b,
|
|
1098
1103
|
PL_DATA_PRIMARY_ROOT: c("primary"),
|
|
1099
1104
|
PL_DATA_LIBRARY_ROOT: c("library"),
|
|
@@ -1104,8 +1109,8 @@ ${r}`);
|
|
|
1104
1109
|
...this.configureDockerStorage("library", h)
|
|
1105
1110
|
};
|
|
1106
1111
|
if (r != null && r.grpcAddr && (k.PL_GRPC_ADDR = r.grpcAddr), r != null && r.grpcPort && (k.PL_GRPC_PORT = r.grpcPort.toString()), r != null && r.monitoringAddr && (k.PL_MONITORING_ADDR = r.monitoringAddr), r != null && r.monitoringPort && (k.PL_MONITORING_PORT = r.monitoringPort.toString()), r != null && r.debugAddr && (k.PL_DEBUG_ADDR = r.debugAddr), r != null && r.debugPort && (k.PL_DEBUG_PORT = r.debugPort.toString()), r != null && r.auth && (r.auth.enabled && (k.PL_AUTH_ENABLED = "true"), r.auth.drivers)) {
|
|
1107
|
-
for (const
|
|
1108
|
-
|
|
1112
|
+
for (const y of r.auth.drivers)
|
|
1113
|
+
y.driver === "htpasswd" && (k.PL_AUTH_HTPASSWD_PATH = m.resolve(y.path), y.path = "/etc/platforma/users.htpasswd");
|
|
1109
1114
|
k.PL_AUTH_DRIVERS = JSON.stringify(r.auth.drivers);
|
|
1110
1115
|
}
|
|
1111
1116
|
return u.setInstanceInfo(e, {
|
|
@@ -1150,23 +1155,21 @@ ${r}`);
|
|
|
1150
1155
|
f.existsSync(o) || (f.mkdirSync(m.dirname(o), { recursive: !0 }), f.writeFileSync(o, ""));
|
|
1151
1156
|
const d = c("db"), g = c("primary"), h = c("library"), b = c("work"), w = i("users.htpasswd");
|
|
1152
1157
|
f.existsSync(w) || f.copyFileSync(Q("users.htpasswd"), w);
|
|
1153
|
-
const
|
|
1154
|
-
f.existsSync(
|
|
1158
|
+
const p = i("compose.yaml");
|
|
1159
|
+
f.existsSync(p) && this.logger.info(`replacing docker compose file ${p}`);
|
|
1155
1160
|
const P = [];
|
|
1156
1161
|
for (const $ of (r == null ? void 0 : r.customMounts) ?? [])
|
|
1157
1162
|
P.push({
|
|
1158
1163
|
hostPath: $.hostPath,
|
|
1159
1164
|
containerPath: $.containerPath ?? $.hostPath
|
|
1160
1165
|
});
|
|
1161
|
-
this.logger.debug(`Rendering docker compose file '${
|
|
1166
|
+
this.logger.debug(`Rendering docker compose file '${p}' using '${n}' as base template`), Ae(n, p, `pl-${e}`, /* @__PURE__ */ new Map([
|
|
1162
1167
|
["backend", {
|
|
1163
1168
|
platform: r == null ? void 0 : r.platformOverride,
|
|
1164
1169
|
mounts: P
|
|
1165
1170
|
}]
|
|
1166
1171
|
]));
|
|
1167
|
-
const S = X((r == null ? void 0 : r.primaryStorageURL) ?? `file:${g}`, "."), k = X((r == null ? void 0 : r.libraryStorageURL) ?? `file:${h}`, "."),
|
|
1168
|
-
MINIO_IMAGE: "quay.io/minio/minio",
|
|
1169
|
-
MINIO_STORAGE: c("minio"),
|
|
1172
|
+
const S = X((r == null ? void 0 : r.primaryStorageURL) ?? `file:${g}`, "."), k = X((r == null ? void 0 : r.libraryStorageURL) ?? `file:${h}`, "."), y = {
|
|
1170
1173
|
PL_IMAGE: s,
|
|
1171
1174
|
PL_AUTH_HTPASSWD_PATH: w,
|
|
1172
1175
|
PL_LICENSE: r == null ? void 0 : r.license,
|
|
@@ -1174,6 +1177,7 @@ ${r}`);
|
|
|
1174
1177
|
PL_LOG_LEVEL: "info",
|
|
1175
1178
|
PL_LOG_DIR: m.dirname(o),
|
|
1176
1179
|
PL_LOG_ROTATION_ENABLED: "true",
|
|
1180
|
+
PL_RUNNER_WD_CACHE_ON_FAILURE: "1h",
|
|
1177
1181
|
PL_DATA_DB_ROOT: d,
|
|
1178
1182
|
PL_DATA_PRIMARY_ROOT: g,
|
|
1179
1183
|
PL_DATA_LIBRARY_ROOT: h,
|
|
@@ -1182,29 +1186,29 @@ ${r}`);
|
|
|
1182
1186
|
...this.configureDockerStorage("primary", S),
|
|
1183
1187
|
...this.configureDockerStorage("library", k)
|
|
1184
1188
|
};
|
|
1185
|
-
if (r != null && r.grpcAddr && (
|
|
1189
|
+
if (r != null && r.grpcAddr && (y.PL_GRPC_ADDR = r.grpcAddr), r != null && r.grpcPort && (y.PL_GRPC_PORT = r.grpcPort.toString()), r != null && r.monitoringAddr && (y.PL_MONITORING_ADDR = r.monitoringAddr), r != null && r.monitoringPort && (y.PL_MONITORING_PORT = r.monitoringPort.toString()), r != null && r.debugAddr && (y.PL_DEBUG_ADDR = r.debugAddr), r != null && r.debugPort && (y.PL_DEBUG_PORT = r.debugPort.toString()), r != null && r.auth && (r.auth.enabled && (y.PL_AUTH_ENABLED = "true"), r.auth.drivers)) {
|
|
1186
1190
|
for (const $ of r.auth.drivers)
|
|
1187
|
-
$.driver === "htpasswd" && (
|
|
1188
|
-
|
|
1191
|
+
$.driver === "htpasswd" && (y.PL_AUTH_HTPASSWD_PATH = m.resolve($.path), $.path = "/etc/platforma/users.htpasswd");
|
|
1192
|
+
y.PL_AUTH_DRIVERS = JSON.stringify(r.auth.drivers);
|
|
1189
1193
|
}
|
|
1190
1194
|
return u.setInstanceInfo(e, {
|
|
1191
1195
|
type: "docker",
|
|
1192
1196
|
upCommands: [{
|
|
1193
1197
|
cmd: "docker",
|
|
1194
|
-
args: ["compose", `--file=${
|
|
1195
|
-
envs:
|
|
1198
|
+
args: ["compose", `--file=${p}`, "up", "--detach", "--remove-orphans", "--pull=missing"],
|
|
1199
|
+
envs: y,
|
|
1196
1200
|
runOpts: { stdio: "inherit" }
|
|
1197
1201
|
}],
|
|
1198
1202
|
downCommands: [{
|
|
1199
1203
|
cmd: "docker",
|
|
1200
|
-
args: ["compose", `--file=${
|
|
1201
|
-
envs:
|
|
1204
|
+
args: ["compose", `--file=${p}`, "down"],
|
|
1205
|
+
envs: y,
|
|
1202
1206
|
runOpts: { stdio: "inherit" }
|
|
1203
1207
|
}],
|
|
1204
1208
|
cleanupCommands: [{
|
|
1205
1209
|
cmd: "docker",
|
|
1206
|
-
args: ["compose", `--file=${
|
|
1207
|
-
envs:
|
|
1210
|
+
args: ["compose", `--file=${p}`, "down", "--volumes", "--remove-orphans"],
|
|
1211
|
+
envs: y,
|
|
1208
1212
|
runOpts: { stdio: "inherit" }
|
|
1209
1213
|
}],
|
|
1210
1214
|
runInfo: {
|
|
@@ -1367,38 +1371,38 @@ function ue(a, e) {
|
|
|
1367
1371
|
}
|
|
1368
1372
|
const te = class te extends L {
|
|
1369
1373
|
async run() {
|
|
1370
|
-
const { flags: e } = await this.parse(te), t =
|
|
1374
|
+
const { flags: e } = await this.parse(te), t = I(e["log-level"]);
|
|
1371
1375
|
new O(t).cleanupInstance();
|
|
1372
1376
|
}
|
|
1373
1377
|
};
|
|
1374
1378
|
l(te, "description", "Clear service state (forget last run command, destroy docker services, volumes and so on)"), l(te, "examples", ["<%= config.bin %> <%= command.id %>"]), l(te, "flags", {
|
|
1375
|
-
...
|
|
1379
|
+
...A
|
|
1376
1380
|
});
|
|
1377
1381
|
let Te = te;
|
|
1378
1382
|
const ae = class ae extends L {
|
|
1379
1383
|
async run() {
|
|
1380
|
-
const { flags: e } = await this.parse(ae), t =
|
|
1384
|
+
const { flags: e } = await this.parse(ae), t = I(e["log-level"]);
|
|
1381
1385
|
new O(t).startLast();
|
|
1382
1386
|
}
|
|
1383
1387
|
};
|
|
1384
1388
|
l(ae, "description", "Start last run service configuraiton"), l(ae, "examples", ["<%= config.bin %> <%= command.id %>"]), l(ae, "flags", {
|
|
1385
|
-
...
|
|
1389
|
+
...A
|
|
1386
1390
|
});
|
|
1387
1391
|
let xe = ae;
|
|
1388
1392
|
const ne = class ne extends L {
|
|
1389
1393
|
async run() {
|
|
1390
|
-
const { flags: e } = await this.parse(ne), t =
|
|
1394
|
+
const { flags: e } = await this.parse(ne), t = I(e["log-level"]), r = new O(t);
|
|
1391
1395
|
u.currentInstance ? r.stopInstance(u.currentInstance) : t.warn("up/start command was not called for any instance, nothing to stop");
|
|
1392
1396
|
}
|
|
1393
1397
|
};
|
|
1394
1398
|
l(ne, "description", "Stop platforma service"), l(ne, "examples", ["<%= config.bin %> <%= command.id %>"]), l(ne, "flags", {
|
|
1395
|
-
...
|
|
1399
|
+
...A
|
|
1396
1400
|
});
|
|
1397
1401
|
let De = ne;
|
|
1398
1402
|
var E;
|
|
1399
1403
|
let lt = (E = class extends L {
|
|
1400
1404
|
async run() {
|
|
1401
|
-
const { flags: e } = await this.parse(E), t =
|
|
1405
|
+
const { flags: e } = await this.parse(E), t = I(e["log-level"]), r = new O(t);
|
|
1402
1406
|
r.mergeLicenseEnvs(e);
|
|
1403
1407
|
const n = "docker", s = e["auth-enabled"], i = s ? {
|
|
1404
1408
|
enabled: s,
|
|
@@ -1427,14 +1431,14 @@ let lt = (E = class extends L {
|
|
|
1427
1431
|
r.switchInstance(g);
|
|
1428
1432
|
}
|
|
1429
1433
|
}, l(E, "description", "Run platforma backend service with 'FS' primary storage type"), l(E, "examples", ["<%= config.bin %> <%= command.id %>"]), l(E, "flags", {
|
|
1430
|
-
...
|
|
1434
|
+
...A,
|
|
1431
1435
|
...j,
|
|
1432
1436
|
...me,
|
|
1433
1437
|
...C,
|
|
1434
1438
|
...he,
|
|
1435
1439
|
...U,
|
|
1436
1440
|
...M,
|
|
1437
|
-
...
|
|
1441
|
+
...pe,
|
|
1438
1442
|
...B,
|
|
1439
1443
|
...ce,
|
|
1440
1444
|
...ie,
|
|
@@ -1443,7 +1447,7 @@ let lt = (E = class extends L {
|
|
|
1443
1447
|
var T;
|
|
1444
1448
|
let dt = (T = class extends L {
|
|
1445
1449
|
async run() {
|
|
1446
|
-
const { flags: e } = await this.parse(T), t =
|
|
1450
|
+
const { flags: e } = await this.parse(T), t = I(e["log-level"]), r = new O(t);
|
|
1447
1451
|
r.mergeLicenseEnvs(e);
|
|
1448
1452
|
const n = "local", s = e["pl-workdir"] ?? ".", i = e.storage ? m.join(s, e.storage) : u.instanceDir(n), c = e["pl-log-file"] ? m.join(s, e["pl-log-file"]) : void 0, o = r.initAuthDriversList(e, s), d = e["auth-enabled"] ?? o !== void 0;
|
|
1449
1453
|
let g = e["pl-binary"];
|
|
@@ -1454,7 +1458,7 @@ let dt = (T = class extends L {
|
|
|
1454
1458
|
e["monitoring-listen"] ? b = e["monitoring-listen"] : e["monitoring-port"] && (b = `127.0.0.1:${e["monitoring-port"]}`);
|
|
1455
1459
|
let w = "127.0.0.1:9091";
|
|
1456
1460
|
e["debug-listen"] ? w = e["debug-listen"] : e["debug-port"] && (w = `127.0.0.1:${e["debug-port"]}`);
|
|
1457
|
-
const
|
|
1461
|
+
const p = {
|
|
1458
1462
|
binaryPath: g,
|
|
1459
1463
|
version: e.version,
|
|
1460
1464
|
configPath: e.config,
|
|
@@ -1473,8 +1477,8 @@ let dt = (T = class extends L {
|
|
|
1473
1477
|
work: { type: "FS", rootPath: e["storage-work"] }
|
|
1474
1478
|
}
|
|
1475
1479
|
}
|
|
1476
|
-
}, P = r.createLocal(n,
|
|
1477
|
-
|
|
1480
|
+
}, P = r.createLocal(n, p);
|
|
1481
|
+
p.binaryPath ? r.switchInstance(P) : ke(t, { version: e.version }).then(() => {
|
|
1478
1482
|
const S = r.switchInstance(P);
|
|
1479
1483
|
setTimeout(() => {
|
|
1480
1484
|
for (const k of S)
|
|
@@ -1485,7 +1489,7 @@ let dt = (T = class extends L {
|
|
|
1485
1489
|
});
|
|
1486
1490
|
}
|
|
1487
1491
|
}, l(T, "description", "Run Platforma Backend service as local process on current host (no docker container)"), l(T, "examples", ["<%= config.bin %> <%= command.id %>"]), l(T, "flags", {
|
|
1488
|
-
...
|
|
1492
|
+
...A,
|
|
1489
1493
|
...C,
|
|
1490
1494
|
...j,
|
|
1491
1495
|
...we,
|
|
@@ -1496,18 +1500,18 @@ let dt = (T = class extends L {
|
|
|
1496
1500
|
...ce,
|
|
1497
1501
|
...ie,
|
|
1498
1502
|
...oe,
|
|
1499
|
-
...
|
|
1503
|
+
...ye,
|
|
1500
1504
|
...be,
|
|
1501
1505
|
...U
|
|
1502
1506
|
}), T);
|
|
1503
1507
|
const H = class H extends L {
|
|
1504
1508
|
async run() {
|
|
1505
|
-
const { flags: e, args: t } = await this.parse(H), r =
|
|
1509
|
+
const { flags: e, args: t } = await this.parse(H), r = I(e["log-level"]), n = new O(r), s = t.name;
|
|
1506
1510
|
e.all && (n.cleanupInstance(), process.exit(0)), s || (r.error("Please, specify name of instance to be removed or set '--all' flag instead"), process.exit(1)), n.cleanupInstance(s);
|
|
1507
1511
|
}
|
|
1508
1512
|
};
|
|
1509
1513
|
l(H, "description", "List available instances"), l(H, "examples", ["<%= config.bin %> <%= command.id %>"]), l(H, "flags", {
|
|
1510
|
-
...
|
|
1514
|
+
...A,
|
|
1511
1515
|
all: v.boolean({
|
|
1512
1516
|
description: "remove all known instances",
|
|
1513
1517
|
required: !1
|
|
@@ -1518,12 +1522,12 @@ l(H, "description", "List available instances"), l(H, "examples", ["<%= config.b
|
|
|
1518
1522
|
let Fe = H;
|
|
1519
1523
|
const W = class W extends L {
|
|
1520
1524
|
async run() {
|
|
1521
|
-
const { flags: e, args: t } = await this.parse(W), r =
|
|
1525
|
+
const { flags: e, args: t } = await this.parse(W), r = I(e["log-level"]), n = new O(r), s = t.name ?? u.currentInstanceName;
|
|
1522
1526
|
s || (r.info("no pl service instance selected. No service was stopped"), process.exit(0)), n.stopInstance(u.getInstanceInfo(s));
|
|
1523
1527
|
}
|
|
1524
1528
|
};
|
|
1525
1529
|
l(W, "description", "List available instances"), l(W, "examples", ["<%= config.bin %> <%= command.id %>"]), l(W, "flags", {
|
|
1526
|
-
...
|
|
1530
|
+
...A
|
|
1527
1531
|
}), l(W, "args", {
|
|
1528
1532
|
name: K.string({ required: !1 })
|
|
1529
1533
|
});
|
|
@@ -1542,7 +1546,7 @@ l(se, "description", "List available instances"), l(se, "examples", ["<%= config
|
|
|
1542
1546
|
let _e = se;
|
|
1543
1547
|
const q = class q extends L {
|
|
1544
1548
|
async run() {
|
|
1545
|
-
const { flags: e, args: t } = await this.parse(q), r =
|
|
1549
|
+
const { flags: e, args: t } = await this.parse(q), r = I(e["log-level"]), n = new O(r), s = t.name ?? u.currentInstanceName;
|
|
1546
1550
|
s || (r.error("no pl service instance is selected. Select instance with 'select' command or provide name to 'up'"), process.exit(1));
|
|
1547
1551
|
const i = n.switchInstance(u.getInstanceInfo(s)), c = [];
|
|
1548
1552
|
for (const o of i)
|
|
@@ -1553,7 +1557,7 @@ const q = class q extends L {
|
|
|
1553
1557
|
}
|
|
1554
1558
|
};
|
|
1555
1559
|
l(q, "description", "List available instances"), l(q, "examples", ["<%= config.bin %> <%= command.id %>"]), l(q, "flags", {
|
|
1556
|
-
...
|
|
1560
|
+
...A
|
|
1557
1561
|
}), l(q, "args", {
|
|
1558
1562
|
name: K.string({ required: !1 })
|
|
1559
1563
|
});
|
|
@@ -1561,7 +1565,7 @@ let Ce = q;
|
|
|
1561
1565
|
var x;
|
|
1562
1566
|
let gt = (x = class extends L {
|
|
1563
1567
|
async run() {
|
|
1564
|
-
const { flags: e } = await this.parse(x), t =
|
|
1568
|
+
const { flags: e } = await this.parse(x), t = I(e["log-level"]), r = new O(t);
|
|
1565
1569
|
r.mergeLicenseEnvs(e);
|
|
1566
1570
|
const n = "docker-s3", s = e["auth-enabled"], i = s ? {
|
|
1567
1571
|
enabled: s,
|
|
@@ -1588,21 +1592,21 @@ let gt = (x = class extends L {
|
|
|
1588
1592
|
r.switchInstance(h);
|
|
1589
1593
|
}
|
|
1590
1594
|
}, l(x, "description", "Run platforma backend service with 'S3' primary storage type"), l(x, "examples", ["<%= config.bin %> <%= command.id %>"]), l(x, "flags", {
|
|
1591
|
-
...
|
|
1595
|
+
...A,
|
|
1592
1596
|
...j,
|
|
1593
1597
|
...me,
|
|
1594
1598
|
...C,
|
|
1595
1599
|
...he,
|
|
1596
1600
|
...U,
|
|
1597
1601
|
...M,
|
|
1598
|
-
...
|
|
1602
|
+
...pe,
|
|
1599
1603
|
...B,
|
|
1600
|
-
...
|
|
1604
|
+
...pr
|
|
1601
1605
|
}), x);
|
|
1602
1606
|
var D;
|
|
1603
1607
|
let ut = (D = class extends L {
|
|
1604
1608
|
async run() {
|
|
1605
|
-
const { flags: e } = await this.parse(D), t =
|
|
1609
|
+
const { flags: e } = await this.parse(D), t = I(e["log-level"]), r = new O(t);
|
|
1606
1610
|
r.mergeLicenseEnvs(e);
|
|
1607
1611
|
const n = "local-s3", s = e["pl-workdir"] ?? ".", i = e.storage ? m.join(s, e.storage) : u.instanceDir(n), c = e["pl-log-file"] ? m.join(s, e["pl-log-file"]) : void 0, o = r.initAuthDriversList(e, s), d = e["auth-enabled"] ?? o !== void 0;
|
|
1608
1612
|
let g = e["pl-binary"];
|
|
@@ -1613,7 +1617,7 @@ let ut = (D = class extends L {
|
|
|
1613
1617
|
e["monitoring-listen"] ? b = e["monitoring-listen"] : e["monitoring-port"] && (b = `127.0.0.1:${e["monitoring-port"]}`);
|
|
1614
1618
|
let w = "127.0.0.1:9091";
|
|
1615
1619
|
e["debug-listen"] ? w = e["debug-listen"] : e["debug-port"] && (w = `127.0.0.1:${e["debug-port"]}`);
|
|
1616
|
-
const
|
|
1620
|
+
const p = {
|
|
1617
1621
|
binaryPath: g,
|
|
1618
1622
|
version: e.version,
|
|
1619
1623
|
configPath: e.config,
|
|
@@ -1636,8 +1640,8 @@ let ut = (D = class extends L {
|
|
|
1636
1640
|
work: { type: "FS", rootPath: e["storage-work"] }
|
|
1637
1641
|
}
|
|
1638
1642
|
}
|
|
1639
|
-
}, P = r.createLocalS3(n,
|
|
1640
|
-
|
|
1643
|
+
}, P = r.createLocalS3(n, p);
|
|
1644
|
+
p.binaryPath ? r.switchInstance(P) : ke(t, { version: e.version }).then(() => {
|
|
1641
1645
|
const S = r.switchInstance(P);
|
|
1642
1646
|
setTimeout(() => {
|
|
1643
1647
|
for (const k of S)
|
|
@@ -1648,7 +1652,7 @@ let ut = (D = class extends L {
|
|
|
1648
1652
|
});
|
|
1649
1653
|
}
|
|
1650
1654
|
}, l(D, "description", "Run Platforma Backend service as local process on current host (no docker container)"), l(D, "examples", ["<%= config.bin %> <%= command.id %>"]), l(D, "flags", {
|
|
1651
|
-
...
|
|
1655
|
+
...A,
|
|
1652
1656
|
...C,
|
|
1653
1657
|
...j,
|
|
1654
1658
|
...hr,
|
|
@@ -1660,13 +1664,13 @@ let ut = (D = class extends L {
|
|
|
1660
1664
|
...ce,
|
|
1661
1665
|
...ie,
|
|
1662
1666
|
...oe,
|
|
1663
|
-
...
|
|
1667
|
+
...ye,
|
|
1664
1668
|
...be,
|
|
1665
1669
|
...U
|
|
1666
1670
|
}), D);
|
|
1667
1671
|
const z = class z extends L {
|
|
1668
1672
|
async run() {
|
|
1669
|
-
const { flags: e, args: t } = await this.parse(z), r =
|
|
1673
|
+
const { flags: e, args: t } = await this.parse(z), r = I(e["log-level"]), n = new O(r);
|
|
1670
1674
|
n.mergeLicenseEnvs(e);
|
|
1671
1675
|
const s = t.name, i = e["auth-enabled"], c = i ? {
|
|
1672
1676
|
enabled: i,
|
|
@@ -1696,14 +1700,14 @@ const z = class z extends L {
|
|
|
1696
1700
|
}
|
|
1697
1701
|
};
|
|
1698
1702
|
l(z, "description", "Run Platforma Backend service as docker container on current host"), l(z, "examples", ["<%= config.bin %> <%= command.id %>"]), l(z, "flags", {
|
|
1699
|
-
...
|
|
1703
|
+
...A,
|
|
1700
1704
|
...j,
|
|
1701
1705
|
...me,
|
|
1702
1706
|
...C,
|
|
1703
1707
|
...he,
|
|
1704
1708
|
...U,
|
|
1705
1709
|
...M,
|
|
1706
|
-
...
|
|
1710
|
+
...pe,
|
|
1707
1711
|
...B,
|
|
1708
1712
|
...ce,
|
|
1709
1713
|
...ie,
|
|
@@ -1715,7 +1719,7 @@ let Me = z;
|
|
|
1715
1719
|
var R;
|
|
1716
1720
|
let ft = (R = class extends L {
|
|
1717
1721
|
async run() {
|
|
1718
|
-
const { flags: e, args: t } = await this.parse(R), r =
|
|
1722
|
+
const { flags: e, args: t } = await this.parse(R), r = I(e["log-level"]), n = new O(r);
|
|
1719
1723
|
n.mergeLicenseEnvs(e);
|
|
1720
1724
|
const s = t.name, i = e["pl-workdir"] ?? ".", c = e.storage ? m.join(i, e.storage) : u.instanceDir(s), o = e["pl-log-file"] ? m.join(i, e["pl-log-file"]) : void 0, d = n.initAuthDriversList(e, i), g = e["auth-enabled"] ?? d !== void 0;
|
|
1721
1725
|
let h = e["pl-binary"];
|
|
@@ -1724,8 +1728,8 @@ let ft = (R = class extends L {
|
|
|
1724
1728
|
e["grpc-listen"] ? b = e["grpc-listen"] : e["grpc-port"] && (b = `127.0.0.1:${e["grpc-port"]}`);
|
|
1725
1729
|
let w = "127.0.0.1:9090";
|
|
1726
1730
|
e["monitoring-listen"] ? w = e["monitoring-listen"] : e["monitoring-port"] && (w = `127.0.0.1:${e["monitoring-port"]}`);
|
|
1727
|
-
let
|
|
1728
|
-
e["debug-listen"] ?
|
|
1731
|
+
let p = "127.0.0.1:9091";
|
|
1732
|
+
e["debug-listen"] ? p = e["debug-listen"] : e["debug-port"] && (p = `127.0.0.1:${e["debug-port"]}`);
|
|
1729
1733
|
const P = {
|
|
1730
1734
|
binaryPath: h,
|
|
1731
1735
|
version: e.version,
|
|
@@ -1736,7 +1740,7 @@ let ft = (R = class extends L {
|
|
|
1736
1740
|
configOptions: {
|
|
1737
1741
|
grpc: { listen: b },
|
|
1738
1742
|
monitoring: { listen: w },
|
|
1739
|
-
debug: { listen:
|
|
1743
|
+
debug: { listen: p },
|
|
1740
1744
|
license: { value: e.license, file: e["license-file"] },
|
|
1741
1745
|
log: { path: o },
|
|
1742
1746
|
localRoot: c,
|
|
@@ -1755,7 +1759,7 @@ let ft = (R = class extends L {
|
|
|
1755
1759
|
});
|
|
1756
1760
|
}
|
|
1757
1761
|
}, l(R, "description", "Run Platforma Backend service as local process on current host (no docker container)"), l(R, "examples", ["<%= config.bin %> <%= command.id %>"]), l(R, "flags", {
|
|
1758
|
-
...
|
|
1762
|
+
...A,
|
|
1759
1763
|
...C,
|
|
1760
1764
|
...j,
|
|
1761
1765
|
...we,
|
|
@@ -1766,7 +1770,7 @@ let ft = (R = class extends L {
|
|
|
1766
1770
|
...ce,
|
|
1767
1771
|
...ie,
|
|
1768
1772
|
...oe,
|
|
1769
|
-
...
|
|
1773
|
+
...ye,
|
|
1770
1774
|
...be,
|
|
1771
1775
|
...U
|
|
1772
1776
|
}), l(R, "args", {
|
|
@@ -1774,7 +1778,7 @@ let ft = (R = class extends L {
|
|
|
1774
1778
|
}), R);
|
|
1775
1779
|
const Y = class Y extends L {
|
|
1776
1780
|
async run() {
|
|
1777
|
-
const { flags: e, args: t } = await this.parse(Y), r =
|
|
1781
|
+
const { flags: e, args: t } = await this.parse(Y), r = I(e["log-level"]), n = new O(r);
|
|
1778
1782
|
n.mergeLicenseEnvs(e);
|
|
1779
1783
|
const s = t.name, i = e["auth-enabled"], c = i ? {
|
|
1780
1784
|
enabled: i,
|
|
@@ -1802,23 +1806,23 @@ const Y = class Y extends L {
|
|
|
1802
1806
|
}
|
|
1803
1807
|
};
|
|
1804
1808
|
l(Y, "description", "Run Platforma Backend service as docker container on current host with MinIO as local S3 storage"), l(Y, "examples", ["<%= config.bin %> <%= command.id %>"]), l(Y, "flags", {
|
|
1805
|
-
...
|
|
1809
|
+
...A,
|
|
1806
1810
|
...j,
|
|
1807
1811
|
...me,
|
|
1808
1812
|
...C,
|
|
1809
1813
|
...he,
|
|
1810
1814
|
...U,
|
|
1811
1815
|
...M,
|
|
1812
|
-
...
|
|
1816
|
+
...pe,
|
|
1813
1817
|
...B,
|
|
1814
|
-
...
|
|
1818
|
+
...pr
|
|
1815
1819
|
}), l(Y, "args", {
|
|
1816
1820
|
name: K.string({ required: !0 })
|
|
1817
1821
|
});
|
|
1818
1822
|
let je = Y;
|
|
1819
1823
|
const V = class V extends L {
|
|
1820
1824
|
async run() {
|
|
1821
|
-
const { flags: e, args: t } = await this.parse(V), r =
|
|
1825
|
+
const { flags: e, args: t } = await this.parse(V), r = I(e["log-level"]), n = new O(r);
|
|
1822
1826
|
n.mergeLicenseEnvs(e);
|
|
1823
1827
|
const s = t.name, i = e["pl-workdir"] ?? ".", c = e.storage ? m.join(i, e.storage) : u.instanceDir(s), o = e["pl-log-file"] ? m.join(i, e["pl-log-file"]) : void 0, d = n.initAuthDriversList(e, i), g = e["auth-enabled"] ?? d !== void 0;
|
|
1824
1828
|
let h = e["pl-binary"];
|
|
@@ -1827,8 +1831,8 @@ const V = class V extends L {
|
|
|
1827
1831
|
e["grpc-listen"] ? b = e["grpc-listen"] : e["grpc-port"] && (b = `127.0.0.1:${e["grpc-port"]}`);
|
|
1828
1832
|
let w = "127.0.0.1:9090";
|
|
1829
1833
|
e["monitoring-listen"] ? w = e["monitoring-listen"] : e["monitoring-port"] && (w = `127.0.0.1:${e["monitoring-port"]}`);
|
|
1830
|
-
let
|
|
1831
|
-
e["debug-listen"] ?
|
|
1834
|
+
let p = "127.0.0.1:9091";
|
|
1835
|
+
e["debug-listen"] ? p = e["debug-listen"] : e["debug-port"] && (p = `127.0.0.1:${e["debug-port"]}`);
|
|
1832
1836
|
const P = {
|
|
1833
1837
|
binaryPath: h,
|
|
1834
1838
|
version: e.version,
|
|
@@ -1841,7 +1845,7 @@ const V = class V extends L {
|
|
|
1841
1845
|
configOptions: {
|
|
1842
1846
|
grpc: { listen: b },
|
|
1843
1847
|
monitoring: { listen: w },
|
|
1844
|
-
debug: { listen:
|
|
1848
|
+
debug: { listen: p },
|
|
1845
1849
|
license: { value: e.license, file: e["license-file"] },
|
|
1846
1850
|
log: { path: o },
|
|
1847
1851
|
localRoot: c,
|
|
@@ -1861,7 +1865,7 @@ const V = class V extends L {
|
|
|
1861
1865
|
}
|
|
1862
1866
|
};
|
|
1863
1867
|
l(V, "description", "Run Platforma Backend service as local process on current host (no docker container)"), l(V, "examples", ["<%= config.bin %> <%= command.id %>"]), l(V, "flags", {
|
|
1864
|
-
...
|
|
1868
|
+
...A,
|
|
1865
1869
|
...C,
|
|
1866
1870
|
...hr,
|
|
1867
1871
|
...j,
|
|
@@ -1873,7 +1877,7 @@ l(V, "description", "Run Platforma Backend service as local process on current h
|
|
|
1873
1877
|
...ce,
|
|
1874
1878
|
...ie,
|
|
1875
1879
|
...oe,
|
|
1876
|
-
...
|
|
1880
|
+
...ye,
|
|
1877
1881
|
...be,
|
|
1878
1882
|
...U
|
|
1879
1883
|
}), l(V, "args", {
|