From a4b90f8d840a0efa6954c7d53f3aaa3f45877e3f Mon Sep 17 00:00:00 2001 From: Luke S Thompson Date: Sun, 19 Oct 2025 09:49:08 +1100 Subject: [PATCH] v1.2.17: VNC & Hyperscalers! --- CHANGELOG.md | 13 +++++++---- _docs/UPDATE-SQL.md | 7 ++++++ modules/addons/pvewhmcs/db.sql | 22 ++++++++--------- modules/addons/pvewhmcs/pvewhmcs.php | 35 ++++++++++++++++++++++++++-- version | 2 +- 5 files changed, 60 insertions(+), 19 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7b557dd..9f38bca 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,15 +5,18 @@ All notable changes to Proxmox VE for WHMCS will be documented in this file. https://github.com/The-Network-Crew/Proxmox-VE-for-WHMCS/milestones +## [1.2.17] - 2025-10-19 - _"VNC & Hyperscale!"_ + ### 💅 Polish -- Max Memory: Ensure you can set more than 128GB (#167) -- Max CPUs/Cores: Expand column to allow for 100+ (#167) -- VNC Prepared: Green background with clearer wording -- Check Status: Allow for client-driven status checks +- Max Memory: Ensure you can set more than 128GB (#169) +- Max CPUs/Cores: Expand column to allow for 100+ (#169) +- VNC Prepared: Green background with clearer wording (#167) +- Check Status: Allow for client-driven status checks (#168) ### 🐛 Bug Fix - noVNC: Delete PVEAuthCookie before setting it (#167) -- noVNC: PVEAuthCookie is now set to be secure-only +- noVNC: PVEAuthCookie is secure & samesite=None (#167) +- SQL -> Plans: Expand several fields (future-proof) (#169) ## [1.2.16] - 2025-10-15 - _"Minor Adjustments"_ diff --git a/_docs/UPDATE-SQL.md b/_docs/UPDATE-SQL.md index f7a4c0c..913ab5a 100644 --- a/_docs/UPDATE-SQL.md +++ b/_docs/UPDATE-SQL.md @@ -1,5 +1,12 @@ # SQL Statements for Updates (nav to DB first) +## v1.2.14 & onwards... + +> [!NOTE] +> As we transition to auto-updating, you can interpret manual queries in the `pvewhmcs_upgrade` function. +> +> It is located in the /modules/addons/pvewhmcs/pvewhmcs.php file near-ish the top. Thank you. + ## v1.2.10 to v1.2.12 ``` diff --git a/modules/addons/pvewhmcs/db.sql b/modules/addons/pvewhmcs/db.sql index 3691f2e..d206700 100644 --- a/modules/addons/pvewhmcs/db.sql +++ b/modules/addons/pvewhmcs/db.sql @@ -71,14 +71,14 @@ CREATE TABLE IF NOT EXISTS `mod_pvewhmcs_plans` ( `title` varchar(255) CHARACTER SET utf8 NOT NULL, `vmtype` varchar(8) NOT NULL, `ostype` varchar(8) DEFAULT NULL, - `cpus` tinyint(3) unsigned DEFAULT NULL, + `cpus` smallint(4) unsigned DEFAULT NULL, `cpuemu` varchar(30) CHARACTER SET utf8 DEFAULT NULL, - `cores` tinyint(3) unsigned DEFAULT NULL, + `cores` smallint(4) unsigned DEFAULT NULL, `cpulimit` smallint(5) unsigned DEFAULT NULL, `cpuunits` smallint(5) unsigned DEFAULT NULL, - `memory` smallint(8) unsigned NOT NULL, - `swap` smallint(5) unsigned DEFAULT NULL, - `disk` smallint(5) unsigned DEFAULT NULL, + `memory` int(10) unsigned NOT NULL, + `swap` int(10) unsigned DEFAULT NULL, + `disk` int(10) unsigned DEFAULT NULL, `diskformat` varchar(10) DEFAULT NULL, `diskcache` varchar(20) DEFAULT NULL, `disktype` varchar(20) DEFAULT NULL, @@ -86,17 +86,17 @@ CREATE TABLE IF NOT EXISTS `mod_pvewhmcs_plans` ( `diskio` varchar(20) DEFAULT '0', `netmode` varchar(10) DEFAULT NULL, `bridge` varchar(20) NOT NULL DEFAULT 'vmbr', - `vmbr` tinyint(1) unsigned DEFAULT NULL, + `vmbr` tinyint(3) unsigned DEFAULT NULL, `netmodel` varchar(10) DEFAULT NULL, - `netrate` varchar(5) DEFAULT '0', + `netrate` int(10) DEFAULT '0', `firewall` tinyint(1) unsigned NOT NULL DEFAULT 0, - `bw` int(6) unsigned DEFAULT 0, + `bw` int(10) unsigned DEFAULT 0, `kvm` tinyint(1) unsigned DEFAULT 0, `onboot` tinyint(1) unsigned DEFAULT 0, - `vlanid` varchar(10) DEFAULT NULL, + `vlanid` int(10) DEFAULT NULL, `ipv6` varchar(10) DEFAULT 'auto', - `balloon` varchar(10) DEFAULT '0', - `unpriv` int(1) unsigned DEFAULT 0, + `balloon` int(10) DEFAULT '0', + `unpriv` tinyint(1) unsigned DEFAULT 0, `ssh-keys` varchar(100) DEFAULT '', PRIMARY KEY (`id`) ); diff --git a/modules/addons/pvewhmcs/pvewhmcs.php b/modules/addons/pvewhmcs/pvewhmcs.php index 11a66f5..be7ecd1 100644 --- a/modules/addons/pvewhmcs/pvewhmcs.php +++ b/modules/addons/pvewhmcs/pvewhmcs.php @@ -36,7 +36,7 @@ function pvewhmcs_config() { $configarray = array( "name" => "Proxmox VE for WHMCS", "description" => "Proxmox VE (Virtual Environment) & WHMCS, integrated & open-source! Provisioning & Management of VMs/CTs.".is_pvewhmcs_outdated(), - "version" => "1.2.16", + "version" => pvewhmcs_version(), "author" => "The Network Crew Pty Ltd", 'language' => 'English' ); @@ -45,7 +45,7 @@ function pvewhmcs_config() { // VERSION: also stored in repo/version (for update-available checker) function pvewhmcs_version(){ - return "1.2.16"; + return "1.2.17"; } // WHMCS MODULE: ACTIVATION of the ADDON MODULE @@ -90,6 +90,7 @@ function pvewhmcs_deactivate() { function pvewhmcs_upgrade($vars) { // This function gets passed the old ver once post-update, hence lt check $currentlyInstalledVersion = $vars['version']; + // SQL Operations for v1.2.9/10 version if (version_compare($currentlyInstalledVersion, '1.2.10', 'lt')) { $schema = Capsule::schema(); @@ -112,6 +113,7 @@ function pvewhmcs_upgrade($vars) { ->update(['vmid' => Capsule::raw('id')]); } } + // SQL Operations for v1.2.12 version if (version_compare($currentlyInstalledVersion, '1.2.12', 'lt')) { $schema = Capsule::schema(); @@ -123,6 +125,35 @@ function pvewhmcs_upgrade($vars) { }); } } + + // SQL Operations for v1.2.17 version + if (version_compare($currentlyInstalledVersion, '1.2.17', 'lt')) { + try { + Capsule::schema()->table('mod_pvewhmcs_plans', function ($table) { + $table->smallInteger('cpus')->unsigned()->nullable()->change(); + $table->smallInteger('cores')->unsigned()->nullable()->change(); + $table->integer('memory')->unsigned()->default(0)->change(); + $table->integer('swap')->unsigned()->nullable()->change(); + $table->integer('disk')->unsigned()->nullable()->change(); + $table->tinyInteger('vmbr')->unsigned()->nullable()->change(); + $table->integer('netrate')->default(0)->change(); + $table->integer('bw')->unsigned()->default(0)->change(); + $table->integer('vlanid')->nullable()->change(); + $table->integer('balloon')->default(0)->change(); + $table->tinyInteger('unpriv')->unsigned()->default(0)->change(); + }); + } catch (\Throwable $e) { + // Debug logging (same style as ClientArea) + if (Capsule::table('mod_pvewhmcs')->where('id', '1')->value('debug_mode') == 1) { + logModuleCall( + 'pvewhmcs', + __FUNCTION__, + 'Attempting v1.2.17 database upgrade failed.', + $e->getMessage() + ); + } + } + } } // UPDATE CHECKER: live vs repo diff --git a/version b/version index a96f385..21344eb 100644 --- a/version +++ b/version @@ -1 +1 @@ -1.2.16 \ No newline at end of file +1.2.17 \ No newline at end of file