mirror of
https://github.com/The-Network-Crew/Proxmox-VE-for-WHMCS.git
synced 2026-04-11 23:28:25 +00:00
Compare commits
11 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a4b90f8d84 | ||
|
|
472e9c8266 | ||
|
|
cbf686b787 | ||
|
|
e3f2491b56 | ||
|
|
5acc32fb2b | ||
|
|
f614863547 | ||
|
|
49a5d7f317 | ||
|
|
a81013bbc2 | ||
|
|
5432eaad80 | ||
|
|
63f56f8eea | ||
|
|
cc302ed650 |
14
CHANGELOG.md
14
CHANGELOG.md
@@ -5,6 +5,19 @@ 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 (#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 secure & samesite=None (#167)
|
||||
- SQL -> Plans: Expand several fields (future-proof) (#169)
|
||||
|
||||
## [1.2.16] - 2025-10-15 - _"Minor Adjustments"_
|
||||
|
||||
### 💅 Polish
|
||||
@@ -12,6 +25,7 @@ https://github.com/The-Network-Crew/Proxmox-VE-for-WHMCS/milestones
|
||||
- Plan Add/Edit: Text descriptions updated
|
||||
- Update Available: Hyperlinked to repo
|
||||
- Admin GUI: Textual layout updates
|
||||
- Servers: PVE Button updated text
|
||||
- README: Final resting milestone
|
||||
|
||||
## [1.2.15] - 2025-08-29 - _"Little Adjustments"_
|
||||
|
||||
16
README.md
16
README.md
@@ -17,7 +17,8 @@
|
||||
- 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
|
||||
- Choose PVE VMID start & integrate to your schema
|
||||
- Supports 128GB+ RAM & 128+ CPU cores per Guest!
|
||||
|
||||
https://github.com/The-Network-Crew/Proxmox-VE-for-WHMCS/
|
||||
|
||||
@@ -146,16 +147,27 @@ After forking the module, we considered how to improve security of Console Tunne
|
||||
|
||||
**noVNC has been overhauled. It isn't guaranteed, nor the project at all. :-)**
|
||||
|
||||
Here are some of the critical requirements for VNC tunnelling:
|
||||
Once you have it configured, clicking noVNC in Client Area provides direct link - click it:
|
||||
|
||||
<img alt="Client Area is ready for you to click into noVNC terminal console" src="_images/zVNCprepared.png">
|
||||
|
||||
**Here are most of the critical requirements for VNC tunnelling:**
|
||||
|
||||
1. PVE must be at an IPv4 which has PTR the exact same as PVE's hostname.
|
||||
2. You must use different Subdomains on the 1x Domain Name, for the cookie (anti-CSRF).
|
||||
3. If your Domain Name has a 2-part TLD (ie. co.uk) then you will need to fork & amend `novnc_router.php` - ideally we/someone will optimise this down the track.
|
||||
4. You must configure a VNC Secret in the Module Settings, after creating it in PVE.
|
||||
5. You must have a stable and "relatively" static IPv4 fixed/routed WAN address for each PVE host. **CGNAT, Cellular & other "fast DHCP" style configurations cannot be worked with due to a variety of external network issues.** We will not support anything except a perfectly-configured `pvewhmcs`. Thank you!
|
||||
6. Cookies must be properly usable and not manipulated by htaccess or similar rules, to ensure that `PVEAuthCookie` is properly set in-browser, for same-domain cross-subdomain access.
|
||||
|
||||
<img alt="Admin GUI of the Module Config (VNC Secret, Start VMID, Debug Log y/n)" src="_images/zConfiguration.png">
|
||||
|
||||
> [!TIP]
|
||||
> **To troubleshoot noVNC errors like "Connection Closed (1006)":**
|
||||
>
|
||||
> Load noVNC with `logging=debug` added to the query string, ie. `vnc.html?logging=debug`<br>
|
||||
> _Or in Settings change Logging to debug-level, then open JS Console before reloading noVNC._
|
||||
|
||||
## 🌐 3. Networking: IPv4 Pools, IPv6, vmbr/SDN
|
||||
|
||||
### IPv4: Pool required for assignment
|
||||
|
||||
@@ -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
|
||||
|
||||
```
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 181 KiB After Width: | Height: | Size: 119 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 285 KiB After Width: | Height: | Size: 294 KiB |
BIN
_images/zVNCprepared.png
Normal file
BIN
_images/zVNCprepared.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 42 KiB |
@@ -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(2) unsigned DEFAULT NULL,
|
||||
`cpus` smallint(4) unsigned DEFAULT NULL,
|
||||
`cpuemu` varchar(30) CHARACTER SET utf8 DEFAULT NULL,
|
||||
`cores` tinyint(2) unsigned DEFAULT NULL,
|
||||
`cores` smallint(4) unsigned DEFAULT NULL,
|
||||
`cpulimit` smallint(5) unsigned DEFAULT NULL,
|
||||
`cpuunits` smallint(5) unsigned DEFAULT NULL,
|
||||
`memory` smallint(5) 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`)
|
||||
);
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -80,7 +80,7 @@
|
||||
<td>Kernel: {$vm_config['ostype']}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><strong>IP</strong> (Addressing)</td><td><strong>{$vm_config['ipv4']}</strong><br/>Mask: {$vm_config['netmask4']}<br/>Gateway: {$vm_config['gateway4']}</td>
|
||||
<td><strong>IPv4</strong> (Network)</td><td><strong>{$vm_config['ipv4']}</strong><br/>Mask: {$vm_config['netmask4']}<br/>Gateway: {$vm_config['gateway4']}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><strong>NIC</strong> (Interface #1)</td>
|
||||
|
||||
@@ -21,6 +21,11 @@
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
// Delete the authentication cookie, if it exists
|
||||
if (isset($_COOKIE['PVEAuthCookie'])) {
|
||||
unset($_COOKIE['PVEAuthCookie']);
|
||||
}
|
||||
|
||||
if (isset($_GET['pveticket']) && isset($_GET['host']) && isset($_GET['path']) && isset($_GET['vncticket'])) {
|
||||
// Take passed-in variables and re-assign for usage
|
||||
$pveticket = $_GET['pveticket'];
|
||||
@@ -33,7 +38,14 @@ if (isset($_GET['pveticket']) && isset($_GET['host']) && isset($_GET['path']) &&
|
||||
// Now extract just the domain parts we need (FUTURE: capacity/option for multi-part TLDs)
|
||||
$domainonly = preg_replace("/^(.*?)\.(.*)$/","$2",$whmcsdomain['path']);
|
||||
// Set the cookie as Proxmox will be expecting it, so it is WHMCS to VNC without further login
|
||||
setrawcookie('PVEAuthCookie', $pveticket, 0, '/', $domainonly);
|
||||
setrawcookie('PVEAuthCookie', $pveticket, [
|
||||
'expires' => 0,
|
||||
'path' => '/',
|
||||
'domain' => $domainonly,
|
||||
'secure' => true,
|
||||
'httponly' => false,
|
||||
'samesite' => 'None',
|
||||
]);
|
||||
|
||||
// Create the final noVNC URL with the re-encoded vncticket
|
||||
$hostname = gethostbyaddr($host);
|
||||
|
||||
@@ -881,6 +881,7 @@ function pvewhmcs_ClientAreaCustomButtonArray() {
|
||||
"<i class='fa fa-2x fa-power-off'></i> Power Off" => "vmShutdown",
|
||||
"<i class='fa fa-2x fa-stop'></i> Hard Stop" => "vmStop",
|
||||
"<i class='fa fa-2x fa-chart-bar'></i> Statistics" => "vmStat",
|
||||
"<i class='fa fa-2x fa-search'></i> Check Status" => "vmCheck",
|
||||
"<img src='./modules/servers/pvewhmcs/img/novnc.png'/> noVNC (HTML5)" => "noVNC",
|
||||
"<img src='./modules/servers/pvewhmcs/img/tigervnc.png'/> TigerVNC (Java)" => "javaVNC",
|
||||
);
|
||||
@@ -1125,7 +1126,7 @@ function pvewhmcs_noVNC($params) {
|
||||
// Construct the noVNC Router URL with the path already prepared now
|
||||
$url = '/modules/servers/pvewhmcs/novnc_router.php?host=' . $serverip . '&pveticket=' . urlencode($pveticket) . '&path=' . urlencode($path) . '&vncticket=' . urlencode($vncticket);
|
||||
// Build and deliver the noVNC Router hyperlink for access
|
||||
$vncreply = '<center><strong>Console (noVNC) prepared for usage. <a href="'.$url.'" target="_blanK">Click here</a> to open the noVNC window.</strong></center>' ;
|
||||
$vncreply = '<center style="background-color: green;"><strong style="color: white;">Console (noVNC) successfully prepared!<br><a href="'.$url.'" target="_blanK" style="color: Khaki;"><u>Click here to launch noVNC.</u></a></strong></center>' ;
|
||||
return $vncreply;
|
||||
} else {
|
||||
$vncreply = 'Failed to prepare noVNC. Please contact Technical Support.';
|
||||
@@ -1162,7 +1163,7 @@ function pvewhmcs_SPICE($params) {
|
||||
// Construct the SPICE Router URL with the path already prepared now
|
||||
$url = '/modules/servers/pvewhmcs/spice_router.php?host=' . $serverip . '&pveticket=' . urlencode($pveticket) . '&path=' . urlencode($path) . '&vncticket=' . urlencode($vncticket);
|
||||
// Build and deliver the SPICE Router hyperlink for access
|
||||
$vncreply = '<center><strong>Console (SPICE) prepared for usage. <a href="'.$url.'" target="_blanK">Click here</a> to open the noVNC window.</strong></center>' ;
|
||||
$vncreply = '<center style="background-color: green;"><strong>Console (SPICE) successfully prepared.<br><a href="'.$url.'" target="_blanK" style="color: Khaki;"><u>Click here</u></a> to launch SPICE.</strong></center>' ;
|
||||
return $vncreply;
|
||||
} else {
|
||||
$vncreply = 'Failed to prepare SPICE. Please contact Technical Support.';
|
||||
@@ -1199,7 +1200,7 @@ function pvewhmcs_javaVNC($params){
|
||||
$javaVNCparams[4] = $vm_vncproxy['ticket'] ;
|
||||
// URL preparation to deliver in hyperlink message
|
||||
$url = './modules/servers/pvewhmcs/tigervnc.php?'.http_build_query($javaVNCparams).'' ;
|
||||
$vncreply = '<center><strong>Console (TigerVNC) prepared for usage. <a href="'.$url.'" target="_blanK">Click here</a> to open the TigerVNC window.</strong></center>' ;
|
||||
$vncreply = '<center style="background-color: green;"><strong>Console (TigerVNC) successfully prepared.<br><a href="'.$url.'" target="_blanK" style="color: Khaki;"><u>Click here</u></a> to launch TigerVNC.</strong></center>' ;
|
||||
// echo '<script>window.open("modules/servers/pvewhmcs/tigervnc.php?'.http_build_query($javaVNCparams).'","VNC","location=0,toolbar=0,menubar=0,scrollbars=1,resizable=1,width=802,height=624")</script>';
|
||||
return $vncreply;
|
||||
} else {
|
||||
@@ -1388,6 +1389,11 @@ function pvewhmcs_vmStop($params) {
|
||||
}
|
||||
}
|
||||
|
||||
// CLIENT AREA: REFRESH TO CHECK STATUS ON-CLICK
|
||||
function pvewhmcs_vmCheck($params) {
|
||||
return "success";
|
||||
}
|
||||
|
||||
// NETWORKING FUNCTION: Convert subnet mask to CIDR
|
||||
function mask2cidr($mask){
|
||||
$long = ip2long($mask);
|
||||
|
||||
Reference in New Issue
Block a user