|
@@ -28,10 +28,13 @@ const normalizeCommand = (cmd: string | null | undefined): string => {
|
|
|
return cmd.toLowerCase().replace(/\\/g, '/').trim();
|
|
return cmd.toLowerCase().replace(/\\/g, '/').trim();
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
|
|
+// n8n is only monitorable when running locally — skip process tracking if the webhook points elsewhere
|
|
|
|
|
+const N8N_IS_LOCAL = (process.env['N8N_WEBHOOK_URL'] ?? '').toLowerCase().includes('localhost');
|
|
|
|
|
+
|
|
|
// Matcher functions — nestjs uses PID identity; others use .some() over signature arrays for resilience
|
|
// Matcher functions — nestjs uses PID identity; others use .some() over signature arrays for resilience
|
|
|
const SERVICE_MATCHERS: Record<string, (p: si.Systeminformation.ProcessesProcessData) => boolean> = {
|
|
const SERVICE_MATCHERS: Record<string, (p: si.Systeminformation.ProcessesProcessData) => boolean> = {
|
|
|
nestjs: (p) => p.pid === process.pid,
|
|
nestjs: (p) => p.pid === process.pid,
|
|
|
- n8n: (p) => { const cmd = normalizeCommand(p.command); return ['n8n', 'n8n.exe', 'n8n-desktop'].some(sig => cmd.includes(sig)); },
|
|
|
|
|
|
|
+ n8n: (p) => { if (!N8N_IS_LOCAL) return false; const cmd = normalizeCommand(p.command); return ['n8n', 'n8n.exe', 'n8n-desktop'].some(sig => cmd.includes(sig)); },
|
|
|
ollama: (p) => { const cmd = normalizeCommand(p.command); return ['ollama', 'ollama_llama_server'].some(sig => cmd.includes(sig)); },
|
|
ollama: (p) => { const cmd = normalizeCommand(p.command); return ['ollama', 'ollama_llama_server'].some(sig => cmd.includes(sig)); },
|
|
|
};
|
|
};
|
|
|
|
|
|