reach own docker daemon over tcp on socket-proxy setups; re-run host detection when an environment is added or edited; keep scanner on the host socket

This commit is contained in:
jarek committed 2026-07-31 10:10:56 +02:00
1 parent 0a9d4ad10f
commit 6a6e82a481
8 files changed
+277 -84

No files matched your search

+22
View File
@@ -0,0 +1,22 @@
/**
* Pure host-path helpers. NO db / docker import, so unit-testable directly
* (importing host-path.ts pulls in the DB layer and would boot the database).
*/
/**
* Whether an environment can be used to inspect Dockhand's OWN container over a
* plain tcp:// address (the socket-proxy fallback, #1203/#1204). Only plain-http
* `direct` envs qualify: socket envs give no host:port (and we have no socket to
* reach anyway), https/mTLS envs need certs a bare tcp:// would drop, hawser envs
* are remote agents.
*/
export function isSelfInspectCandidate(env: {
connectionType?: string | null;
protocol?: string | null;
host?: string | null;
port?: number | null;
}): boolean {
return env.connectionType === 'direct'
&& (env.protocol ?? 'http') === 'http'
&& !!env.host && !!env.port;
}