38 Commits

Author SHA1 Message Date
Luke S Thompson
81e169995b v1.2.19: Remove TigerVNC (Java) 2025-10-24 01:04:08 +11:00
Luke S Thompson
80c54caf17 Merge branch 'master' of https://github.com/The-Network-Crew/Proxmox-VE-for-WHMCS 2025-10-19 21:19:10 +11:00
Luke S Thompson
505c006ca1 Merch C'LOG with v1.2.18 v2 (fix #114) 2025-10-19 21:19:05 +11:00
Luke S Thompson
cd2494d688 v1.2.18 v2: fix #114 as well 2025-10-19 21:13:33 +11:00
Luke S Thompson
46f7ac1510 Status Check recategorised 2025-10-19 18:35:11 +11:00
Luke S Thompson
b860eb7098 Same just higher-res 2025-10-19 18:29:08 +11:00
Luke S Thompson
aa89be278d Extra info in Client Area screenshot 2025-10-19 18:27:24 +11:00
Luke S Thompson
22266db93e v1.2.18: Client Area detail 2025-10-19 18:22:01 +11:00
Luke S Thompson
272b3146e5 New cookie deletion logic; tidy-up VNC (#167) 2025-10-19 18:06:51 +11:00
Luke S Thompson
6544f1a98f Add the Boot Order to Client Area 2025-10-19 15:41:01 +11:00
Luke S Thompson
635e057263 Cleaner parsing of API response 2025-10-19 12:59:14 +11:00
Luke S Thompson
4c88d4bd7f Add onboot & sshkeys to Client Area 2025-10-19 12:52:11 +11:00
Luke S Thompson
bf2f981435 Correct interface numbering 2025-10-19 12:37:48 +11:00
Luke S Thompson
14adeda5af Add ipconfig to Client Area TPL 2025-10-19 12:04:16 +11:00
Luke S Thompson
2a94251b6d Improvements to Plan Editing 2025-10-19 10:44:15 +11:00
Luke S Thompson
a4b90f8d84 v1.2.17: VNC & Hyperscalers! 2025-10-19 09:49:08 +11:00
Luke S Thompson
472e9c8266 samesite=None for PVE Cookie (#167) 2025-10-18 22:22:35 +11:00
Luke S Thompson
cbf686b787 ss: New Action; Green CTA; Tidier Text 2025-10-18 21:53:21 +11:00
Luke S Thompson
e3f2491b56 VNC prepared now Green; Cookie = Secure (#167) 2025-10-18 21:36:28 +11:00
Luke S Thompson
5acc32fb2b Explain noVNC debug logging (#167) 2025-10-18 20:21:19 +11:00
Luke S Thompson
f614863547 Add "Check Status" Client action 2025-10-18 19:50:15 +11:00
Luke S Thompson
49a5d7f317 Delete cookie before setting it (#167) 2025-10-18 17:47:46 +11:00
Luke S Thompson
a81013bbc2 Explain about PVEAuthCookie (#167) 2025-10-18 17:41:04 +11:00
Luke S Thompson
5432eaad80 Clarify how to access noVNC (#167) 2025-10-18 12:11:43 +11:00
Luke S Thompson
63f56f8eea Cores/CPUs columns 2->3 chars (#167) 2025-10-17 12:17:41 +11:00
Luke S Thompson
cc302ed650 Try fix max-RAM issue (#167) 2025-10-17 12:01:30 +11:00
Luke S Thompson
2d8888138f v1.2.16: Minor Adjustments 2025-10-15 13:42:41 +11:00
Luke S Thompson
8d3c6e4abd Improved text layout (Admin GUI) 2025-10-15 13:37:49 +11:00
Luke S Thompson
f1f16e0826 Link to repo for Available Update 2025-10-15 13:31:41 +11:00
Luke S Thompson
fb9b730355 Minor wording tweaks (Plan add/edit) 2025-10-14 13:10:29 +11:00
Luke S Thompson
98270007e5 Guest Plan & PVE GUI button formatting 2025-10-13 13:42:41 +11:00
Luke S Thompson
3585a6cc1c Import & Support notes into highlights 2025-09-03 11:29:16 +10:00
Luke S Thompson
e266fa8c9d Replace Wiki link w/ README 2025-08-30 08:08:29 +10:00
Luke S Thompson
f4c3f0de0e v1.2.15: Little Adjustments 2025-08-29 10:51:35 +10:00
Luke S Thompson
470b1e15d2 Retain SQL data on-deactivate (fix #160) 2025-08-27 12:08:49 +10:00
Luke S Thompson
38a0e9f935 Update CHANGELOG.md 2025-08-27 10:52:04 +10:00
Luke S Thompson
e221503cc8 NIC #2 info to multiple lines 2025-08-27 10:51:37 +10:00
Luke S Thompson
7851db7cad Rename function (fix #159) 2025-08-27 10:45:48 +10:00
15 changed files with 276 additions and 201 deletions

View File

@@ -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

View File

@@ -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 |

View File

@@ -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: 287 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 291 KiB

After

Width:  |  Height:  |  Size: 338 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 285 KiB

After

Width:  |  Height:  |  Size: 315 KiB

BIN
_images/zVNCprepared.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB

View File

@@ -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`)
);

View File

@@ -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>

View File

@@ -76,19 +76,34 @@
</td>
</tr>
<tr>
<td><strong>OS/etc</strong> (System)</td>
<td>Kernel:&nbsp;{$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:&nbsp;{$vm_config['netmask4']}<br/>Gateway:&nbsp;{$vm_config['gateway4']}</td>
<td><strong>IPv4</strong> (Networking)</td><td><strong>{$vm_config['ipv4']}</strong><br/>Mask:&nbsp;{$vm_config['netmask4']}<br/>Gateway:&nbsp;{$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')}

View File

@@ -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;
?>

View File

@@ -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.'&nbsp;:&nbsp;'.$plan->title ;
$plans[$plan->id] = '(' . $plan->vmtype . ')&nbsp;' . $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);

View File

@@ -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>

View File

@@ -1 +1 @@
1.2.14
1.2.19