From c933eb699ceaba39454394cdf2b68175054ac0f1 Mon Sep 17 00:00:00 2001 From: rcourtman Date: Fri, 24 Oct 2025 22:43:18 +0000 Subject: [PATCH] Align settings cards and add manual host install --- .../src/components/Settings/DockerAgents.tsx | 154 +++++++++--------- .../src/components/Settings/HostAgents.tsx | 100 ++++++++++++ 2 files changed, 177 insertions(+), 77 deletions(-) diff --git a/frontend-modern/src/components/Settings/DockerAgents.tsx b/frontend-modern/src/components/Settings/DockerAgents.tsx index 3be762c..4348b07 100644 --- a/frontend-modern/src/components/Settings/DockerAgents.tsx +++ b/frontend-modern/src/components/Settings/DockerAgents.tsx @@ -365,94 +365,94 @@ WantedBy=multi-user.target`; }; return ( -
- -
+
+ +

Add a Docker host

Run this command as root on your Docker host to start monitoring.

- -
-
-

Generate API token

-

- Create a fresh token scoped to {DOCKER_REPORT_SCOPE} +

+ +
+
+

Generate API token

+

+ Create a fresh token scoped to {DOCKER_REPORT_SCOPE} +

+
+ +
+ setTokenName(e.currentTarget.value)} + onKeyDown={(e) => { + if (e.key === 'Enter' && !isGeneratingToken()) { + handleGenerateToken(); + } + }} + placeholder="Token name (optional)" + class="flex-1 rounded-lg border border-gray-300 bg-white px-3 py-2 text-sm text-gray-900 shadow-sm focus:border-blue-500 focus:outline-none focus:ring-2 focus:ring-blue-200 dark:border-gray-700 dark:bg-gray-900 dark:text-gray-100 dark:focus:border-blue-400 dark:focus:ring-blue-900/60" + /> + +
+ + +
+ + + + + Token {latestRecord()?.name} created and inserted into the command below. + +
+
+
+
+ + +
+
+ + +
+
+                  {getInstallCommandTemplate().replace(TOKEN_PLACEHOLDER, currentToken() || TOKEN_PLACEHOLDER)}
+                
+

+ Run as root on your Docker host. The installer downloads the agent, creates a systemd service, and starts reporting automatically.

+
-
- setTokenName(e.currentTarget.value)} - onKeyDown={(e) => { - if (e.key === 'Enter' && !isGeneratingToken()) { - handleGenerateToken(); - } - }} - placeholder="Token name (optional)" - class="flex-1 rounded-lg border border-gray-300 bg-white px-3 py-2 text-sm text-gray-900 shadow-sm focus:border-blue-500 focus:outline-none focus:ring-2 focus:ring-blue-200 dark:border-gray-700 dark:bg-gray-900 dark:text-gray-100 dark:focus:border-blue-400 dark:focus:ring-blue-900/60" - /> - -
- - -
- - - - - Token {latestRecord()?.name} created and inserted into the command below. - -
-
-
- - - -
-
- - -
-
- - {getInstallCommandTemplate().replace(TOKEN_PLACEHOLDER, currentToken() || TOKEN_PLACEHOLDER)} - -
+

- Run as root on your Docker host. The installer downloads the agent, creates a systemd service, and starts reporting automatically. + Generate a token to see the install command.

-
-
- - -

- Generate a token to see the install command. -

-
+ +
diff --git a/frontend-modern/src/components/Settings/HostAgents.tsx b/frontend-modern/src/components/Settings/HostAgents.tsx index 53c7a29..3bd36f3 100644 --- a/frontend-modern/src/components/Settings/HostAgents.tsx +++ b/frontend-modern/src/components/Settings/HostAgents.tsx @@ -234,6 +234,28 @@ export const HostAgents: Component = () => { return currentToken() || 'disabled'; }; + const getSystemdServiceUnit = () => `[Unit] +Description=Pulse Host Agent +After=network-online.target +Wants=network-online.target + +[Service] +Type=simple +ExecStart=/usr/local/bin/pulse-host-agent --url ${pulseUrl()} --token ${resolvedToken()} --interval 30s +Restart=always +RestartSec=5s +User=root + +[Install] +WantedBy=multi-user.target`; + + const getManualUninstallCommand = () => + `sudo systemctl stop pulse-host-agent && \\ +sudo systemctl disable pulse-host-agent && \\ +sudo rm -f /etc/systemd/system/pulse-host-agent.service && \\ +sudo rm -f /usr/local/bin/pulse-host-agent && \\ +sudo systemctl daemon-reload`; + return (
@@ -365,6 +387,84 @@ export const HostAgents: Component = () => { )}
+
+ + Advanced options (manual install & uninstall) + +
+
+

Manual Linux install

+

+ Build the agent from source and manage the service yourself instead of using the helper script. +

+

1. Build the binary

+
+ + cd /opt/pulse +
+ CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o pulse-host-agent ./cmd/pulse-host-agent +
+
+

2. Copy to host

+
+ + scp pulse-host-agent user@host:/usr/local/bin/ +
+ ssh user@host sudo chmod +x /usr/local/bin/pulse-host-agent +
+
+

3. Systemd service template

+
+ +
+
{getSystemdServiceUnit()}
+
+
+

4. Enable & start

+
+ + sudo systemctl daemon-reload +
+ sudo systemctl enable --now pulse-host-agent +
+
+
+
+

Manual uninstall

+
+ + {getManualUninstallCommand()} + + +
+

+ Stops the agent, removes the systemd unit, and deletes the binary. +

+
+
+