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

+6
View File
@@ -5,6 +5,7 @@ import { authorize } from '$lib/server/authorize';
import { auditEnvironment } from '$lib/server/audit';
import { invalidateTokenCacheForUser } from '$lib/server/api-tokens';
import { refreshSubprocessEnvironments } from '$lib/server/subprocess-manager';
import { resetHostDetection, detectHostDataDir } from '$lib/server/host-path';
import { serializeLabels, parseLabels, MAX_LABELS } from '$lib/utils/label-colors';
import { cleanPem } from '$lib/utils/pem';
import { validateEnvName } from '$lib/utils/env-name';
@@ -125,6 +126,11 @@ export const POST: RequestHandler = async (event) => {
// Notify event collectors to pick up the new environment
refreshSubprocessEnvironments();
// Re-run host detection: a socket-proxy deployment with no direct env at boot
// can now reach Docker through this env without a restart (#1203). Fire-and-forget.
resetHostDetection();
void detectHostDataDir();
// Auto-assign Admin role to creator (Enterprise only)
if (auth.isEnterprise && auth.authEnabled && auth.isAuthenticated && !auth.isAdmin) {
const user = auth.user;
@@ -9,6 +9,7 @@ import { getStacksDir } from '$lib/server/stacks';
import { authorize } from '$lib/server/authorize';
import { auditEnvironment } from '$lib/server/audit';
import { refreshSubprocessEnvironments } from '$lib/server/subprocess-manager';
import { resetHostDetection, detectHostDataDir } from '$lib/server/host-path';
import { serializeLabels, parseLabels, MAX_LABELS } from '$lib/utils/label-colors';
import { cleanPem } from '$lib/utils/pem';
import { validateEnvName } from '$lib/utils/env-name';
@@ -155,6 +156,11 @@ export const PUT: RequestHandler = async (event) => {
return json({ error: 'Environment not found' }, { status: 404 });
}
// Re-run host detection: editing an env (e.g. pointing it at a socket proxy)
// lets a socketless deployment reach Docker without a restart (#1203).
resetHostDetection();
void detectHostDataDir();
// Notify event collectors if collectActivity or collectMetrics setting changed
if (data.collectActivity !== undefined || data.collectMetrics !== undefined) {
refreshSubprocessEnvironments();