{# R20.2 (Hani #1 2026-10-30): Tools › cPanel - a read-only WHM API token, the WHM address approved like every device address, then what WHM knows. #} {% if cpanel_view %}{% set cv = cpanel_view %}

cPanel / WHM {{ fresh_tag("tools:cpanel") }}

{% if cpanel_done %}
{{ cpanel_done }}
{% endif %}{% if cpanel_error %}{% endif %}
    {% for key, label in [('add', 'Read-only API token'), ('approve', 'Approve WHM address'), ('read', 'Read WHM'), ('ok', 'Accounts and services')] %}
  1. {{ label }}
  2. {% endfor %}
{% if cv.step == 'removing' %}

The WHM token is being removed: its address approval is revoked first and the Portal restarts once. This page continues by itself; then add a new token.

{% elif cv.step == 'add' %}

NEXXVU reads the cPanel version, the hosted accounts with their domains, disk and bandwidth use, suspended accounts and cPanel's services, with a WHM API token that may only list. A token that can change anything is refused. The token is kept in this Portal's protected credential store and never shown again.

{% for g in cv.guidance %}

{{ g.title }}. {{ g.text }}

{% endfor %}
{% elif cv.step == 'approve' %}{% set d = cv.approval or {} %}{% set reg = cv.registration %}

WHM address {{ reg.host }}:{{ reg.port }} (HTTPS). Only this Portal may reach it, and only after approval.

{% if d.pending and d.pending.status == 'requested' and d.observed %}
WHM certificate SHA-256
{{ (d.observed.identity or {}).get('tls_sha256') or '—' }}

Compare it on the server: openssl s_client -connect 127.0.0.1:{{ reg.port }} </dev/null 2>/dev/null | openssl x509 -noout -fingerprint -sha256

{% if is_admin %}
{% else %}

A Portal administrator approves this address.

{% endif %} {% elif d.pending and d.pending.status == 'requested' %}

NEXXVU is reading WHM's certificate…

{% elif d.pending %}

Approved. The Portal applies the address and restarts once; this page continues by itself.

{% else %}{% if d.latest and d.latest.status == 'failed' %}

WHM did not answer: {{ d.latest.failure }}. Allow TCP {{ reg.port }} from this Portal's address on the server's firewall, then read the certificate again.

{% endif %}
{% endif %} {% elif cv.step == 'read' %}

The WHM address is approved. Read WHM now with the token.

{% else %}{% set rep = cv.report or {} %} {% if cv.step == 'failed' %}{% endif %} {% if rep.steps %}
Read steps
    {% for e in rep.steps %}
  1. {{ e.label or e.key or e.name or 'Step' }} - {{ e.state }}{% if e.message %}
    {% endif %}
  2. {% endfor %}
{% endif %}
cPanel & WHM
{{ cv.version or 'version not readable with a read-only token' }}
Accounts
{{ cv.accounts|length }}{% if cv.suspended %} · {{ cv.suspended }} suspended{% endif %}
Disk used
{{ '%.1f'|format((cv.disk_used_mb or 0) / 1024) }} GB
Bandwidth this month
{{ '%.1f'|format((cv.bandwidth_bytes or 0) / 1073741824) }} GB
Services
{% if not cv.services_readable %}not readable with this token (View Server Status){% elif cv.down %}Not running: {{ cv.down|join(', ') }}{% else %}{{ cv.services|length }} running{% endif %}
Last read
{{ (cv.registration.validated_at or '')|replace('T', ' ')|replace('Z', ' UTC') }} · read again every 6 hours
{% if cv.accounts %}
{% for a in cv.accounts[:200] %}{% endfor %}
DomainAccountPlanDiskBandwidthState
{{ a.domain }}{{ a.user }}{{ a.plan or '—' }}{{ a.disk_used_mb if a.disk_used_mb is not none else '—' }} MB{% if a.disk_limit_mb %} of {{ a.disk_limit_mb }}{% endif %}{% if a.bandwidth_bytes is not none %}{{ '%.1f'|format(a.bandwidth_bytes / 1048576) }} MB{% else %}—{% endif %}{% if a.suspended %}Suspended{% else %}Active{% endif %}
{% if cv.accounts|length > 200 %}

The first 200 of {{ cv.accounts|length }} accounts, largest disk use first.

{% endif %}{% endif %}
{% endif %} {% if cv.step not in ('add', 'removing') %}
Replace the token

WHM shows a token only once, when it is created. Generate a new one (List Accounts, View Bandwidth Usage, View Server Status), paste it here, then read WHM again. The approved address stays.

{% endif %} {% if cv.step not in ('add', 'removing') %}
Remove the WHM token

NEXXVU forgets the token and the WHM address{% if (cv.approval or {}).active %} (its approval is revoked first; the Portal restarts once){% endif %}. Delete the token in WHM › Manage API Tokens too.

{% if (cv.approval or {}).active %}{% endif %}
{% endif %}
{% endif %}