Skip to content

About

Sell FeatherPanel game servers, VDS and web hosting from WHMCS: create, suspend, upgrade and terminate automatically!

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

1 Commit

Folders and files

Repository files navigation

FeatherPanel module for WHMCS

Requires FeatherPanel v1.5.6 or newer. Older panels lack the external-ID lookups for VDS and WebSpaces; Test Connection tells you if yours is too old.

Sell FeatherPanel game servers, VDS (Proxmox VMs) and web hosting (WebSpaces) from WHMCS. WHMCS creates, suspends, unsuspends, upgrades and deletes them in FeatherPanel, and clients open their service in the panel with one click (single sign-on).

Game server VDS Web hosting
Create (order accepted) ✓ picks a free port, tries the next node when one is full ✓ waits for the clone (up to 60 s, then finishes in the background) ✓ domain from the order, limits from a hosting package
Suspend / Unsuspend ✓ with the WHMCS reason ✓ with the WHMCS reason ✓
Upgrade / Downgrade ✓ RAM, disk, CPU, swap, IO, databases, backups, ports, image ✓ RAM, cores, sockets, backups, bandwidth; disk grows (never shrinks) ✓ switches hosting package or limits
Terminate ✓ ✓ ✓
Change password ✓ panel account password ✓ ✓
Single sign-on ✓ opens /server/<id> ✓ opens /vds/<id> ✓ opens /webspace/<id>
Client area / admin tab ✓ status and resources ✓ IP, status, resources ✓ domains, status, limits

Requirements

  • FeatherPanel v1.5.6 or newer (needs the /external/{id} lookups for VDS and WebSpaces).
  • WHMCS 8.x, PHP 8.1+ with cURL.
  • A FeatherPanel API key: Admin → API Keys → Create. Treat it like a root password: it can do anything in the panel.

Install

  1. Unzip featherpanel-whmcs-<version>.zip into your WHMCS root. You get modules/servers/featherpanel/.
  2. System Settings → Servers → Add New Server
    • Module: FeatherPanel
    • Hostname: your panel host, e.g. panel.example.com (a full URL such as https://example.com/panel also works)
    • Password: the FeatherPanel API key (or put it in Access Hash)
    • Secure: ticked for HTTPS
    • Click Test Connection. It checks the key and that the panel is new enough.
  3. Put the server in a server group and create a product (Product type: Other / Server), Module Settings → FeatherPanel.

The module creates one table, mod_featherpanel_users, the first time it runs. It remembers which panel account belongs to which WHMCS client.

Product settings

# Setting Game server VDS Web hosting
1 Product Type game vds webspace
2 Node ID(s) Wings node ID VM node ID Web node ID
3 Template ID Spell ID VM template ID WebPlate ID
4 Hosting Package ID – – hosting package (sets all limits)
5 Memory (MB) RAM RAM memory limit (empty = package)
6 Disk MB GB MB (empty = package)
7 CPU % (100 = 1 core) cores % (empty = package)
8 Swap (MB) ✓ – –
9 Block IO ✓ – –
10 CPU Sockets – ✓ –
11 Databases ✓ – ✓
12 Backups ✓ ✓ –
13 Allocations ports – –
14 Mailboxes – – ✓
15 Bandwidth (GB) – ✓ ✓
16 Docker Image empty = the spell's first image – –
17 Startup Command empty = spell default – –
18 Spell Variables KEY=VALUE per line – –
19 Cloud-init User – login user (default root) –
20 Storage – Proxmox storage –
21 Bridge – network bridge –
22 SSL – – issue a certificate
23 Name Template server name, e.g. {product} #{serviceid} – WebSpace name
24 Advanced see below

Node IDs take a comma list (3,4,7). The module uses the first node that has room. The VDS hostname comes from the order domain (the panel turns dots into dashes), otherwise vds-<serviceid>. Web hosting needs a domain on the order.

Name template placeholders: {product} {serviceid} {domain} {client} {clientid} {username}.

Advanced (key=value, one per line)

Key Default What it does
external_id_prefix whmcs Panel objects get external_id = <prefix>-<serviceid>. Use a different prefix per WHMCS install that shares one panel.
trust_email 0 Link an existing panel account with the same e-mail even when WHMCS has not verified the client's e-mail.
allowed_roles user Panel roles that may be linked to WHMCS clients (comma list). Staff accounts are never linked by default.
vds_wait_seconds 60 How long Create waits for a VDS clone before returning (it keeps running in the panel).
disk_key scsi0 / rootfs VDS disk to grow on upgrades.
skip_scripts 0 Game: skip the spell install script.
oom_disabled, threads Game server options.
on_boot VDS: start when the host boots.
document_root Web hosting document root.
suspend_reason Suspended by billing Used when WHMCS gives no reason.

Per-service values (Configurable Options and Custom Fields)

Any setting can be changed per order. Name a Configurable Option or a Custom Field like the setting and the module uses its value (custom fields win over configurable options, both win over the product):

  • memory, disk, cpu, swap, io, sockets, databases, backups, allocations, mailboxes, bandwidth, node_id, template_id, hosting_package_id, image, ssl, name (also ram, cores, ports, spell, os, package, …)
  • memory_gb, disk_gb, swap_gb: value in GB (×1024)
  • Names in CAPITALS are spell variables: a custom field MINECRAFT_VERSION|Minecraft version sets that variable.

Use the WHMCS name|Friendly Name format so clients see a friendly label, e.g. option memory|RAM with sub-options 4096|4 GB, 8192|8 GB.

How it behaves

  • Accounts. The first order of a client creates a panel account with the client's e-mail and the service password. Later orders reuse it. If the panel already has an account with that e-mail, it is linked only when it is a normal user account and the WHMCS e-mail is verified (or trust_email=1). Admin and other staff accounts are never linked, so no client gets SSO into a staff account.
  • Safe to retry. Every panel object carries external_id = whmcs-<serviceid>. Running Create twice (or the admin button Re-run Create (safe)) never makes a second server, VDS or WebSpace. A VDS that is still cloning is picked up instead of being queued again. A WebSpace whose web node did not answer is re-synced.
  • Terminate removes the server, VDS or WebSpace and keeps the panel account (it may own other services). Terminating something that is already gone succeeds.
  • Logs. Every API call is in System Logs → Module Log. The API key, passwords and SSO tokens are masked.

Troubleshooting

Message Fix
Update FeatherPanel to v1.5.6 or newer The panel lacks the external-id lookups. Update the panel.
Invalid API key / HTTP 401 Wrong key in the server Password / Access Hash.
Node N has no free allocation Add ports to the node, or list more nodes in Node IDs.
A FeatherPanel account with this e-mail already exists… Verify the client e-mail in WHMCS, or set trust_email=1.
…has a staff role… The e-mail belongs to a panel staff account. Use another e-mail for the client.
VDS shows creating The clone is still running in the panel; the client area updates when it finishes.

Testing

See TESTING.md for how this module was tested.

About

Sell FeatherPanel game servers, VDS and web hosting from WHMCS: create, suspend, upgrade and terminate automatically!

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages