Compare commits
38 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
81e169995b | ||
|
|
80c54caf17 | ||
|
|
505c006ca1 | ||
|
|
cd2494d688 | ||
|
|
46f7ac1510 | ||
|
|
b860eb7098 | ||
|
|
aa89be278d | ||
|
|
22266db93e | ||
|
|
272b3146e5 | ||
|
|
6544f1a98f | ||
|
|
635e057263 | ||
|
|
4c88d4bd7f | ||
|
|
bf2f981435 | ||
|
|
14adeda5af | ||
|
|
2a94251b6d | ||
|
|
a4b90f8d84 | ||
|
|
472e9c8266 | ||
|
|
cbf686b787 | ||
|
|
e3f2491b56 | ||
|
|
5acc32fb2b | ||
|
|
f614863547 | ||
|
|
49a5d7f317 | ||
|
|
a81013bbc2 | ||
|
|
5432eaad80 | ||
|
|
63f56f8eea | ||
|
|
cc302ed650 | ||
|
|
2d8888138f | ||
|
|
8d3c6e4abd | ||
|
|
f1f16e0826 | ||
|
|
fb9b730355 | ||
|
|
98270007e5 | ||
|
|
3585a6cc1c | ||
|
|
e266fa8c9d | ||
|
|
f4c3f0de0e | ||
|
|
470b1e15d2 | ||
|
|
38a0e9f935 | ||
|
|
e221503cc8 | ||
|
|
7851db7cad |
53
CHANGELOG.md
@@ -3,11 +3,58 @@ All notable changes to Proxmox VE for WHMCS will be documented in this file.
|
||||
|
||||
## [1.3.x] - TBC 2026-??-??
|
||||
|
||||
### 💅 Polish
|
||||
- SQL Expansion: Prepare for Nodes/ISOs/TPLs/Logs/SSH Keys/etc
|
||||
|
||||
https://github.com/The-Network-Crew/Proxmox-VE-for-WHMCS/milestones
|
||||
|
||||
## [1.2.19] - 2025-10-24 - _"Remove TigerVNC (Java)"_
|
||||
|
||||
### 💅 Polish
|
||||
- Removed TigerVNC (Java): Retained HTML5 console
|
||||
|
||||
## [1.2.18] - 2025-10-19 - _"Client Area detail" v2_
|
||||
|
||||
### 💅 Polish
|
||||
- Client Area: Polish the interface numbering, v4/v6
|
||||
- Client Area: Add boot, ipconfig, onboot & sshkeys
|
||||
|
||||
### 🐛 Bug Fix
|
||||
- noVNC: Cookie remove 2; router tidy-up; tested OK (#167)
|
||||
- noVNC: Allow for custom WHMCS install subdirectory (#114)
|
||||
|
||||
## [1.2.17] - 2025-10-19 - _"VNC & Hyperscale!"_
|
||||
|
||||
### 🚀 Feature
|
||||
- Check Status: Allow for client-driven status checks (#168)
|
||||
|
||||
### 💅 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)
|
||||
|
||||
### 🐛 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
|
||||
- WHMCS Parameter: RequiresServer set to true
|
||||
- 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"_
|
||||
|
||||
### 💅 Polish
|
||||
- NIC #2: Split info (MAC, link status, etc) to multiple lines
|
||||
- SQL Expansion: Prepare for Nodes/ISOs/TPLs/Logs/Keys/etc (#127)
|
||||
- Deactivation Keeps Data: No table drops on de-activate (#160)
|
||||
|
||||
### 🐛 Bug Fix
|
||||
- Function Rename: hash_encryption to pvewhmcs_hash_encryption (#159)
|
||||
|
||||
## [1.2.14] - 2025-08-19 - _"Client Area tidy"_
|
||||
|
||||
### 🚀 Feature
|
||||
|
||||
39
README.md
@@ -8,7 +8,7 @@
|
||||
If you have proven and public git-logged experience, or similar, please say g'day.
|
||||
|
||||
Please note: We are only looking for high-quality applicants with spare time.
|
||||
As it stands, we won't have much spare dev time for this Module in 2025.
|
||||
As it stands, we won't have much spare dev time for this Module in 2025/NY.
|
||||
|
||||
- Configure VM/CT plans with custom CPU/RAM/VLAN/On-boot/Bandwidth/etc
|
||||
- Automatically Provision VMs & CTs in **Proxmox VE** from **WHMCS** easily
|
||||
@@ -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
|
||||
- 128GB+ RAM & 128+ CPU cores per Guest!
|
||||
|
||||
https://github.com/The-Network-Crew/Proxmox-VE-for-WHMCS/
|
||||
|
||||
@@ -137,8 +138,6 @@ After forking the module, we considered how to improve security of Console Tunne
|
||||
> 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.**
|
||||
>
|
||||
> **Note**: Custom WHMCS install folders like /clients/ are not yet VNC-supported. #114
|
||||
|
||||
<img alt="Client Area GUI showing the reply which links off to the VNC Console/Client" src="_images/zConsoleReady.png">
|
||||
|
||||
@@ -146,16 +145,29 @@ 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._
|
||||
>
|
||||
> Typically, 401 No Ticket from PVE (1006 Connection Closed via noVNC) is due to cross-domain attempts being made, ie. WHMCS on domain1.com and PVE on domain2.com. You must use subdomains on the same Domain, with PTR, etc - else it won't work. **Please take the time to read this documentation.**
|
||||
|
||||
## 🌐 3. Networking: IPv4 Pools, IPv6, vmbr/SDN
|
||||
|
||||
### IPv4: Pool required for assignment
|
||||
@@ -166,8 +178,6 @@ Please make sure you create an IPv4 Pool with sufficient scope/size to be able t
|
||||
|
||||
Note that VNC may be problematic without work due to the strict requirements introduced in Proxmox v8.0 (strict same-site attribute). Just as SSL/TLS Certificates are no longer trusted for Public IP Addresses, there is increasing work to make the web secure-by-default which makes VNC/etc safer.
|
||||
|
||||
> Hence, we will not support any set-ups which do not follow all of the set-up processes 100%.
|
||||
|
||||
#### Existing Guest Imports from PVE
|
||||
|
||||
Take note that during the Guest Import process, there is no association ensured to an IP Pool, rather we take your inputs and use them verbatim due to existing/current nature of the Guest's configuration.
|
||||
@@ -226,7 +236,8 @@ You can associate an existing PVE Guest through the WHMCS Module too, like this:
|
||||
|
||||
<img alt="Importing GUI for linking to existing PVE Guest" src="_images/zVMIDimport.png">
|
||||
|
||||
> **Note**: All module-imported services need to be checked and amended to ensure configs such as Billing Cycle, Price, Discount, Assigned IPs, NS1/2, etc, are properly set.
|
||||
> [!CAUTION]
|
||||
> All module-imported services need to be checked and amended to ensure configs such as Billing Cycle, Price, Discount, Assigned IPs, NS1/2, etc, are properly set!
|
||||
|
||||
### Custom Fields: Important Notes (ZFS/CTs)
|
||||
|
||||
@@ -275,6 +286,13 @@ _**Note**: db.sql file currently contains new tables for v1.3.x releases as well
|
||||
|
||||
## 🆘 6. HELP: Best-effort Support
|
||||
|
||||
> [!WARNING]
|
||||
> We will not support ANY set-ups which do not follow ALL of the set-up processes 100%.
|
||||
>
|
||||
> Read the ENTIRE README, understand it, follow it, and submit detailed Issues.
|
||||
>
|
||||
> Else, do not expect any form of Support. Respect our time. Thank you!
|
||||
|
||||
### Before raising a GitHub Issue, please check:
|
||||
|
||||
1. The Wiki.
|
||||
@@ -362,17 +380,14 @@ There are new features deployed into PVE upstream which are exciting and may be
|
||||
| License | Dependency | In-use Ver. | Link to Repository, etc.|
|
||||
|---------|------------|-------------|-------------------------|
|
||||
| **(MIT)** | PHP Client for PVE2 API | **2022/Dec/05** | https://github.com/CpuID/pve2-api-php-client |
|
||||
| **(GPLv2)** | TigerVNC VncViewer.jar | **v1.15.0** | https://sourceforge.net/projects/tigervnc/files/stable/ |
|
||||
| **(MPLv2)** | noVNC HTML5 Viewer | **v1.6.0** | https://github.com/novnc/noVNC/ |
|
||||
| **(GPLv3)** | SPICE HTML5 Viewer | **v0.3** | https://gitlab.freedesktop.org/spice/spice-html5/ |
|
||||
| **(MIT)** | IPv4/SN Validation | **August 2012** | https://github.com/tapmodo/php-ipv4/ |
|
||||
|
||||
# 📄 DIY: Documentation & Resources
|
||||
|
||||
| Developer | Link to Documentation, etc. |
|
||||
|-----------|-----------------------------|
|
||||
| **(PVE API)** | https://pve.proxmox.com/pve-docs/api-viewer/ |
|
||||
| **(TigerVNC)** | https://github.com/TigerVNC/tigervnc/wiki |
|
||||
| **(PVE)** | https://pve.proxmox.com/pve-docs/api-viewer/ |
|
||||
| **(noVNC)** | https://github.com/novnc/noVNC/wiki |
|
||||
| **(WHMCS)** | https://developers.whmcs.com & https://classdocs.whmcs.com |
|
||||
| **(psABIs)** | https://gitlab.com/x86-psABIs/x86-64-ABI/-/jobs/artifacts/master/raw/x86-64-ABI/abi.pdf?job=build |
|
||||
|
||||
@@ -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
|
||||
|
||||
```
|
||||
|
||||
|
Before Width: | Height: | Size: 181 KiB After Width: | Height: | Size: 287 KiB |
|
Before Width: | Height: | Size: 291 KiB After Width: | Height: | Size: 338 KiB |
|
Before Width: | Height: | Size: 285 KiB After Width: | Height: | Size: 315 KiB |
BIN
_images/zVNCprepared.png
Normal file
|
After Width: | Height: | Size: 40 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.14",
|
||||
"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.14";
|
||||
return "1.2.19";
|
||||
}
|
||||
|
||||
// WHMCS MODULE: ACTIVATION of the ADDON MODULE
|
||||
@@ -79,15 +79,18 @@ function pvewhmcs_activate() {
|
||||
// WHMCS MODULE: DEACTIVATION
|
||||
function pvewhmcs_deactivate() {
|
||||
// Drop all module-related tables
|
||||
Capsule::statement('drop table mod_pvewhmcs_ip_addresses,mod_pvewhmcs_ip_pools,mod_pvewhmcs_plans,mod_pvewhmcs_vms,mod_pvewhmcs');
|
||||
// NOTE: Disabled/Deleted via #160
|
||||
// Capsule::statement('drop table mod_pvewhmcs_ip_addresses,mod_pvewhmcs_ip_pools,mod_pvewhmcs_plans,mod_pvewhmcs_vms,mod_pvewhmcs');
|
||||
|
||||
// Return the assumed result (change?)
|
||||
return array('status'=>'success','description'=>'Proxmox VE for WHMCS successfully deactivated and all related tables deleted.');
|
||||
return array('status'=>'success','description'=>'Proxmox VE for WHMCS successfully deactivated. Database tables/data retained.');
|
||||
}
|
||||
|
||||
// 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/10 version
|
||||
if (version_compare($currentlyInstalledVersion, '1.2.10', 'lt')) {
|
||||
$schema = Capsule::schema();
|
||||
@@ -110,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();
|
||||
@@ -121,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
|
||||
@@ -148,7 +181,7 @@ function pvewhmcs_output($vars) {
|
||||
// Check for update and report if available
|
||||
if (!empty(is_pvewhmcs_outdated())) {
|
||||
$_SESSION['pvewhmcs']['infomsg']['title']='Proxmox VE for WHMCS: New version available!' ;
|
||||
$_SESSION['pvewhmcs']['infomsg']['message']='Please visit the GitHub repository > Releases page. https://github.com/The-Network-Crew/Proxmox-VE-for-WHMCS/releases' ;
|
||||
$_SESSION['pvewhmcs']['infomsg']['message']='<a href="https://github.com/The-Network-Crew/Proxmox-VE-for-WHMCS/releases/latest" target="_blank">https://github.com/The-Network-Crew/Proxmox-VE-for-WHMCS/releases/latest</a>' ;
|
||||
}
|
||||
|
||||
// Print Messages to GUI before anything else
|
||||
@@ -502,16 +535,16 @@ function pvewhmcs_output($vars) {
|
||||
echo ('<strong><h2>Module: Action History</h2></strong>');
|
||||
echo ('Coming in v1.3.x');
|
||||
echo ('<strong><h2>Module: Failed Actions</h2></strong>');
|
||||
echo ('Coming in v1.3.x<br><strong><a href=\'https://github.com/The-Network-Crew/Proxmox-VE-for-WHMCS/milestones\' target=\'_blank\'>View the milestones/versions on GitHub</a></strong>');
|
||||
echo ('Coming in v1.3.x<br><br><strong><a href=\'https://github.com/The-Network-Crew/Proxmox-VE-for-WHMCS/milestones\' target=\'_blank\'>View the milestones/versions on GitHub</a></strong>');
|
||||
echo '</div>';
|
||||
|
||||
// SUPPORT tab in ADMIN GUI
|
||||
echo ('<div id="support" class="tab-pane '.($_GET['tab']=="support" ? "active" : "").'" >') ;
|
||||
echo ('<b>❤️ Proxmox for WHMCS is open-source and free to use & improve on!</b><br><a href="https://github.com/The-Network-Crew/Proxmox-VE-for-WHMCS/" target="_blank">https://github.com/The-Network-Crew/Proxmox-VE-for-WHMCS/</a><br><br>');
|
||||
echo ('<b style="color:darkgreen;">Your 5-star review on WHMCS Marketplace will help the module grow!</b><br>*****: <a href="https://marketplace.whmcs.com/product/6935-proxmox-ve-for-whmcs" target="_blank">https://marketplace.whmcs.com/product/6935-proxmox-ve-for-whmcs</a><br><br>');
|
||||
echo ('<strong><h2>System Environment</h2></strong><b>Proxmox VE for WHMCS</b> v' . pvewhmcs_version() . ' (GitHub reports latest as <b>v' . get_pvewhmcs_latest_version() . '</b>)' . '<br><b>PHP</b> v' . phpversion() . ' running on <b>' . $_SERVER['SERVER_SOFTWARE'] . '</b> Web Server (' . $_SERVER['SERVER_NAME'] . ')<br><br>');
|
||||
echo ('<b>❤️ PVEWHMCS is open-source and free to use & improve on!</b><br><a href="https://github.com/The-Network-Crew/Proxmox-VE-for-WHMCS/" target="_blank">https://github.com/The-Network-Crew/Proxmox-VE-for-WHMCS/</a><br><br>');
|
||||
echo ('<b style="color:darkgreen;">Your 5-star review on WHMCS Marketplace will help the module grow!</b><br>*****: <a href="https://marketplace.whmcs.com/product/6935-proxmox-ve-for-whmcs" target="_blank">https://marketplace.whmcs.com/product/6935-proxmox-ve-for-whmcs</a><br><br>');
|
||||
echo ('<strong><h2>Issues: Common Causes</h2></strong>1. Save your Package (Plan/Pool)! (configproducts.php?action=edit&id=...#tab=3)<br>2. Where possible, we pass-through the exact error to WHMCS Admin. Check it for info!<br><br>');
|
||||
echo ('<strong><h2>Module Technical Support</h2></strong>Our README contains a wealth of information:<br><a href="https://github.com/The-Network-Crew/Proxmox-VE-for-WHMCS/" target="_blank">https://github.com/The-Network-Crew/Proxmox-VE-for-WHMCS/</a><br>Please only raise an <a href="https://github.com/The-Network-Crew/Proxmox-VE-for-WHMCS/issues/new" target="_blank"><u>Issue</u></a> on GitHub - inc. logs - if you\'ve properly tried.<br><b>Help is not guaranteed (FOSS). We will need your assistance.</b> Thank you!<br><br>');
|
||||
echo ('<strong><h2>Module Technical Support</h2></strong>Our README contains a wealth of information:<br><a href="https://github.com/The-Network-Crew/Proxmox-VE-for-WHMCS/" target="_blank">https://github.com/The-Network-Crew/Proxmox-VE-for-WHMCS/</a><br>Please only raise an <a href="https://github.com/The-Network-Crew/Proxmox-VE-for-WHMCS/issues/new/choose" target="_blank"><u>Issue</u></a> on GitHub - inc. logs - if you\'ve properly tried.<br><br><b>Help is not guaranteed (FOSS). We will need your assistance.</b> Thank you!<br><br>');
|
||||
echo '</div>';
|
||||
|
||||
// Config Tab
|
||||
@@ -523,7 +556,7 @@ function pvewhmcs_output($vars) {
|
||||
<tr>
|
||||
<td class="fieldlabel">VNC Secret</td>
|
||||
<td class="fieldarea">
|
||||
<input type="text" size="35" name="vnc_secret" id="vnc_secret" value="'.$config->vnc_secret.'"> Password of "vnc"@"pve" user. Mandatory for VNC proxying. (See the <a href="https://github.com/The-Network-Crew/Proxmox-VE-for-WHMCS/wiki" target="_blank">Wiki</a> for more info)
|
||||
<input type="text" size="35" name="vnc_secret" id="vnc_secret" value="'.$config->vnc_secret.'"> Password of "vnc"@"pve" user. Mandatory for VNC proxying. (See the <a href="https://github.com/The-Network-Crew/Proxmox-VE-for-WHMCS/" target="_blank">README</a> for more info)
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@@ -536,7 +569,7 @@ function pvewhmcs_output($vars) {
|
||||
<td class="fieldlabel">Debug?</td>
|
||||
<td class="fieldarea">
|
||||
<label class="checkbox-inline">
|
||||
<input type="checkbox" name="debug_mode" value="1" '. ($config->debug_mode=="1" ? "checked" : "").'> Whether or not you want Debug Logging enabled - must also enable WHMCS Module Log (WHMCS debug) & then view <u><a href="/admin/index.php?rp=/admin/logs/module-log">at this link here.</a></u>
|
||||
<input type="checkbox" name="debug_mode" value="1" '. ($config->debug_mode=="1" ? "checked" : "").'> Whether or not you want Debug Logging enabled - must also enable WHMCS Module Log (WHMCS Debug) & then view <u><a href="/admin/index.php?rp=/admin/logs/module-log">at this link here.</a></u>
|
||||
</label>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -931,7 +964,7 @@ function kvm_plan_add() {
|
||||
<option value="Opteron_G4">(AMD) Opteron_G4</option>
|
||||
<option value="Opteron_G5">(AMD) Opteron_G5</option>
|
||||
</select>
|
||||
CPU emulation type. Default is x86-64 psABI v2-AES
|
||||
Default is x86-64 psABI v2-AES.
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@@ -939,14 +972,14 @@ function kvm_plan_add() {
|
||||
<td class="fieldlabel">CPU - Sockets</td>
|
||||
<td class="fieldarea">
|
||||
<input type="text" size="8" name="cpus" id="cpus" value="1" required>
|
||||
The number of CPU Sockets. 1 - 4.
|
||||
The number of CPU Sockets (typically 1-4).
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="fieldlabel">CPU - Cores</td>
|
||||
<td class="fieldarea">
|
||||
<input type="text" size="8" name="cores" id="cores" value="1" required>
|
||||
The number of CPU Cores per socket. 1 - 32.
|
||||
The number of CPU Cores per Socket (1-N).
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@@ -960,28 +993,28 @@ function kvm_plan_add() {
|
||||
<td class="fieldlabel">CPU - Weighting</td>
|
||||
<td class="fieldarea">
|
||||
<input type="text" size="8" name="cpuunits" id="cpuunits" value="1024" required>
|
||||
Number is relative to weights of all the other running VMs. 8 - 500000, recommend 1024. NOTE: Disable fair-scheduler by setting this to 0.
|
||||
Number is relative to weights of all the other running VMs. 8 - 500000, recommend 1024. Disable fair-scheduler by setting this to 0.
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="fieldlabel">RAM - Memory</td>
|
||||
<td class="fieldarea">
|
||||
<input type="text" size="8" name="memory" id="memory" value="2048" required>
|
||||
RAM space in Megabyte e.g 1024 = 1GB (default is 2GB)
|
||||
RAM capacity in Megabytes eg. 1024 = 1GB (default is 2GB)
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="fieldlabel">RAM - Balloon</td>
|
||||
<td class="fieldarea">
|
||||
<input type="text" size="8" name="balloon" id="balloon" value="0" required>
|
||||
Balloon space in Megabyte e.g 1024 = 1GB (0 = disabled)
|
||||
Balloon capacity in Megabytes eg. 1024 = 1GB (0 = disabled)
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="fieldlabel">Disk - Capacity</td>
|
||||
<td class="fieldarea">
|
||||
<input type="text" size="8" name="disk" id="disk" value="10240" required>
|
||||
HDD/SSD storage space in Gigabyte e.g 1024 = 1TB (default is 10GB)
|
||||
HDD/SSD storage in Gigabytes eg. 1024 = 1TB (default is 10GB)
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@@ -992,7 +1025,7 @@ function kvm_plan_add() {
|
||||
<option selected="" value="qcow2">QEMU Image (qcow2)</option>
|
||||
<option value="vmdk">VMware Image (vmdk)</option>
|
||||
</select>
|
||||
Recommend "QEMU/qcow2" (so it can make Snapshots)
|
||||
Recommend "QEMU/qcow2" (supports Snapshots)
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@@ -1031,11 +1064,11 @@ function kvm_plan_add() {
|
||||
<td class="fieldlabel">PVE Store - Name</td>
|
||||
<td class="fieldarea">
|
||||
<input type="text" size="8" name="storage" id="storage" value="local" required>
|
||||
Name of VM/CT Storage on Proxmox VE hypervisor. local/local-lvm/etc.
|
||||
Name of VM/CT Storage on Proxmox VE hypervisor. <code>local/local-lvm/etc</code>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="fieldlabel">NIC - Type</td>
|
||||
<td class="fieldlabel">Network - NIC Type</td>
|
||||
<td class="fieldarea">
|
||||
<select class="form-control select-inline" name="netmodel">
|
||||
<option value="e1000">Intel E1000 (Stable but slower)</option>
|
||||
@@ -1060,7 +1093,7 @@ function kvm_plan_add() {
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="fieldlabel">Network - IPv6 Conf.</td>
|
||||
<td class="fieldlabel">Network - IPv6</td>
|
||||
<td class="fieldarea">
|
||||
<select class="form-control select-inline" name="ipv6">
|
||||
<option value="0">Off</option>
|
||||
@@ -1247,7 +1280,7 @@ function kvm_plan_edit($id) {
|
||||
<option value="Opteron_G4" ' . ($plan->cpuemu == "Opteron_G4" ? "selected" : "") . '>(AMD) Opteron_G4</option>
|
||||
<option value="Opteron_G5" ' . ($plan->cpuemu == "Opteron_G5" ? "selected" : "") . '>(AMD) Opteron_G5</option>
|
||||
</select>
|
||||
CPU emulation type. Default is x86-64 psABI v2-AES
|
||||
Default is x86-64 psABI v2-AES.
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@@ -1255,14 +1288,14 @@ function kvm_plan_edit($id) {
|
||||
<td class="fieldlabel">CPU - Sockets</td>
|
||||
<td class="fieldarea">
|
||||
<input type="text" size="8" name="cpus" id="cpus" value="'.$plan->cpus.'" required>
|
||||
The number of CPU sockets. 1 - 4.
|
||||
The number of CPU Sockets (typically 1-4).
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="fieldlabel">CPU - Cores</td>
|
||||
<td class="fieldarea">
|
||||
<input type="text" size="8" name="cores" id="cores" value="'.$plan->cores.'" required>
|
||||
The number of CPU cores per socket. 1 - 32.
|
||||
The number of CPU Cores per Socket (1-N).
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@@ -1276,28 +1309,28 @@ function kvm_plan_edit($id) {
|
||||
<td class="fieldlabel">CPU - Weighting</td>
|
||||
<td class="fieldarea">
|
||||
<input type="text" size="8" name="cpuunits" id="cpuunits" value="'.$plan->cpuunits.'" required>
|
||||
Number is relative to weights of all the other running VMs. 8 - 500000 recommended 1024. NOTE: You can disable fair-scheduler by setting this to 0.
|
||||
Number is relative to weights of all the other running VMs. 8 - 500000 recommended 1024. Disable fair-scheduler by setting this to 0.
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="fieldlabel">RAM - Memory</td>
|
||||
<td class="fieldarea">
|
||||
<input type="text" size="8" name="memory" id="memory" required value="'.$plan->memory.'">
|
||||
RAM space in Megabytes e.g 1024 = 1GB
|
||||
RAM capacity in Megabytes eg. 1024 = 1GB
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="fieldlabel">RAM - Balloon</td>
|
||||
<td class="fieldarea">
|
||||
<input type="text" size="8" name="balloon" id="balloon" required value="'.$plan->balloon.'">
|
||||
Balloon space in Megabyte e.g 1024 = 1GB (0 = disabled)
|
||||
Balloon capacity in Megabytes eg. 1024 = 1GB (0 = disabled)
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="fieldlabel">Disk - Capacity</td>
|
||||
<td class="fieldarea">
|
||||
<input type="text" size="8" name="disk" id="disk" required value="'.$plan->disk.'">
|
||||
HDD/SSD storage space in Gigabytes e.g 1024 = 1TB
|
||||
HDD/SSD storage in Gigabytes eg. 1024 = 1TB
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@@ -1308,7 +1341,7 @@ function kvm_plan_edit($id) {
|
||||
<option value="qcow2" '. ($plan->diskformat=="qcow2" ? "selected" : "").'>QEMU image (qcow2)</option>
|
||||
<option value="vmdk" '. ($plan->diskformat=="vmdk" ? "selected" : "").'>VMware image (vmdk)</option>
|
||||
</select>
|
||||
Recommend "QEMU/qcow2 format" (to make Snapshots)
|
||||
Recommend "QEMU/qcow2 format" (supports Snapshots)
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@@ -1347,11 +1380,11 @@ function kvm_plan_edit($id) {
|
||||
<td class="fieldlabel">PVE Store - Name</td>
|
||||
<td class="fieldarea">
|
||||
<input type="text" size="8" name="storage" id="storage" required value="'.$plan->storage.'">
|
||||
Name of VM/CT Storage on Proxmox VE hypervisor. local/local-lvm/etc.
|
||||
Name of VM/CT Storage on Proxmox VE hypervisor. <code>local/local-lvm/etc</code>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="fieldlabel">NIC - Type</td>
|
||||
<td class="fieldlabel">Network - NIC Type</td>
|
||||
<td class="fieldarea">
|
||||
<select class="form-control select-inline" name="netmodel">
|
||||
<option value="e1000" '. ($plan->netmodel=="e1000" ? "selected" : "").'>Intel E1000 (Stable but slower)</option>
|
||||
@@ -1376,7 +1409,7 @@ function kvm_plan_edit($id) {
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="fieldlabel">Network - IPv6 Conf.</td>
|
||||
<td class="fieldlabel">Network - IPv6</td>
|
||||
<td class="fieldarea">
|
||||
<select class="form-control select-inline" name="ipv6">
|
||||
<option value="0" '. ($plan->ipv6=="0" ? "selected" : "").'>Off</option>
|
||||
@@ -1462,7 +1495,7 @@ function lxc_plan_add() {
|
||||
<td class="fieldlabel">CPU - Limit</td>
|
||||
<td class="fieldarea">
|
||||
<input type="text" size="8" name="cpulimit" id="cpulimit" value="1" required>
|
||||
Limit of CPU usage. Default is 1. Note: if the computer has 2 CPUs, it has total of "2" CPU time. Value "0" indicates no CPU limit.
|
||||
Limit of CPU usage. Default is 1. If the computer has 2 CPUs, it has total of "2" CPU time. Value "0" indicates no CPU limit.
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@@ -1476,21 +1509,21 @@ function lxc_plan_add() {
|
||||
<td class="fieldlabel">RAM - Memory</td>
|
||||
<td class="fieldarea">
|
||||
<input type="text" size="8" name="memory" id="memory" required>
|
||||
RAM space in Megabytes e.g 1024 = 1GB
|
||||
RAM capacity in Megabytes eg. 1024 = 1GB
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="fieldlabel">Swap - Space</td>
|
||||
<td class="fieldarea">
|
||||
<input type="text" size="8" name="swap" id="swap">
|
||||
Swap space in Megabytes e.g 1024 = 1GB
|
||||
Swap capacity in Megabytes eg. 1024 = 1GB
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="fieldlabel">Disk - Capacity</td>
|
||||
<td class="fieldarea">
|
||||
<input type="text" size="8" name="disk" id="disk" required>
|
||||
HDD/SSD storage space in Gigabytes e.g 1024 = 1TB
|
||||
HDD/SSD storage in Gigabytes eg. 1024 = 1TB
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@@ -1504,7 +1537,7 @@ function lxc_plan_add() {
|
||||
<td class="fieldlabel">PVE Store - Name</td>
|
||||
<td class="fieldarea">
|
||||
<input type="text" size="8" name="storage" id="storage" value="local" required>
|
||||
Name of VM/CT Storage on Proxmox VE hypervisor. local/local-lvm/etc.
|
||||
Name of VM/CT Storage on Proxmox VE hypervisor. <code>local/local-lvm/etc</code>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@@ -1543,7 +1576,7 @@ function lxc_plan_add() {
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="fieldlabel">Network - IPv6 Conf.</td>
|
||||
<td class="fieldlabel">Network - IPv6</td>
|
||||
<td class="fieldarea">
|
||||
<select class="form-control select-inline" name="ipv6">
|
||||
<option value="0">Off</option>
|
||||
@@ -1607,7 +1640,7 @@ function lxc_plan_edit($id) {
|
||||
<td class="fieldlabel">CPU - Limit</td>
|
||||
<td class="fieldarea">
|
||||
<input type="text" size="8" name="cpulimit" id="cpulimit" value="'.$plan->cpulimit.'" required>
|
||||
Limit of CPU usage. Default is 1. Note: if the computer has 2 CPUs, it has total of "2" CPU time. Value "0" indicates no CPU limit.
|
||||
Limit of CPU usage. Default is 1. If the computer has 2 CPUs, it has total of "2" CPU time. Value "0" indicates no CPU limit.
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@@ -1621,21 +1654,21 @@ function lxc_plan_edit($id) {
|
||||
<td class="fieldlabel">RAM - Memory</td>
|
||||
<td class="fieldarea">
|
||||
<input type="text" size="8" name="memory" id="memory" required value="'.$plan->memory.'">
|
||||
RAM space in Megabytes e.g 1024 = 1GB
|
||||
RAM capacity in Megabytes eg. 1024 = 1GB
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="fieldlabel">Swap - Space</td>
|
||||
<td class="fieldarea">
|
||||
<input type="text" size="8" name="swap" id="swap" value="'.$plan->swap.'">
|
||||
Swap space in Megabytes e.g 1024 = 1GB
|
||||
Swap capacity in Megabytes eg. 1024 = 1GB
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="fieldlabel">Disk - Capacity</td>
|
||||
<td class="fieldarea">
|
||||
<input type="text" size="8" name="disk" id="disk" value="'.$plan->disk.'" required>
|
||||
HDD/SSD storage space in Gigabytes e.g 1024 = 1TB
|
||||
HDD/SSD storage in Gigabytes eg. 1024 = 1TB
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@@ -1649,7 +1682,7 @@ function lxc_plan_edit($id) {
|
||||
<td class="fieldlabel">PVE Store - Name</td>
|
||||
<td class="fieldarea">
|
||||
<input type="text" size="8" name="storage" id="storage" value="'.$plan->storage.'" required>
|
||||
Name of VM/CT Storage on Proxmox VE hypervisor. local/local-lvm/etc.
|
||||
Name of VM/CT Storage on Proxmox VE hypervisor. <code>local/local-lvm/etc</code>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@@ -1688,7 +1721,7 @@ function lxc_plan_edit($id) {
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="fieldlabel">Network - IPv6 Conf.</td>
|
||||
<td class="fieldlabel">Network - IPv6</td>
|
||||
<td class="fieldarea">
|
||||
<select class="form-control select-inline" name="ipv6">
|
||||
<option value="0" '. ($plan->ipv6=="0" ? "selected" : "").'>Off</option>
|
||||
|
||||
@@ -76,19 +76,34 @@
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><strong>OS/etc</strong> (System)</td>
|
||||
<td>Kernel: {$vm_config['ostype']}</td>
|
||||
<td><strong>Boot Order</strong> (1st > 2nd)</td>
|
||||
<td>{($vm_config['boot']|replace:'order=':''|replace:';':' > ')}</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> (Networking)</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>
|
||||
<td>{($vm_config['net0']|replace:',':'<br/>')}</td>
|
||||
<td><strong>ipconfig</strong> (IPv4/v6)</td><td><strong>NIC #0</strong>: {$vm_config['ipconfig0']}<br><strong>NIC #1</strong>: {$vm_config['ipconfig1']}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><strong>NIC</strong> (Interface #2)</td>
|
||||
<td>{$vm_config['net1']}</td>
|
||||
<td><strong>NIC #0</strong> (IPv4)</td>
|
||||
<td>{($vm_config['net0']|replace:',':'<br/>'|replace:'=':': ')}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><strong>NIC #1</strong> (IPv6)</td>
|
||||
<td>{($vm_config['net1']|replace:',':'<br/>'|replace:'=':': ')}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><strong>Config</strong> (Tweaks)</td>
|
||||
<td>on_boot: {$vm_config['onboot']}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><strong>SSH Keys</strong> (Public)</td>
|
||||
<td>{$vm_config['sshkeys']}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><strong>OS</strong> (System Kernel)</td>
|
||||
<td><strong>{$vm_config['ostype']}</strong></td>
|
||||
</tr>
|
||||
</table>
|
||||
{if ($smarty.get.a eq 'vmStat')}
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
Proxmox VE for WHMCS - Addon/Server Modules for WHMCS (& PVE)
|
||||
https://github.com/The-Network-Crew/Proxmox-VE-for-WHMCS/
|
||||
File: /modules/servers/pvewhmcs/novnc_router.php (VNC)
|
||||
Proxmox VE for WHMCS - Addon/Server Modules for WHMCS (& PVE)
|
||||
https://github.com/The-Network-Crew/Proxmox-VE-for-WHMCS/
|
||||
File: /modules/servers/pvewhmcs/novnc_router.php (VNC)
|
||||
|
||||
Copyright (C) The Network Crew Pty Ltd (TNC) & Co.
|
||||
Copyright (C) The Network Crew Pty Ltd (TNC) & Co.
|
||||
|
||||
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
|
||||
@@ -21,30 +21,66 @@
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
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'];
|
||||
$vncticket = $_GET['vncticket'];
|
||||
$host = $_GET['host'];
|
||||
$path = $_GET['path'];
|
||||
// ---------------------------------------
|
||||
// Clear any existing PVEAuthCookie first
|
||||
// ---------------------------------------
|
||||
setcookie('PVEAuthCookie', '', [
|
||||
'expires' => time() - 3600,
|
||||
'path' => '/',
|
||||
'domain' => '',
|
||||
'secure' => true,
|
||||
'httponly' => false,
|
||||
'samesite' => 'None',
|
||||
]);
|
||||
|
||||
// Get the requesting hostname/domain from the WHMCS-originated request
|
||||
$whmcsdomain = parse_url($_SERVER['HTTP_HOST']);
|
||||
// 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);
|
||||
|
||||
// Create the final noVNC URL with the re-encoded vncticket
|
||||
$hostname = gethostbyaddr($host);
|
||||
$redirect_url = '/modules/servers/pvewhmcs/novnc/vnc.html?autoconnect=true&encrypt=true&host=' . $hostname . '&port=8006&password=' . urlencode($vncticket) . '&path=' . urlencode($path);
|
||||
|
||||
// Redirect the visitor to noVNC & we're done
|
||||
header('Location: ' . $redirect_url);
|
||||
exit;
|
||||
} else {
|
||||
// Passed in values not present, exit
|
||||
echo 'Error: Missing required info to route your request. Please try again.';
|
||||
exit;
|
||||
// ---------------------------------------
|
||||
// Check required GET parameters
|
||||
// ---------------------------------------
|
||||
if (!isset($_GET['pveticket'], $_GET['host'], $_GET['path'], $_GET['vncticket'])) {
|
||||
echo 'Error: Missing required info to route your request. Please try again.';
|
||||
exit;
|
||||
}
|
||||
|
||||
// ---------------------------------------
|
||||
// Assign GET parameters
|
||||
// ---------------------------------------
|
||||
$pveticket = $_GET['pveticket'];
|
||||
$vncticket = $_GET['vncticket'];
|
||||
$host = $_GET['host'];
|
||||
$path = $_GET['path'];
|
||||
|
||||
// ---------------------------------------
|
||||
// Determine main domain for cookie
|
||||
// ---------------------------------------
|
||||
$hostParts = explode('.', $_SERVER['HTTP_HOST']);
|
||||
$mainDomain = implode('.', array_slice($hostParts, -2)); // example.com
|
||||
|
||||
// ---------------------------------------
|
||||
// Set the PVEAuthCookie for Proxmox
|
||||
// ---------------------------------------
|
||||
setrawcookie('PVEAuthCookie', $pveticket, [
|
||||
'expires' => 0,
|
||||
'path' => '/',
|
||||
'domain' => '.' . $mainDomain,
|
||||
'secure' => true,
|
||||
'httponly' => false,
|
||||
'samesite' => 'None',
|
||||
]);
|
||||
|
||||
// ---------------------------------------
|
||||
// Build final noVNC URL
|
||||
// ---------------------------------------
|
||||
$hostname = gethostbyaddr($host);
|
||||
$redirect_url = './novnc/vnc.html?autoconnect=true&encrypt=true'
|
||||
. '&host=' . $hostname
|
||||
. '&port=8006'
|
||||
. '&password=' . urlencode($vncticket)
|
||||
. '&path=' . urlencode($path);
|
||||
|
||||
// ---------------------------------------
|
||||
// Redirect to noVNC
|
||||
// ---------------------------------------
|
||||
header('Location: ' . $redirect_url);
|
||||
exit;
|
||||
|
||||
?>
|
||||
@@ -40,6 +40,7 @@ function pvewhmcs_MetaData() {
|
||||
return array(
|
||||
'DisplayName' => 'Proxmox VE',
|
||||
'APIVersion' => '1.1',
|
||||
'RequiresServer' => 'true',
|
||||
);
|
||||
}
|
||||
|
||||
@@ -55,10 +56,8 @@ function pvewhmcs_AdminLink(array $params) {
|
||||
}
|
||||
|
||||
$url = 'https://' . $host . ':8006';
|
||||
$text = htmlspecialchars($host, ENT_QUOTES, 'UTF-8');
|
||||
|
||||
return '<form action="' . htmlspecialchars($url, ENT_QUOTES, 'UTF-8') . '" method="get" target="_blank">
|
||||
<input type="submit" value="' . $text . '" class="btn btn-sm btn-default" />
|
||||
<input type="submit" value="Log in to PVE" class="btn btn-sm btn-default" />
|
||||
</form>';
|
||||
}
|
||||
|
||||
@@ -69,12 +68,12 @@ function pvewhmcs_ConfigOptions() {
|
||||
|
||||
// Retrieve Plans
|
||||
foreach (Capsule::table('mod_pvewhmcs_plans')->get() as $plan) {
|
||||
$plans[$plan->id]=$plan->vmtype.' : '.$plan->title ;
|
||||
$plans[$plan->id] = '(' . $plan->vmtype . ') ' . $plan->title ;
|
||||
}
|
||||
|
||||
// Retrieve IP Pools
|
||||
foreach (Capsule::table('mod_pvewhmcs_ip_pools')->get() as $ippool) {
|
||||
$ippools[$ippool->id]=$ippool->title ;
|
||||
$ippools[$ippool->id] = $ippool->title ;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -660,7 +659,7 @@ function pvewhmcs_TerminateAccount(array $params) {
|
||||
}
|
||||
|
||||
// GENERAL CLASS: WHMCS Decrypter
|
||||
class hash_encryption {
|
||||
class pvewhmcs_hash_encryption {
|
||||
/**
|
||||
* Hashed value of the user provided encryption key
|
||||
* @var string
|
||||
@@ -693,7 +692,7 @@ class hash_encryption {
|
||||
* @param boold $base64 Enable base64 en- / decoding
|
||||
* @return mixed
|
||||
*/
|
||||
function hash_encryption($key, $base64 = true) {
|
||||
function pvewhmcs_hash_encryption($key, $base64 = true) {
|
||||
|
||||
global $cc_encryption_hash;
|
||||
|
||||
@@ -820,7 +819,7 @@ class hash_encryption {
|
||||
*
|
||||
* @todo Add more random sources.
|
||||
* @access private
|
||||
* @see function hash_encryption
|
||||
* @see function pvewhmcs_hash_encryption
|
||||
* @return string Binary pseudo random string
|
||||
**/
|
||||
function _generate_iv() {
|
||||
@@ -859,7 +858,7 @@ function pvewhmcs_get_whmcs_server_password($enc_pass){
|
||||
$key1 = md5 (md5 ($cc_encryption_hash));
|
||||
$key2 = md5 ($cc_encryption_hash);
|
||||
$key = $key1.$key2;
|
||||
$hasher = new hash_encryption($key);
|
||||
$hasher = new pvewhmcs_hash_encryption($key);
|
||||
return $hasher->decrypt($enc_pass);
|
||||
}
|
||||
|
||||
@@ -882,8 +881,8 @@ 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",
|
||||
);
|
||||
return $buttonarray;
|
||||
}
|
||||
@@ -1126,7 +1125,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.';
|
||||
@@ -1163,7 +1162,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.';
|
||||
@@ -1171,44 +1170,6 @@ function pvewhmcs_SPICE($params) {
|
||||
}
|
||||
}
|
||||
|
||||
// VNC: Console access to VM/CT via TigerVNC
|
||||
function pvewhmcs_javaVNC($params){
|
||||
// Check if VNC Secret is configured in Module Config, fail early if not. (#27)
|
||||
if (strlen(Capsule::table('mod_pvewhmcs')->where('id', '1')->value('vnc_secret'))<15) {
|
||||
throw new Exception("PVEWHMCS Error: VNC Secret in Module Config either not set or not long enough. Recommend 20+ characters for security.");
|
||||
}
|
||||
// Get login credentials then make the Proxmox connection attempt.
|
||||
$serverip = $params["serverip"];
|
||||
$serverusername = 'vnc';
|
||||
$serverpassword = Capsule::table('mod_pvewhmcs')->where('id', '1')->value('vnc_secret');
|
||||
$proxmox = new PVE2_API($serverip, $serverusername, "pve", $serverpassword);
|
||||
if ($proxmox->login()) {
|
||||
// Get first node name
|
||||
$nodes = $proxmox->get_node_list();
|
||||
$first_node = $nodes[0];
|
||||
unset($nodes);
|
||||
// Early prep work
|
||||
$guest = Capsule::table('mod_pvewhmcs_vms')->where('id','=',$params['serviceid'])->get()[0] ;
|
||||
$vncparams = array();
|
||||
$vm_vncproxy = $proxmox->post('/nodes/'.$first_node.'/'.$guest->vtype.'/'.$guest->vmid .'/vncproxy', $vncparams) ;
|
||||
// Java-specific params
|
||||
$javaVNCparams = array() ;
|
||||
$javaVNCparams[0] = $serverip ;
|
||||
$javaVNCparams[1] = str_replace("\n","|",$vm_vncproxy['cert']) ;
|
||||
$javaVNCparams[2] = $vm_vncproxy['port'] ;
|
||||
$javaVNCparams[3] = $vm_vncproxy['user'] ;
|
||||
$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>' ;
|
||||
// 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 {
|
||||
$vncreply = 'Failed to prepare TigerVNC. Please contact Technical Support.';
|
||||
return $vncreply;
|
||||
}
|
||||
}
|
||||
|
||||
// PVE API FUNCTION, CLIENT/ADMIN: Start the VM/CT
|
||||
function pvewhmcs_vmStart($params) {
|
||||
// Gather access credentials for PVE, as these are no longer passed for Client Area
|
||||
@@ -1389,6 +1350,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);
|
||||
|
||||
@@ -1,44 +0,0 @@
|
||||
|
||||
/*
|
||||
Proxmox VE for WHMCS - Addon/Server Modules for WHMCS (& PVE)
|
||||
https://github.com/The-Network-Crew/Proxmox-VE-for-WHMCS/
|
||||
File: /modules/servers/pvewhmcs/tigervnc.php (VNC)
|
||||
|
||||
Copyright (C) The Network Crew Pty Ltd (TNC) & Co.
|
||||
|
||||
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.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see https://www.gnu.org/licenses
|
||||
*/
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<title>Serial Console</title>
|
||||
</head>
|
||||
<body>
|
||||
<script>
|
||||
PVE_vnc_console_event = function(appletid, action, err) {
|
||||
|
||||
};
|
||||
</script>
|
||||
<?php
|
||||
$applet='<APPLET id=\'pveKVMConsole-1018-vncapp\' CODE=\'com.tigervnc.vncviewer.VncViewer\' ARCHIVE=\'VncViewer.jar\' WIDTH=100% HEIGHT=100%>
|
||||
<param value=\''.$_GET['0'].'\' name=\'host\'>
|
||||
<param value=\''.$_GET['1'].'\' name=\'PVECert\'>
|
||||
<param value=\''.$_GET['2'].'\' name=\'Port\'>
|
||||
<param name=\'USERNAME\' value=\''.$_GET['3'].'\'>
|
||||
<param name=\'PASSWORD\' value=\''.$_GET['4'].'\'>
|
||||
</APPLET>';
|
||||
?>
|
||||
<?php echo $applet ; ?>
|
||||
</body>
|
||||
</html>
|
||||