elpanctl
elpanctl is the operator CLI: most of what the admin app does, and the
server tasks that have no screen, such as initializing the server, backups
and the bulk repairs. It runs across all accounts on the server.
It runs in a root shell on the server. The command is root only
(/usr/sbin/elpanctl) and switches to the panel's own user itself, so you
never run it as another user or through sudo -u.
elpanctl <command> [arguments] [options]
Finding a command
A command's name is a few words separated by spaces, such as
server admin-user create.
elpanctl list lists the commands with a one-line description each,
grouped by namespace, the first word of the name, and list takes a
namespace to show only its commands:
elpanctl list
elpanctl list account
elpanctl help account create
elpanctl list prints every command on a line of its own, so a family of
commands with a common prefix, such as account purge run, account purge list and account purge status, stands together under its namespace, and
elpanctl list account purge shows just that family. No command is the
prefix of another: running the prefix alone (elpanctl account purge)
lists the commands under it.
elpanctl help <command>, or <command> --help, prints a command's
arguments and options. Commands are named by their full name; an
abbreviation elpanctl happens to accept is not a name to rely on.
The namespaces, by what they are about:
| Namespace | What it covers |
|---|---|
account | Accounts: create, list, view, edit the limits, suspend, terminate, delete, impersonate, reset credentials. |
service, host | Services (DNS zones, websites, mail, identity providers) and the hostnames they are attached to. host account, host user and the others under host are the mailboxes, forwarders and groups of a mail domain. |
server | The server itself: server init, server edit, server refresh, admin users, server API keys, sign-in help requests, telemetry. |
dns, certificate | DNS publication and inspection; certificates and the ACME accounts that issue them. |
backup, database | Backup repositories and assets; accounts' databases. |
webapp | The web applications across all accounts: the release catalog and mass upgrades. |
ip_address_group, appserver, webhook, oidc, assistant | Shared IP address groups, app servers, webhooks, the identity providers' clients and sessions, the AI assistant's conversations. |
housekeeping | The purges and recounts the timers run, for running one by hand. |
dkim | The server's DKIM key: dkim status and dkim rotate (DKIM Keys). |
intent | The configuration intent the daemons are configured from: intent status (whether each daemon applied it) and intent rebuild (Server configuration). |
Besides a command's own options, every command takes -n
(--no-interaction, no questions: for scripts) and -q (--quiet, errors
only). A command that asks for confirmation before something destructive
usually has --force to skip it.
Output formats
Commands that list things print a table by default and take --format:
| Format | Shape | For |
|---|---|---|
tsv | One row per line, tab-separated, with a header row unless --no-header. | awk, cut, xargs. |
jsonl | One JSON object per line. | jq. |
The commands that issue setup links (account create, account reset,
server admin-user create, host user reset, ...) also take --format,
with text, tsv, jsonl and table. text, the default, is the
hand-off view: one block per user with the link, the claim page and the
PIN, closed by the note to pass on. In every other format standard output
carries the records alone, and the human-facing messages go to standard
error, so a script can read the link without parsing prose.
The first column of a tsv listing is usually the identifier the matching
refresh, view or remove command takes, which is what makes the
pipelines below work.
The refresh commands
The panel writes configuration to the host (Apache and nginx vhosts, mail
routing, DNS records, Unix users and their lock state, database logins)
whenever the thing it describes changes. A refresh command rewrites
that configuration for one object as if it had just changed, without
changing anything in the panel's own records:
| Command | Takes | Rewrites |
|---|---|---|
host refresh <hostname> | A hostname. | The host's configuration and DNS records. |
service refresh <uuid> | A service UUID (from service list). | That service's configuration. |
account refresh <username or UUID> | An account. | The account's Unix side, and then its status again: the lock state of its Unix users, its websites, mail gates, DNS and database logins. |
host account refresh <user@hostname or UUID> | A mailbox, forwarder or group. | Its mail configuration. |
ip_address_group refresh <group ID> | A shared IP address group (from ip_address_group list). | The group's web server configuration (Apache, and the nginx frontend of every host in the group), the name server's and the mail filter's lists of the group's addresses, and the server's own DNS records. |
appserver refresh <ID> | An app server. | Its configuration. |
account_ip_address refresh <ID>... | Account IP addresses. | Their configuration. |
When to run one:
- After a release that changes what the server renders. The upgrade runs its own deploy tasks (Updates); when a release note says to refresh a kind of object, this is how.
- When the host drifted from the panel: the files on it no longer match what the panel holds, e.g. after a configuration file was edited by hand. The refresh puts back what the panel would have written.
- After a repair of the panel's records, so the host matches them.
For the daemons configured from the panel's intent, intent status says
whether each one applied it, and intent rebuild writes the intent of
every object again at once
(Server configuration).
Refreshing everything of one kind is a tsv listing piped into the refresh
command:
elpanctl account list --format=tsv --no-header | awk '{print $1}' | xargs -n1 elpanctl account refresh
elpanctl ip_address_group list --format=tsv --no-header | awk '{print $1}' | xargs -n1 elpanctl ip_address_group refresh
elpanctl service list --format=tsv --no-header --type=userwebsiteservice | awk '{print $1}' | xargs -n1 elpanctl service refresh
service list --owner=<username or server> and --type=<type> narrow a
service listing to one account or one kind, which is how you refresh, say,
every website and nothing else. Hosts and services
covers the service types.
server refresh
The server has configuration of its own: the system-wide config fragments,
the server-owned panel services (the admin app, the account panel, the mail
servers, the name servers), its keys, and the splash page on the bare
hostname. They are written when the server is created and whenever it
changes, which once installed is rarely. server refresh re-runs that
sync:
elpanctl server refresh
Run it when a release adds something the server is expected to own (a
config fragment, say), or after installing or removing
elpan-haproxy, which decides whether the websites' HTTPS records advertise
HTTP/3; the command reports which it is and how many hosts' records it
resynced.