mirror of
https://github.com/moltbot/moltbot.git
synced 2026-03-21 16:41:56 +00:00
Status command: parallelize JSON security audit
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import { formatCliCommand } from "../cli/command-format.js";
|
||||
import { withProgress } from "../cli/progress.js";
|
||||
import { resolveGatewayPort } from "../config/config.js";
|
||||
import { loadConfig, resolveGatewayPort } from "../config/config.js";
|
||||
import { buildGatewayConnectionDetails, callGateway } from "../gateway/call.js";
|
||||
import { info } from "../globals.js";
|
||||
import { formatTimeAgo } from "../infra/format-time/format-relative.ts";
|
||||
@@ -80,10 +80,33 @@ export async function statusCommand(
|
||||
return;
|
||||
}
|
||||
|
||||
const scan = await scanStatus(
|
||||
{ json: opts.json, timeoutMs: opts.timeoutMs, all: opts.all },
|
||||
runtime,
|
||||
);
|
||||
const [scan, securityAudit] = opts.json
|
||||
? await Promise.all([
|
||||
scanStatus({ json: opts.json, timeoutMs: opts.timeoutMs, all: opts.all }, runtime),
|
||||
runSecurityAudit({
|
||||
config: loadConfig(),
|
||||
deep: false,
|
||||
includeFilesystem: true,
|
||||
includeChannelSecurity: true,
|
||||
}),
|
||||
])
|
||||
: [
|
||||
await scanStatus({ json: opts.json, timeoutMs: opts.timeoutMs, all: opts.all }, runtime),
|
||||
await withProgress(
|
||||
{
|
||||
label: "Running security audit…",
|
||||
indeterminate: true,
|
||||
enabled: true,
|
||||
},
|
||||
async () =>
|
||||
await runSecurityAudit({
|
||||
config: loadConfig(),
|
||||
deep: false,
|
||||
includeFilesystem: true,
|
||||
includeChannelSecurity: true,
|
||||
}),
|
||||
),
|
||||
];
|
||||
const {
|
||||
cfg,
|
||||
osSummary,
|
||||
@@ -105,21 +128,6 @@ export async function statusCommand(
|
||||
memoryPlugin,
|
||||
} = scan;
|
||||
|
||||
const securityAudit = await withProgress(
|
||||
{
|
||||
label: "Running security audit…",
|
||||
indeterminate: true,
|
||||
enabled: opts.json !== true,
|
||||
},
|
||||
async () =>
|
||||
await runSecurityAudit({
|
||||
config: cfg,
|
||||
deep: false,
|
||||
includeFilesystem: true,
|
||||
includeChannelSecurity: true,
|
||||
}),
|
||||
);
|
||||
|
||||
const usage = opts.usage
|
||||
? await withProgress(
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user