Skip to content
agovena.
agovena.
Get started
Community

Provider guides

DirectAdmin: configuration and operations

Create, suspend, unsuspend, terminate and change DirectAdmin user accounts, with status sync and a read-only customer panel.

On this page

Status and workflow

The DirectAdmin extension provisions DirectAdmin user accounts under a reseller or admin account through the documented DirectAdmin legacy API. It supports create, suspension, unsuspension, termination, package changes with verification, status synchronization, reconciliation of interrupted creates and a read-only customer panel.

Production-ready for the documented scope. Every operation under Supported operations is implemented against the DirectAdmin legacy API documentation and verified with automated tests that replace the provider with faked HTTP responses, without network calls. Live acceptance on your own DirectAdmin account remains an operator responsibility: create, suspend, unsuspend, change and terminate one disposable user on your own DirectAdmin server before you sell it. Operations under Not supported are not advertised.

Requirements

  • Agovena Core ^0.0.1.
  • The Provisioning Module, enabled before this extension.
  • A DirectAdmin server reachable over HTTPS and a reseller or admin account that will own the created users.
  • A dedicated DirectAdmin Login Key for that account, restricted to the commands below and to the IP address of the Agovena server.
  • A free or shared IP address for new users and existing DirectAdmin user packages.

Set up the package

  1. Enable the Provisioning Module, then install and enable DirectAdmin in Admin > Extensions.
  2. Create the Login Key described above.
  3. Save api_url as https://host:2222 without path or credentials, api_username, the Login Key in api_token and the ip for new users. The Login Key is encrypted at rest and never shown again.
  4. Keep verify_tls enabled. It must stay on outside local development.
  5. Run Test connection. It lists the user packages of the API account (read-only).
  6. On each provisionable product, set an existing DirectAdmin user package and the domain.

Supported operations

Operation DirectAdmin command
Create POST /CMD_API_ACCOUNT_USER with action=create, username, email, passwd, passwd2, domain, package, ip and notify=yes
Suspend POST /CMD_API_SELECT_USERS with dosuspend=yes
Unsuspend POST /CMD_API_SELECT_USERS with dounsuspend=yes
Terminate POST /CMD_API_SELECT_USERS with confirmed=Confirm and delete=yes
Change plan GET /CMD_API_PACKAGES_USER, then POST /CMD_API_SELECT_USERS with dopackage=yes, verified with CMD_API_SHOW_USER_CONFIG
List plans and health GET /CMD_API_PACKAGES_USER
Status sync GET /CMD_API_SHOW_USER_CONFIG (suspended=yes or no)
Reconciliation read GET /CMD_API_SHOW_USERS, then CMD_API_SHOW_USER_CONFIG

Authentication is HTTP Basic with the Login Key. Responses are parsed in the documented url-encoded format. The customer panel shows the status, the plain DirectAdmin login URL, the username and the domain of an active or suspended claimed account, without single sign-on or credentials.

Not supported

  • Power actions, customer single sign-on and capacity checks. Checkout capacity stays disabled, as for every provider without a verified capacity API.
  • Per-order customer domains. The domain comes from the product setting, so one product creates one account per domain and server.
  • Adopting existing DirectAdmin users.

Failure handling and ownership

  • Ownership is proven only by a row in directadmin_accounts, inserted in state creating before the create call. The service, the username per server and the domain per server are unique, so two services can never claim the same username or domain on one server.
  • Every lifecycle action is refused without a remote call when the current server settings point to another endpoint.
  • The username is random, eight lowercase alphanumeric characters starting with a letter, generated once and stored in the claim, so retries reuse it. Product settings cannot choose it.
  • The create call runs outside any database transaction under a per-service lock, and its outcome is written as a compare-and-swap on revision.
  • error=1 marks the claim failed. Timeouts, non-200 responses and unparseable bodies mark it unknown. A retry reads the stored username first: absent means the create is repeated with the same username, present and matching means active, anything else stays unknown and is refused. A failed claim never adopts an existing user.
  • Terminate deletes only users of an active or suspended claim and keeps the row as terminated.
  • The generated 24-character password is sent once to DirectAdmin, which mails the login details to the customer. It is never stored, logged or returned. The Login Key only travels in the Authorization header. Redirects are not followed and calls are refused in the demo environment.

Configuration contract

Field Type Required Secret Default
api_url string Yes No Empty
api_username string Yes No Empty
api_token string Yes Yes Empty
ip string Yes No Empty
verify_tls boolean No No true
timeout string No No "20"

api_token holds the DirectAdmin Login Key. Reconciliation uses the user list of the API account, and an admin API user only sees the users it created itself. Store secret values only in the protected extension settings, never in product descriptions, URLs, screenshots or shared examples.

View the package entry

Sources

Search documentation

Search guides, commands and API endpoints

What are you looking for?

Documentation