Server agent setup
Cloudflare protection, the tunnel connector and the one-click WordPress address switch need a small agent on each cPanel/WHM server, because those steps run on the box itself and WHM’s API doesn’t reach them. Set it up once per server; everything else in the module runs over the WHM and cPanel APIs alone.
1. What it is and what needs it
Section titled “1. What it is and what needs it”The agent is an inbound, TLS, bearer-authenticated service on the server, the same shape as ImpulsePlesk’s file service: an unprivileged daemon (impulsecpa) under /opt/impulse-cpanel-agent, one root helper reached through a single sudoers rule, a self-signed certificate pinned on first contact, and an audit log that records actions, never tokens. It never calls out; your WHMCS server calls it.
| Depends on the agent | Runs without it |
|---|---|
| The Cloudflare tab, both ways: the customer’s own account and the protection you manage (the connector, the origin lock, the www redirect) | Websites, Email, Databases, FTP, SSL/TLS, DNS, Scheduled, Backups |
| Switch my site’s address to www (the WordPress one-click on the Cloudflare tab) | The Files tab (cPanel’s file API) |
| Operations → Cloudflare Tunnel: Install connector, Upgrade now, Check now, Set up, and the two tunnel crons | The Apps tab (a server-side cPanel session) and the Deploy tab (cPanel’s version-control API) |
2. Run the one-time installer
Section titled “2. Run the one-time installer”- Under ImpulseCpanel → Settings → General & Access → WHMCS server addresses, enter the public IPv4, IPv6 or both that this WHMCS server reaches your cPanel servers from — each a single address. The agent opens its port to these addresses only, and Installer refuses until at least one is set: set this WHMCS server’s IPv4, its IPv6, or both on Settings → General & Access first. Your WHMCS System URL must be HTTPS.
- In ImpulseCpanel → Infrastructure, open the server’s menu and choose Installer.
- Copy the one-line
curl … | sudo bashcommand the page shows. It is shown once and works once, within 24 hours; choosing Installer again replaces it. - Run it on the server as root, then use Test connection.
# On the cPanel/WHM server, as root — the addon generates this command per server:curl -fsSL "https://<your-whmcs>/modules/servers/impulsecpanel/agent-bootstrap.php?id=<token-id>" \ -H "X-Impulse-Token: <one-time-secret>" | sudo bashThe installer is re-runnable. It needs Python 3.10 or later (it installs one with dnf, yum or apt when the box has none) and openssl, and it stands up:
- A Python virtual environment under
/opt/impulse-cpanel-agentwith pinned dependencies, run by the unprivileged userimpulsecpa. - The root helper
/usr/local/sbin/impulse-cpanel-agent-opand the signed updater, with the module’s public key under/etc/impulse-cpanel-agent. - A self-signed TLS certificate and a systemd unit,
impulse-cpanel-agent, listening on TCP8448. - A firewall rule for that port, open to your WHMCS server addresses only: in CSF when the server has it (the usual case on cPanel), else firewalld, else UFW. With none of the three it prints a note to open the port by hand.
3. Test the connection & capture the pin
Section titled “3. Test the connection & capture the pin”Test connection in the server’s menu tests WHM, then the agent:
- It reads the agent’s TLS fingerprint over the unauthenticated
/tls-inforoute and pins it the first time (trust on first contact). A later certificate that doesn’t match the pin stops the test: Its agent presents a different certificate than the one pinned, so the module doesn’t trust it. Replace it on purpose with Disable agent, then Installer, then Test connection. - It then checks
/healthwith the bearer secret and records the agent’s version: Connected to … Its agent answers (v1.3.0).
The server’s detail page shows a Server agent row — Answering, Waiting for its installer, Didn’t answer its last test, Disabled — with the version it runs.
4. Update or disable
Section titled “4. Update or disable”Update: this release has no in-place update for the agent. To move a server to the agent a newer module release ships, run Installer on it again (the connector, by contrast, has its own Upgrade now under Operations → Cloudflare Tunnel, and a cron that keeps it current when you let it).
| Agent | Adds |
|---|---|
| 1.0.0 | The customer’s Cloudflare Tunnel connector and the per-site origin lock |
| 1.1.0 | Connector upgrades (the cloudflared package), on demand and from the hourly cron |
| 1.2.0 | The bare-domain redirect to www ahead of the lock, for the protection you manage |
| 1.3.0 | The WordPress Toolkit command line, for the one-click address switch |
Disable: choose Disable agent from the server’s menu. The module drops the bearer secret and stops using the agent — Cloudflare Tunnel connectors on … can no longer be managed until its agent is set up again — and Show details gives the one-line command that removes the agent, its files, the sudoers rule and the systemd unit from the server.