From 628187befb5d06d79645a22f03108d4c629274d1 Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 20 Jun 2026 22:15:43 +0000 Subject: [PATCH] Show a host-specific Docker remote-API setup script in Settings When adding/editing a Docker integration with a tcp:// or http:// remote URL, display a copyable systemd override + curl verification script scoped to the entered host:port, so enabling the daemon's API doesn't require looking up the steps separately. --- src/pages/Settings.tsx | 75 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 75 insertions(+) diff --git a/src/pages/Settings.tsx b/src/pages/Settings.tsx index 5a4130a..c77e0d7 100644 --- a/src/pages/Settings.tsx +++ b/src/pages/Settings.tsx @@ -784,6 +784,77 @@ function SshHostsSection() { type NewIntegrationDraft = { id: number; type: string; values: Record } +function dockerHostInfo(baseUrl: string): { host: string; port: string } | null { + if (!baseUrl || baseUrl.startsWith('unix://')) return null + try { + const u = new URL(baseUrl.replace(/^tcp:\/\//, 'http://')) + if (u.protocol !== 'http:' && u.protocol !== 'https:') return null + if (!u.hostname) return null + return { host: u.hostname, port: u.port || '2375' } + } catch { + return null + } +} + +function DockerSetupHint({ baseUrl }: { baseUrl: string }) { + const [copied, setCopied] = useState(false) + const info = dockerHostInfo(baseUrl) + if (!info) return null + + const script = `sudo mkdir -p /etc/systemd/system/docker.service.d +sudo tee /etc/systemd/system/docker.service.d/override.conf > /dev/null < +
+ + Run this on {info.host} to expose its Docker API on port {info.port}: + + +
+
+        {script}
+      
+ + ) +} + function IntegrationsSection() { const { user } = useAuth() const isAdmin = user?.role === 'admin' @@ -1051,6 +1122,9 @@ function IntegrationsSection() { '••••••••••••', existing, )} + {def.type === 'docker' && ( + + )} ) })} @@ -1100,6 +1174,7 @@ function IntegrationsSection() { (f, value) => setNewDraftField(draft.id, f.key, value), '', )} + {def.type === 'docker' && } ) })}