Blesta module for Jabali Panel

Last updated

The Jabali Panel module for Blesta creates, suspends, upgrades and cancels hosting accounts on Jabali Panel. Clients get an Actions tab where they can change their password and log in to the panel with one click. It signs every request with an automation token, so Blesta never stores a panel admin password. Billing integrations covers how the API, scopes and ports work.

Requirements

  • Blesta 5.x
  • PHP 7.4 or newer with the curl and json extensions
  • The Blesta server can reach the panel on 8443, or on 443 with the port 443 option turned on
  • An automation token with read:status, read:users, read:packages, write:users and write:domains, plus delete:users for cancellation. See Create an automation token.

1. Install the module

Copy the blesta folder from the repository into Blesta as components/modules/jabali/:

git clone https://github.com/shukiv/jabali-billing-modules.git
cp -a jabali-billing-modules/blesta /var/www/blesta/components/modules/jabali

Replace /var/www/blesta with your Blesta directory. The folder must be named exactly jabali. Copy all of it, including apis/lib/, which holds the API client.

Then, in Blesta, go to Settings → Company → Modules → Available and install Jabali Panel.

2. Add a server

Open the module and click Add Server:

FieldValue
Server LabelAny name, e.g. Jabali EU-1
Panel HostnameThe panel hostname, e.g. panel.example.com
Panel Port8443, or 443 if the panel admin turned on Also serve the API on port 443
Automation Token IDThe automation token’s ID
Automation Token SecretThe automation token’s secret
Account LimitOptional cap on accounts for this server

Blesta checks the connection when you save. If saving fails, the credentials are wrong, the panel is unreachable, or the two clocks differ by more than 5 minutes.

3. Create a package

Create a Blesta package with the module set to Jabali Panel, then choose the panel’s hosting package:

  • Jabali Package: a dropdown of the panel’s packages. It needs the read:packages scope.
  • Package ID (manual override): if the dropdown is empty, choose — set below manually — and paste a package ID here.

What the module does

Blesta actionWhat happens on the panel
Add serviceCreates the account on the package’s hosting package and creates the order’s domain
Suspend / UnsuspendSuspends or reactivates the account
CancelDeletes the account and its domains (needs delete:users)
Change packageMoves the account to the new package’s hosting package
Client Actions tabChange Password, and Log in to Jabali Panel, which opens the panel with a single-use login link

The login button only appears when the panel supports one-click login. When the panel is unreachable, Blesta hides it.

Service fields. Clients enter the domain when they order. Staff adding a service by hand can also set the username, password and email. The module stores the panel user ID with the service as jabali_user_id.

Usernames. If none is given, the module builds one from the domain: lowercase letters and digits only, leading digits removed, padded to at least 3 characters and cut to 16. A username you enter must be 3 to 32 characters, start with a letter and contain only lowercase letters and digits.

Passwords. The panel needs at least 10 characters. If the order has no password, the module generates one that is long enough.

Email tags. Welcome and other service emails can use these tags:

LevelTags
Modulehost_name
Packagepackage_id
Servicejabali_username, jabali_password, jabali_domain, jabali_email, jabali_user_id

Troubleshooting

Module calls are logged in Tools → Logs → Module.

SymptomFix
Server won’t saveWrong token ID or secret, panel unreachable on that port, or clock skew. Sync both servers with NTP.
Add service fails with scope_deniedThe token lacks write:domains or write:users. See scopes.
Package dropdown is emptyThe token lacks read:packages. Add it, or use the manual override field.
”The password must be at least 10 characters long”Enter a longer password, or leave the field empty so the module generates one.
No Log in to Jabali Panel buttonThe panel is older than one-click login, or Blesta could not reach it.

More causes are in Billing integrations: Troubleshooting.

Frequently asked questions

Is there a Blesta module for Jabali Panel?
Yes. The free Jabali Panel module for Blesta 5.x creates, suspends, unsuspends and cancels hosting accounts, changes passwords and packages, and gives clients an Actions tab with password change and one-click panel login.
Where do I install the Jabali Blesta module?
Copy the module's blesta folder from the jabali-billing-modules repository to components/modules/jabali/ in your Blesta installation, then install Jabali Panel under Settings → Company → Modules → Available.
How does the Blesta module pick a username?
If the order has no username, the module builds one from the domain: lowercase letters and digits only, leading digits removed, padded to at least 3 characters and cut to 16. Usernames you enter must be 3-32 characters, start with a letter and contain only lowercase letters and digits.