From 2de5d1125d3ce0fb828d8839d05071d3c058c652 Mon Sep 17 00:00:00 2001 From: Ehsan <1883051+ehsanking@users.noreply.github.com> Date: Thu, 2 Apr 2026 23:26:46 +0330 Subject: [PATCH] Show successful ports beside verify stage tests --- cli.js | 12 ++++++++++++ src/checks/l4_tcp_443.js | 2 ++ src/checks/l5_tcp_80.js | 2 ++ 3 files changed, 16 insertions(+) diff --git a/cli.js b/cli.js index ddfc0a4..71df182 100755 --- a/cli.js +++ b/cli.js @@ -772,6 +772,17 @@ program 'Stages: L1 โ†’ L7' ])); const report = await runPipeline(target, { timeoutSeconds }); + const successfulPorts = [...new Set( + report.pipeline.levels + .filter((item) => item.ok && Number.isInteger(item.port)) + .map((item) => item.port) + )].sort((a, b) => a - b); + console.log(renderPanel('๐Ÿงช STAGE RESULTS', report.pipeline.levels.map((item) => { + const status = item.ok ? chalk.green('PASS') : chalk.red('FAIL'); + const portLabel = item.ok && Number.isInteger(item.port) + ? ` ${THEME.success(`(port ${item.port} โœ…)`)}` : ''; + return `${chalk.white(item.level)} ${THEME.muted(item.name)}: ${status}${portLabel}`; + }))); const body = JSON.stringify(report, null, 2); if (options.output) { fs.writeFileSync(options.output, body); @@ -782,6 +793,7 @@ program console.log(renderPanel('โœ… VERIFY SUMMARY', [ `Passed levels: ${chalk.white(report.pipeline.summary.passedLevels)}/${chalk.white(report.pipeline.summary.totalLevels)}`, `Pass rate: ${chalk.white(`${report.pipeline.summary.passRate}%`)}`, + `Successful ports: ${chalk.white(successfulPorts.length > 0 ? successfulPorts.join(', ') : '-')}`, `Generated: ${THEME.muted(report.generatedAt)}` ])); } catch (error) { diff --git a/src/checks/l4_tcp_443.js b/src/checks/l4_tcp_443.js index aab65f9..8807615 100644 --- a/src/checks/l4_tcp_443.js +++ b/src/checks/l4_tcp_443.js @@ -7,6 +7,8 @@ async function run(target, context) { return { level: 'L4', name: 'tcp-443', + port: 443, + protocol: 'tcp', ok: result.ok, details: result.ok ? 'TCP/443 is reachable' : `TCP/443 failed: ${result.error || 'unknown'}` }; diff --git a/src/checks/l5_tcp_80.js b/src/checks/l5_tcp_80.js index 28f3aea..817cf0e 100644 --- a/src/checks/l5_tcp_80.js +++ b/src/checks/l5_tcp_80.js @@ -7,6 +7,8 @@ async function run(target, context) { return { level: 'L5', name: 'tcp-80', + port: 80, + protocol: 'tcp', ok: result.ok, details: result.ok ? 'TCP/80 is reachable' : `TCP/80 failed: ${result.error || 'unknown'}` };