Repository navigation
Cockpit Module
Cockpit is the web console of AlmaLinux, Rocky Linux, RHEL, Fedora,
Debian and Ubuntu servers (https://<server>:9090). WebPulse adds a Web analytics entry to its
menu with the same dashboard as the cPanel and WHM plugins: the overview, every tab, the server view,
CSV export and the printable report.
There is no web server, port or password of WebPulse's own: Cockpit logs you in with your Linux
account and runs webpulse for you through its process bridge.
Cockpit 266 or later (AlmaLinux/RHEL 9 and 10, Debian 12, Ubuntu 22.04 and later have it):
dnf install -y cockpit && systemctl enable --now cockpit.socket # or: apt install -y cockpitThen either a standalone installation, which adds the module whenever Cockpit is present (Standalone Install):
curl -fsSL https://raw.githubusercontent.com/inalto/webpulse/main/install.sh | bash -s -- --standaloneor the module alone, on an existing installation (also on a cPanel server that runs Cockpit):
/usr/local/webpulse/install.sh --update --cockpitThe installer writes /usr/share/cockpit/webpulse/manifest.json and index.html (generated by
webpulse page --cockpit). Cockpit picks the module up without a restart: reload the browser tab.
install.sh --update regenerates the page, install.sh --uninstall removes the directory.
Every request of the page runs /usr/local/webpulse/bin/webpulse cgi --cockpit --api with Cockpit's
superuser: "try":
-
Administrative access on (the lock button in Cockpit's top bar; your account must be allowed to
use
sudo, e.g. a member ofwheel): the process runs as root, which is the administrator view: every site, the Server view (accounts, settings, jobs, GeoIP, updates) and switching collection on and off. -
Limited access (administrative access off, or a user without sudo): the process runs as the
logged-in Linux user, who sees the sites they own, the
ownercolumn ofwebpulse sites(set withSuexecUserGroup, the owner of the document root, or"owner"in config.json). The statistics files are0640 root:<owner>, so the operating system enforces it; another user sees "No domains". On a cPanel server the Linux user is the cPanel account of the same name.
The REMOTE_USER environment variable is ignored; the principal is always the process's effective
uid. Cockpit reloads the page when administrative access changes (reload it yourself if it does not).
index.html contains the dashboard (ui/*.js, ui/app.css) and a small adapter (ui/cockpit.js)
that replaces HTTP with cockpit.spawn: the query string, method and body of each API call become the
CGI environment (REQUEST_METHOD, QUERY_STRING, CONTENT_LENGTH, HTTP_X_WEBPULSE_REQUEST) and the
standard input of webpulse cgi --cockpit --api, and its CGI reply (Status:, headers, JSON) is
handed back to the dashboard. At start the adapter asks a=whoami (principal and version, see the API
reference) and a=domains.
Inside Cockpit:
- Dark mode follows Cockpit's style (Cockpit » your user menu » Style), else the system preference.
- CSV downloads are produced in the browser (a Blob) instead of opening a URL.
- Download PDF opens the report in the module's own frame and calls the browser's print dialog for that frame only; "Back to dashboard" returns. Save as PDF in the dialog.
manifest.json allows the page's inline scripts and styles (content-security-policy); Cockpit adds
its own defaults for everything else.
-
No "Web analytics" entry: check
/usr/share/cockpit/webpulse/manifest.jsonexists, reload the page (Cockpit caches the menu per login: log out and in again). -
"Web analytics could not start" with "… was not found": the page runs the binary named in it
(
/usr/local/webpulse/bin/webpulse); re-runinstall.sh --update --cockpitafter moving it. -
A user sees no domains:
webpulse sitesshows the owner of each site; the statistics directory/var/webpulse/data/<owner>/must have the group of that user (created bycollectwhen the group exists). Sites without an owner belong tolocaland are visible with administrative access only. - Browser console: Cockpit's
window.debugging = "spawn"logs every spawned command.
WebPulse is open source under the MIT license. Source code and issues: github.com/inalto/webpulse.
Getting started
- Installation
- Updating and Uninstalling
- Manual Installation
- Standalone Install
- Cockpit Module
- Troubleshooting and FAQ
Using WebPulse
Reference
Project