Fix agent install/uninstall sudo placement, add dependency install hints

curl ... | API_URL=... bash runs as the invoking user, not root, so
"sudo" has to go right after the pipe (elevating bash) rather than
before curl — the old commands in the app UI, README, and scripts'
own usage comments put it in a spot that still failed the root check.
Also have install.sh/report-tasks.sh suggest the right package-manager
command (apt/dnf/yum/apk/pacman/zypper) when curl or jq is missing
instead of just failing, and bring the README up to date with both.
This commit is contained in:
bobban committed 2026-09-02 23:12:12 +02:00
1 parent 0615866311
commit 329dcab936
5 files changed
+71 -18

No files matched your search

+4 -4
View File
@@ -89,8 +89,8 @@ export default function ServersAdmin() {
<h3>Agent token for {newToken.server.name}</h3>
<p>This token is only shown once — copy it now.</p>
<code className="token-value">{newToken.token}</code>
<p>Install the agent on the server:</p>
<pre className="install-command">{`curl -fsSL ${window.location.origin}/agent/linux/install.sh | API_URL=${window.location.origin} API_TOKEN=${newToken.token} bash`}</pre>
<p>Install the agent on the server (run as root — put sudo right after the pipe, not before curl):</p>
<pre className="install-command">{`curl -fsSL ${window.location.origin}/agent/linux/install.sh | sudo API_URL=${window.location.origin} API_TOKEN=${newToken.token} bash`}</pre>
<button onClick={() => setNewToken(null)} className="btn">
Dismiss
</button>
@@ -100,8 +100,8 @@ export default function ServersAdmin() {
{uninstallFor && (
<section className="token-reveal uninstall-reveal">
<h3>Uninstall agent from {uninstallFor.name}</h3>
<p>Run this on the server to stop and remove the agent (its entry here is kept):</p>
<pre className="install-command">{`curl -fsSL ${window.location.origin}/agent/linux/uninstall.sh | bash`}</pre>
<p>Run this on the server as root to stop and remove the agent (its entry here is kept):</p>
<pre className="install-command">{`curl -fsSL ${window.location.origin}/agent/linux/uninstall.sh | sudo bash`}</pre>
<button onClick={() => setUninstallFor(null)} className="btn">
Dismiss
</button>