Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - Watchdog

Pages: [1]
1
The official cwp7 module hasn't changed since 30 March 2020. WHMCS has shipped 15 releases since then and now requires PHP 8.2, so I rewrote it.

It's a drop-in replacement: same module name, same directory, same config option order. Existing server entries, products and services keep working with no reconfiguration.

https://github.com/bradleygb/whmcs-cwp-module



Why you'd switch

Running the 2020 module today, these are live faults, not style complaints:

  • Disk and bandwidth reporting has never worked. It matches tblhosting.dedicatedip against CWP's ip_address, but dedicatedip is empty for every shared-IP account, so the query matches no rows. It also writes lastupdate with date('Y-m-d H:i:S') - capital S is PHP's ordinal suffix, producing "14:30:th", which MySQL rejects.
  • Package changes don't work against current CWP. CWP has a dedicated /v1/changepack endpoint. The module posts to /v1/account with action=udp and the package suffixed "12@", where that endpoint documents a "@12" prefix. Nothing changes and WHMCS reports success.
  • Resource limits aren't applied. CWP's add endpoint wants limit_nofile and limit_nproc; account/udp wants openfiles and processes. The module sends nofile and nproc, which neither accepts, so every account gets its package defaults.
  • ChangePassword sends 'acction' instead of 'action'. The field never reaches CWP.
  • A fatal TypeError in your daily cron. count() is called on the API payload without checking it's an array - on PHP 8 that aborts the cron run.
  • The API key is written to the WHMCS Module Log in plaintext, and sent with CURLOPT_SSL_VERIFYPEER and VERIFYHOST both disabled.
  • A live autologin URL is minted on every product-details page load and printed into the page HTML, where it persists in page source, browser history and referrer headers.



What's in the rewrite

All of the above fixed. TLS verification on by default with optional certificate pinning. The API key masked in logs and stripped from CWP's own error text - CWP echoes it back inside "Unauthorized action". Autologin sessions minted on click through WHMCS single sign-on. Account creation given its own 180-second budget, and a creation that times out is reconciled rather than left as an orphaned account.

Added: MetaData, TestConnection, ServiceSingleSignOn, ListAccounts for Server Sync, live account detail on the admin service page, and a client area block that makes no API call while rendering - so an unreachable panel can't stall a customer's page.

Optionally, changing a service's Product/Service applies the package to CWP directly, with no second click.

Errors name the exact API Manager function and action when a permission is missing, which matters because CWP's internal permission names don't match its own labels - account/udp is checked as "accout_upd".



Requirements

WHMCS 8.5-9.0, PHP 7.4-8.3, curl and json. Tested on 7.4, 8.0, 8.1, 8.2 and 8.3. MIT licensed. Community module, not affiliated with the CWP project.

Install

Extract into modules/servers/ and press Test Connection. PERMISSIONS.md lists the exact API Manager grants - note the grid is per function and per action, and an action left off produces "Unauthorized action" even when the function looks enabled.

Upgrading: replace the directory contents, nothing else. One thing can stop a previously "working" install - TLS verification is now on. If CWP serves a certificate from a public CA on 2304 you're fine; if it's self-signed, the README covers pinning it.

Issues and pull requests welcome.

2
CentOS-WebPanel Bugs / dnf-automatic breaks postfix mysql maps on CWP
« on: August 01, 2026, 09:47:12 AM »
Heads up if you're running CWP with dnf-automatic installed for unattended updates: its first run silently swapped out CWP's custom-built postfix (compiled with MySQL support for virtual mailboxes) for the plain AlmaLinux baseos version, which doesn't have MySQL map support at all.

Code: [Select]
Transaction ID : 109
Begin time     : Sat Aug  1 06:30:15 2026
Begin rpmdb    : 905:a10ef5d78fa6d306985452fba3dac5db0cadc780
End time       : Sat Aug  1 06:30:22 2026 (7 seconds)
End rpmdb      : 905:5eb23852bf03e3fd7f4f1d08e2025cd84452d170
User           : System <unset>
Return-Code    : Success
Releasever     : 8
Command Line   :
Comment        :
Packages Altered:
    Upgrade  MariaDB-shared-10.11.18-1.el8.x86_64                      @mariadb
    Upgraded MariaDB-shared-10.5.29-1.el8.x86_64                       @@System
    Upgrade  galera-4-26.4.27-1.el8.x86_64                             @mariadb
    Upgraded galera-4-26.4.22-1.el8.x86_64                             @@System
    Upgrade  postfix-2:3.5.8-8.el8_10.x86_64                           @baseos
    Upgraded postfix-2:3.4.8-2.centos.8+p18.0.24.0+t200128.1353.x86_64 @@System

Mail started failing with "temporary lookup failure" on every message needing a virtual alias lookup.

Fixed it by finding the transaction(In my case 109) that did the swap in CWP's Yum Manager (under Yum History) and hitting Rollback to get the CWP build back. Also had to manually recreate /usr/lib64/postfix since it got left behind during the version change and postfix wouldn't start without it.

3
PHP Selector / Cant install any alt php version
« on: December 28, 2025, 06:43:34 PM »
I tried installing different php versions using the php selector, but it always fails.

Here is part of the build log:

Code: [Select]
Making install in example
make[1]: Entering directory '/usr/local/src/libssh2-1.9.0/example'
make[2]: Entering directory '/usr/local/src/libssh2-1.9.0/example'
make[2]: Nothing to be done for 'install-exec-am'.
make[2]: Nothing to be done for 'install-data-am'.
make[2]: Leaving directory '/usr/local/src/libssh2-1.9.0/example'
make[1]: Leaving directory '/usr/local/src/libssh2-1.9.0/example'
make[1]: Entering directory '/usr/local/src/libssh2-1.9.0'
make[2]: Entering directory '/usr/local/src/libssh2-1.9.0'
make[2]: Nothing to be done for 'install-exec-am'.
/usr/bin/mkdir -p '/usr/local/include'
/usr/bin/install -c -m 644 include/libssh2.h include/libssh2_publickey.h include/libssh2_sftp.h '/usr/local/include'
/usr/bin/mkdir -p '/usr/local/lib/pkgconfig'
/usr/bin/install -c -m 644 libssh2.pc '/usr/local/lib/pkgconfig'
make[2]: Leaving directory '/usr/local/src/libssh2-1.9.0'
make[1]: Leaving directory '/usr/local/src/libssh2-1.9.0'
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0 100 34265 100 34265 0 0 46179 0 --:--:-- --:--:-- --:--:-- 46117
/usr/local/cwpsrv/htdocs/resources/conf/el8/php_selector/external_modules/8.2/ssh2.sh: line 15: /opt/alt/php82/usr/bin/phpize: No such file or directory
/usr/local/cwpsrv/htdocs/resources/conf/el8/php_selector/external_modules/8.2/ssh2.sh: line 16: ./configure: No such file or directory
make: *** No targets specified and no makefile found. Stop.
make: *** No rule to make target 'install'. Stop.
/usr/local/cwpsrv/htdocs/resources/conf/el8/php_selector/external_modules/8.2/ssh2.sh: line 20: /opt/alt/php82/usr/bin/php-config: No such file or directory
ERROR: Missing extension file /ssh2.so

Build Completed
###################


Error:Can't add notification!

Could i maybe be missing a repo?

Code: [Select]
# ls /etc/yum.repos.d/
almalinux-ha.repo                almalinux-saphana.repo  epel.repo.rpmnew
almalinux-nfv.repo               almalinux-sap.repo      epel-testing-modular.repo
almalinux-plus.repo              alt-php.repo            epel-testing.repo
almalinux-powertools.repo        cloudlinux.repo         mariadb.repo
almalinux.repo                   cwp.repo                mariadb.repo.bak
almalinux-resilientstorage.repo  epel-modular.repo       nginx.repo
almalinux-rt.repo                epel.repo               pgdg-redhat-all.repo

Pages: [1]