diff --git a/CHANGELOG.md b/CHANGELOG.md index 5dd7b9e..231ffd1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,11 +5,25 @@ 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.9] - TBC 2025-??-?? +## [1.2.9] - 2025-07-31 - _"Import Friendly"_ + +### ๐Ÿš€ Feature +- Guest Import: Add Service for existing PVE Guest (#75) +- PVE VMID: Allow for custom VMID (via Start ID) (#136) +- SQL Updates: Beta functionality to auto-patch (#62) +- CONTRIBUTORS.md: Recognising key efforts! (#140) + +### ๐Ÿ’… Polish +- Fallback Client Area: Use serviceid if no VMID set (#137) +- Admin Landing: Auto-select the VM/CT Plans pane/tab (#138) +- Minor Wording: Slight adjustments around Module Admin GUI ### ๐Ÿ› Bug Fix - Trunk -> Tag: Wrong parameter name for VLAN ID (#125) - Function Rename: Avoid same name as Virtualizor (#129) +- netrate & IPv6: Declare 0 (netrate); add IPv6 DNS (#119) + +(\*): SQL Note: There's column changes in 2x module tables, see [UPDATE-SQL.md](https://github.com/The-Network-Crew/Proxmox-VE-for-WHMCS/blob/master/UPDATE-SQL.md) ## [1.2.8] - 2025-04-26 - _"Pause to Refine"_ diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md new file mode 100644 index 0000000..87dd495 --- /dev/null +++ b/CONTRIBUTORS.md @@ -0,0 +1,16 @@ +# Contributors to Proxmox VE for WHMCS + +This document seeks to say "cheers", "many thanks" & "love your work" to the people and companies who have helped to make this project what it is today. + +## Users who've contributed + +- [@cybercoder](https://github.com/cybercoder) +- [@lsthompson](https://github.com/lsthompson) +- [@nodespacehosting](https://github.com/nodespacehosting) +- [@WaldperlachFabi](https://github.com/WaldperlachFabi) +- [@is7Qin](https://github.com/is7Qin) + +## Why not make it even better? + +> [!TIP] +> You can always step up and write some improvements to the Module. Why not? \ No newline at end of file diff --git a/README.md b/README.md index 95d7394..298f9f6 100644 --- a/README.md +++ b/README.md @@ -16,6 +16,8 @@ - Create/Suspend/Unsuspend/Terminate via WHMCS Admin Area - Statistics/Graphing is available in the Client Area for services :) - Leverage the power of QEMU & LXC with PVE's convenience +- Import existing VM/CT Guest from Proxmox into WHMCS +- Specify PVE VMID start & integrate to your schema Repo: https://github.com/The-Network-Crew/Proxmox-VE-for-WHMCS/ @@ -31,22 +33,6 @@ We're pretty much done overhauling the Module to suit our needs at The Network C # ๐ŸŽฏ MODULE: System Requirements (PVE/WHMCS) -## WHMCS must have >100 services! - -New Biz: Fresh Installations/Businesses using WHMCS need to take note of the Service ID <100 case. - -**SID >100:** The WHMCS Service ID requirement is CRITICAL, as **Proxmox reserves VMIDs <100 (system).** - -_If you don't have enough services (of any status) in WHMCS (DB: tblhosting.id), create enough dummy/test entries to reach Service ID 101+._ **Else you're likely to see an error which explains this:** - -`HTTP/1.1 400 Parameter verification failed. (invalid format - value does not look like a valid VM ID)` - -To check, browse to your **latest** service in WHMCS, then check the URL - it will reveal the Service ID. If it is less than 100, subtract it from 100 to deduce how many "dummy services" you need to add in a dummy order. - -**Once over 100, it fits the requirement & you're good!** - -## General Requirements - - **(WHMCS)** v8.x.x stable (HTTPS) - **(WHMCS)** **Service ID above 100** - **(NET)** WAN Access: WHMCS to PVE @@ -58,7 +44,8 @@ To check, browse to your **latest** service in WHMCS, then check the URL - it wi # โœ… MODULE: Installation & Configuration -**DON'T SKIP ANY PART OF THIS README.md - please don't raise pointless Issues - thank you!** +> [!WARNING] +> **DON'T SKIP ANY PART OF THIS README.md - please don't raise pointless Issues - thank you!** ## ๐Ÿ“‹ 1. PREP: Upload & Configure the Module @@ -124,9 +111,10 @@ Else, PVE must be WAN-accessible and all other configs/reqs satisfied. 4. Permit VNC Access -> `Datacenter / Permissions / Add Group Permissions` - Group: "VNC", Role: "VNC" 5. WHMCS > Modules > Proxmox VE for WHMCS > Module Config > VNC Secret = 'vnc' password (PVE) you set -> Do NOT set less restrictive permissions. The above is designed for hypervisor security. +> [!CAUTION] +> Do NOT set less restrictive permissions. The above is designed for interim security. > -> **However, if you wish for proper security, wait for VNC to be further improved.** +> **However, if you wish for proper security: wait for VNC to be further improved.** ### Important info about Console Access @@ -187,6 +175,12 @@ Firstly, store the Template in PVE. You need its storage, folder & File Name. > Use that prefixed file name in the Custom Field `Template`, as in:
> `local:vztmpl/ubuntu-99.99-standard_amd64.tar.gz|Ubuntu 99` +### VM/CT Import/Associate Existing Guest + +You can associate an existing PVE Guest through the WHMCS Module too, like this: + +Importing GUI for linking to existing PVE Guest + #### ZFS etc: Comfigure to suit isolated TPL - `local` is the name of the file-system that you have the Template on @@ -203,13 +197,16 @@ Make a 2nd Custom Field `Password` for the CT's root user. **Check:** `WHMCS Admin > Addon Modules > Proxmox VE for WHMCS > Support/Health` -You should download any new version & upload it over the top, then run any needed SQL queries. +You should download any new version & upload it over the top, then login to WHMCS Admin. ### SQL: Keeping your DB up-to-date -Please consult the **UPDATE-SQL.md** file, open your WHMCS DB & run the statements. +> [!IMPORTANT] +> Since v1.2.9, logging into WHMCS Admin & opening the module should run any needed SQL Ops. +> +> v1.2.8 & below, consult the **UPDATE-SQL.md** file, open your SQL DB & run statements. -Then you're done with each update! Not all versions need database amendments. +Then you're done with each update! :-) ## ๐Ÿ†˜ 6. HELP: Best-effort Support @@ -245,49 +242,65 @@ The more info/context you provide up-front, the quicker & easier it will be! \* Debug: Also enable Debug Logging in Proxmox VE for WHMCS > Settings, as needed. -**Please note that this is FOSS and Support is not guaranteed at all.**
-**If you don't read, listen or actively try, no help is given.** +> [!TIP] +> **Please note that this is FOSS and Support is not guaranteed at all.**
+> +> **If you don't read, listen or actively try, no help is given.** https://github.com/The-Network-Crew/Proxmox-VE-for-WHMCS/issues/new/choose -# ๐Ÿ’… FEATURES: PVE v8.x bling +# ๐Ÿ’… FEATURES: Upcoming PVE bling There are new features deployed into PVE upstream which are exciting and may be integrated. **PVE Roadmap:** https://pve.proxmox.com/wiki/Roadmap -## Proxmox v8.4 +### Proxmox v9.0 beta + +1. VM snapshots on thick LVM, snapshots as volume chains +2. Fabrics for software networking (SDN) Open/OSPF/Ceph/VPN +3. Major upgrade to Debian Trixie (testing status in 2025) + +### Proxmox v8.4 1. Live migrate with mediated devices. 2. Support for external backup providers. 3. Host dir's, share with guests (virtiofs). -## Proxmox v8.3 +### Proxmox v8.3 1. Software-defined Networking/Firewall. 2. Better guest importing from OVA/OVF. 3. Webhook target for system alerting. 4. Better change detection for PBS. -## Proxmox v8.2 +### Proxmox v8.2 1. Import Wizard for Guests. 2. Unattended PVE Install (answer file). 3. Backup Fleecing (local disk as data block buffer). 4. Firewall Preview (based on nftables). -## Proxmox v8.1 +### Proxmox v8.1 1. Secure Boot support. 2. Software Defined Networking (SDN). 3. New flexible notification system (SMTP & Gotify). 4. MAC Organizationally Unique Identifier (OUI) BC:24:11: prefix! -## Proxmox v8.0 +### Proxmox v8.0 1. Create, manage and assign resource mappings for PCI and USB devices for use in virtual machines (VMs) via API and web UI. 2. (DONE) Add virtual machine CPU models based on the x86-64 psABI Micro-Architecture Levels and use the widely supported x86-64-v2-AES as default for new VMs created via the web UI. +### Proxmox 7.x + +1. Cross-cluster guest migrations +2. Cluster Resource Scheduling (CRS) launched +3. Re-balance CRS on fresh start-up, not just recovery +4. CRM into HA Manager, as a node maintenance switch +5. Proxmox Offline Mirror (POM) launched + # ๐Ÿ–ฅ๏ธ INC: Libraries & Dependencies - **(MIT)** PHP Client for PVE2 API (Dec 5th, 2022) https://github.com/CpuID/pve2-api-php-client @@ -324,16 +337,19 @@ We would like to thank @cybercoder and @WaldperlachFabi for their original contr **Thank you to psyborgยฎ for the module's logo design! We love it.** -FOSS is only possible thanks to dedicated individuals! +FOSS is only possible thanks to dedicated people around the world! -# Usage License (GPLv3) & Links to TNC & Co. +**See CONTRIBUTORS.md for those who've made PVEWHMCS possible.** -_**This module is licensed under the GNU General Public License (GPL) v3.0.**_ - -GPLv3: https://www.gnu.org/licenses/gpl-3.0.txt (by the Free Software Foundation) - -## Corporate Sites: TNC & Merlot Digital +# TNC & GPL **The Network Crew Pty Ltd** :: https://tnc.works **๐Ÿท Merlot Digital** :: https://merlot.digital + +**AS138521** :: Australian family owned + +> [!NOTE] +> _**This module is licensed under the GNU General Public License (GPL) v3.0.**_ +> +> GPLv3: https://www.gnu.org/licenses/gpl-3.0.txt (by the Free Software Foundation) diff --git a/UPDATE-SQL.md b/UPDATE-SQL.md index 40b73a4..ce0ae69 100644 --- a/UPDATE-SQL.md +++ b/UPDATE-SQL.md @@ -3,7 +3,9 @@ ## v1.2.8 to v1.2.9 ``` -ALTER TABLE mod_pvewhmcs_vms ADD COLUMN `pveid` varchar(10) DEFAULT NULL; +ALTER TABLE mod_pvewhmcs ADD COLUMN `start_vmid` int(10) DEFAULT 100; +ALTER TABLE mod_pvewhmcs_vms ADD COLUMN `vmid` int(10) DEFAULT NULL; +UPDATE mod_pvewhmcs_vms SET vmid = id WHERE vmid IS NULL; ``` ## v1.2.7 to v1.2.8 diff --git a/modules/addons/pvewhmcs/db.sql b/modules/addons/pvewhmcs/db.sql index 11b1026..2a10446 100644 --- a/modules/addons/pvewhmcs/db.sql +++ b/modules/addons/pvewhmcs/db.sql @@ -2,6 +2,7 @@ CREATE TABLE IF NOT EXISTS `mod_pvewhmcs` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `config` varchar(255), `vnc_secret` varchar(255), + `start_vmid` int(10) unsigned DEFAULT 100, `debug_mode` tinyint(1) unsigned DEFAULT 0, PRIMARY KEY (`id`) ); @@ -54,6 +55,7 @@ CREATE TABLE IF NOT EXISTS `mod_pvewhmcs_plans` ( ); CREATE TABLE IF NOT EXISTS `mod_pvewhmcs_vms` ( `id` int(10) unsigned NOT NULL, + `vmid` int(10) unsigned DEFAULT NULL, `user_id` int(10) unsigned NOT NULL, `vtype` varchar(255) NOT NULL, `ipaddress` varchar(255) NOT NULL, diff --git a/modules/addons/pvewhmcs/pvewhmcs.php b/modules/addons/pvewhmcs/pvewhmcs.php index e2abea6..187b436 100644 --- a/modules/addons/pvewhmcs/pvewhmcs.php +++ b/modules/addons/pvewhmcs/pvewhmcs.php @@ -6,19 +6,20 @@ File: /modules/addons/pvewhmcs/pvewhmcs.php (GUI Work) Copyright (C) The Network Crew Pty Ltd (TNC) & Co. + For other Contributors to PVEWHMCS, see CONTRIBUTORS.md - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. - You should have received a copy of the GNU General Public License - along with this program. If not, see . + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ // Pull in the WHMCS database handler Capsule for SQL @@ -35,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.8", + "version" => "1.2.9", "author" => "The Network Crew Pty Ltd", 'language' => 'English' ); @@ -44,7 +45,7 @@ function pvewhmcs_config() { // VERSION: also stored in repo/version (for update-available checker) function pvewhmcs_version(){ - return "1.2.8"; + return "1.2.9"; } // WHMCS MODULE: ACTIVATION of the ADDON MODULE @@ -83,22 +84,50 @@ function pvewhmcs_deactivate() { return array('status'=>'success','description'=>'Proxmox VE for WHMCS successfully deactivated and all related tables deleted.'); } +// WHMCS MODULE: Upgrade +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 version + if ($currentlyInstalledVersion < 1.2.9) { + $schema = Capsule::schema(); + + // Add the column "start_vmid" to the mod_pvewhmcs table + if (!$schema->hasColumn('mod_pvewhmcs', 'start_vmid')) { + $schema->table('mod_pvewhmcs', function ($table) { + $table->integer('start_vmid')->default(100)->after('vnc_secret'); + }); + } + + // Add the column "vmid" to the mod_pvewhmcs_vms table + if (!$schema->hasColumn('mod_pvewhmcs_vms', 'vmid')) { + $schema->table('mod_pvewhmcs_vms', function ($table) { + $table->integer('vmid')->default(0)->after('id'); + }); + // Populate ID into VMID for all previous guests + Capsule::table('mod_pvewhmcs_vms') + ->where('vmid', 0) + ->update(['vmid' => Capsule::raw('id')]); + } + } +} + // UPDATE CHECKER: live vs repo function is_pvewhmcs_outdated(){ - if(get_pvewhmcs_latest_version() > pvewhmcs_version()){ - return "
Proxmox VE for WHMCS is outdated: Download the new version!"; - } + if(get_pvewhmcs_latest_version() > pvewhmcs_version()){ + return "
Proxmox VE for WHMCS is outdated: Download the new version!"; + } } // UPDATE CHECKER: return latest ver function get_pvewhmcs_latest_version(){ - $ch = curl_init(); - curl_setopt($ch, CURLOPT_URL, "https://raw.githubusercontent.com/The-Network-Crew/Proxmox-VE-for-WHMCS/master/version"); - curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); - $result = curl_exec($ch); - curl_close ($ch); + $ch = curl_init(); + curl_setopt($ch, CURLOPT_URL, "https://raw.githubusercontent.com/The-Network-Crew/Proxmox-VE-for-WHMCS/master/version"); + curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); + $result = curl_exec($ch); + curl_close ($ch); - return str_replace("\n", "", $result); + return str_replace("\n", "", $result); } // ADMIN MODULE GUI: output (HTML etc) @@ -124,6 +153,12 @@ function pvewhmcs_output($vars) { unset($_SESSION['pvewhmcs']) ; } + // Set the active tab based on the GET parameter, default to 'vmplans' + if (!isset($_GET['tab'])) { + $_GET['tab'] = 'vmplans'; + } + + // Start the HTML output for the Admin GUI echo '