From 07dbf2edc4b95344aa79fb08d6bc2d445323a202 Mon Sep 17 00:00:00 2001 From: Philipp Date: Thu, 21 May 2026 10:40:16 +0200 Subject: [PATCH] fixed syntax healthcheck --- backend/src/routes/health.js | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/backend/src/routes/health.js b/backend/src/routes/health.js index b8ef2c5..9565d4c 100644 --- a/backend/src/routes/health.js +++ b/backend/src/routes/health.js @@ -10,7 +10,14 @@ healthRouter.get('/', async (_req, res) => { const missing = missingEnvVars(); const checks = { config: checkValue(!missing.length, missing.length ? `missing: ${missing.join(', ')}` : 'ok'), - commands: await checkCommands(['incus', 'zfs', 'zpool', 'restic', 'udevadm', 'dd']), + commands: await checkCommands({ + incus: ['version'], + zfs: ['version'], + zpool: ['version'], + restic: ['version'], + udevadm: ['--version'], + dd: ['--version'], + }), zfsPool: await checkZfsPool(), zvol: await checkZvolAccess(), resticRepository: await checkResticRepository(), @@ -22,8 +29,8 @@ healthRouter.get('/', async (_req, res) => { async function checkCommands(commands) { const results = {}; - await Promise.all(commands.map(async (command) => { - results[command] = await checkCommand(command, ['--version']); + await Promise.all(Object.entries(commands).map(async ([command, args]) => { + results[command] = await checkCommand(command, args); })); const failed = Object.entries(results).filter(([, result]) => !result.ok); return {