WireGuard VPN WHMCS module
- Description
- Changelog
- Installation and configuration guide
- WHMCS setup(install/update)
- PUQVPNCP installation and configuration
- Add server (PUQVPNCP) in WHMCS
- Product Configuration
- Localization change Сonfiguration
- Email Template (puqWireGuard Custom welcome email template)
- Email Template (puqWireGuard Custom change package Email template)
- Important Information About Generating a Unique Open Link for QR Code Delivery in an Email Template
- Client Area
- Admin Area
Description
WireGuard VPN module WHMCS
Order now | Download | FAQ
The WireGuard VPN module provides the ability to sell the Virtual Private Network service to customers.
Attention.
The module require the PUQVPNCP control panel with active license.
PUQVPNCP Documentation
PUQVPNCP Download
PUQVPNCP Order now
Module Functions:
- Auto create and deploy VPN account/accounts
- Suspend/Unsuspend/Terminate/Change Package
- Module require active PUQVPNCP API (need separte license)
- Possibility to set Bandwidth speed limits
- Module supports multilingualism (Arabic, Azerbaijani, Catalan, Chinese, Croatian, Czech, Danish, Dutch, English, Estonian, Farsi, French, German, Hebrew, Hungarian, Italian, Macedonian, Norwegian, Polish, Romanian, Russian, Spanish, Swedish, Turkish, Ukrainian)
- Link to instructions for setting up the service in the client area.
Available options in the admin panel:
- Create users
- Suspend users
- Terminate users
- Unsuspend users
- Change Package
- VPN connection status
Available options in the client panel:
- VPN connection status
WHMCS minimal version: 8 +
PUQVPNCP: 1.1 +
Changelog
WireGuard VPN module WHMCS
Order now | Download | FAQ
v2.0.2 Released 14-01-2025
v2.0 Released 24-09-2024
Module is coded ionCube v13
Supported php version:
- php 7.4 WHMCS 8.11.0 -
- php 8.1 WHMCS 8.11.0 +
- php 8.2 WHMCS 8.11.0 +
v1.5 Released 10-07-2024
- User Interface Optimization
- Changed the appearance of the navigation buttons on the home screen
- Optimizing the home screen for mobile devices
- Added inputs that contain login, wherever the login is present
- Added a copy login button wherever the login is present
- Added inputs that hide passwords wherever a password is present
- Added a button that allows you to peek the password wherever the password is present
- Added a copy password button wherever a password is present
- Optimized
v1.4.6 Released 21-06-2024
- Added MetricsProvider dimensions
- Added dimensions for UsageUpdate
- Added a function to turn off the display of the One-Time Link for a package
- Display changes in the client area
- Optimization
v1.4.5 Released 09-10-2023
- Supported WHMCS v8.8.0
- Translations added/updated (Arabic, Azerbaijani, Catalan, Chinese, Croatian, Czech, Danish, Dutch, English, Estonian, Farsi, French, German, Hebrew, Hungarian, Italian, Macedonian, Norwegian, Polish, Romanian, Russian, Spanish, Swedish, Turkish, Ukrainian)
- Added additional error logging to Log when changing package to change localization
- Fixed some bugs
v1.4.2 Released 04-09-2023
- Error handling when changing package to change localization
- Added additional logging to Activity Log
v1.4.1 Released 29-06-2023
- Redesigned error handling
- Added additional logging to Activity Log
v1.4 Released 16-06-2023
- Significantly revised the approach to transferring the QR code image in emails. Now, WHMCS generates a link to the image, and only the link to the image is included in the email itself
- Fixed some bugs
v1.3.6 Released 13-06-2023
- Fixed a bug that occurred in the client area if the IKEv2 protocol was disabled
v1.3.5 Released 31-05-2023
- Added the ability to change localization (updating the package and switching the server at the client's request)
- Added the ability to send QR codes and other important information via email when changing localization/package. This functionality is implemented as a custom email about localization/package change
- Fixed some bugs
v1.3 Released 19-05-2023
- Added a section in the client area that displays usage statistics by traffic
- Added necessary translation strings
v1.2.1 Released 12-05-2023
- Fixed bug with time offset in the admin area
- Added traffic recalculation in a human-friendly form in the admin area
- Added the ability to send a QR code and other important information in the Welcome E-mail. Functionality implemented as a custom Welcome E-mail
v1.2 Released 08-01-2023
- Fix bugs with languages
- Added ability to download profile for IKEv2
- Improved design in various themes
v1.1 Released 05-01-2023
- Support WHMCS V8.6+
- Support IonCube PHP Loader v12
- Support for PHP 8.1
- Added support for IKEv2
v1.0 Released 29-10-2022
First version
Installation and configuration guide
WHMCS setup(install/update)
WireGuard VPN module WHMCS
Order now | Download | FAQ
Module is coded ionCube v13
Supported php version:
- php 7.4 WHMCS 8.11.0 -
- php 8.1 WHMCS 8.11.0 +
- php 8.2 WHMCS 8.11.0 +
To install and update a module, you must perform one and the same action.
1. Download the latest version of the module.
PHP 8.2
wget http://download.puqcloud.com/WHMCS/servers/PUQ_WHMCS-WireGuard-VPN/php82/PUQ_WHMCS-WireGuard-VPN-latest.zip
PHP 8.1
wget http://download.puqcloud.com/WHMCS/servers/PUQ_WHMCS-WireGuard-VPN/php81/PUQ_WHMCS-WireGuard-VPN-latest.zip
PHP 7.4
wget http://download.puqcloud.com/WHMCS/servers/PUQ_WHMCS-WireGuard-VPN/php74/PUQ_WHMCS-WireGuard-VPN-latest.zip
All versions are available: https://download.puqcloud.com/WHMCS/servers/PUQ_WHMCS-WireGuard-VPN/
2. Unzip the archive with the module.
unzip PUQ_WHMCS-WireGuard-VPN-latest.zip
3. Copy and Replace "puqWireGuardVPN" from "PUQ_WHMCS-WireGuard-VPN" to "WHMCS_WEB_DIR/modules/servers/"
PUQVPNCP installation and configuration
WireGuard VPN module WHMCS
Order now | Download | FAQ
Official documentation:
PUQVPNCP Documentation
PUQVPNCP Download
PUQVPNCP Order now
1. Install the required packages
apt-get update
apt-get install wireguard wireguard-dkms wireguard-tools -y
apt-get install iproute2 iptables -y
apt-get install bind9 -y
2. Download the latest version of the package
https://download.puqcloud.com/cp/puqvpncp/
3. Install the puqvpncp package
wget https://download.puqcloud.com/cp/puqvpncp/puqvpncp_1.1-2_amd64.deb
dpkg -i puqvpncp_1.1-2_amd64.deb
4. After installation, connect to your server via a web browser.
http://SERVER_IP:8098
Username: admin
Password: admin
5. Enable SSL Let’s Encrypt
Requirements
- The active domain name that resolves the server's IP address
- Port 80 and 443 are always open, and not busy with another process
In order for the system to start the procedure for obtaining an SSL certificate from Let's Encrypt, it is necessary.
In the configuration file, enable the use of SSL and enter the domain name.
nano /etc/puqvpncp/puqvpncp.conf
LetsEncrypSSL=yes
Domain=XXXXXX.XXX
Restart the PUQVPNCP service
service puqvpncp restart
After these steps, the first time you connect to the server via the https protocol, the system will request an SSL certificate and automatically renew it if necessary.
ATTENTION. After activating SSL, the system will only work in the https protocol on port 443.
A redirect is also set from port 80 to port 443.
To connect to the server via the https protocol, use only the domain that was set in the configuration file.
Otherwise, you will get an error that SSL is not working correctly.
6. License configuration is available in the menu item Settings->License
By default, the system limit is 50 users and the API is disabled.
In order to activate the license key, the key must be entered in the "License Key" field and click on the "Save" button
7.Creation of access API
To manage API Access Hashs, go to the section Settings->API
Enter the name and IP address of the WHMCS server and click the ADD button
Attention.
The generated Access hash will only be shown once. Copy it, it will be needed during configuration of the product server in the WHMCS system.
Accept the fact that once the Access Hashs API is created, it will only be shown once.
Each API Access Hash only works from a specific IP address.
8. Creation of access API
Add new WireGuard is available in the menu item VPN servers->WireGuard->Click Create
Enter or edit the parameters of the new server/interface and click the ADD button
Add server (PUQVPNCP) in WHMCS
WireGuard VPN module WHMCS
Order now | Download | FAQ
Add a new server to the system WHMCS.
Login to Your WHMCS panel and create new server in WHMCS (System Settings->Products/Services->Servers)
System Settings->Servers->Add New Server
- Enter the correct Name and Hostname
Name is just for Your convenience and You can put there anything You like ie: Mygreat PUQVPNCP routr
You can choose whatever hostname You want. Valid entries look similar to: vpn.mydomain.com, ourgreatvpn.mydomain.net. You can also dedicate whole domain ie: myVPNservices.com if You like. The important thing is to resolve the choosen IP address of the PUQVPNCP in DNS server for Your domain.
Enter the correct data in the Access Hash field
- In the Server Details section, select the "PUQ WireGuard VPN" module and enter the correct API Access Hash.
- To check, click the "Test connection" button
If you save the correct login and password for PUQVPNCP in the server settings, then the Login to PUQ VPN Control Panel button will open for you without entering a login and password.
Product Configuration
WireGuard VPN module WHMCS
Order now | Download | FAQ
Add new product to WHMCS
System Settings->Products/Services->Create a New Product
In the Module settings section, select the "PUQ WireGuard VPN" module
- License key: A pre-purchased license key for the "PUQ WireGuard VPN" module. For the module to work correctly, the key must be active
VPN Server
- Please select your server from the list. The list is loaded inconsistently from the server PUQVPNCP, you may need to log in to the panel to make changes.
Link settings
- Link to instruction - If you have prepared instructions for your customers on how to use the service, then a link to the instructions is provided here (If filled, it will be shown in the client area)
- Link to VPN clients - Link to download the VPN client. For example https://www.wireguard.com/install/ (If filled, it will be shown in the client area)
- Disable One-time link - When this option is enabled, a one-time link to the VPN clients will be disabled in the client area, preventing the customer from using a single-use link for downloading the VPN clients.
E-mail configuration
- Custom Welcome Email - Drop-down list of available e-mail templates for the action of creating a new client account. Please note that it is necessary to disable the standard welcome email in order to avoid double notification
- Custom Change localization Email - Drop-down list of available e-mail templates for the localization change action (package change) for the client account. Please note that you need to disable the standard package change email to avoid double notification.
VPN users settings
- Bandwidth Download - Bandwidth Download of VPN accounts (package change)
- Bandwidth Upload - BandwidthUpload of VPN accounts (package change)
Metric Billing
-
Bandwidth Usage In (GB):
- Metric Type: Monthly
- Metric Unit: Gigabytes (GB)
- Pricing Scheme:
- Per Unit: Billing for each gigabyte of traffic.
- Total Volume: Billing for the total volume of traffic.
- Graduated: Billing on a graduated scale.
- Quantity Included: Allows you to set how many gigabytes are included in the plan.
- Price Per GB: Allows you to specify the cost per gigabyte of traffic in various currencies.
-
Bandwidth Usage Out (GB):
- Metric Type: Monthly
- Metric Unit: Gigabytes (GB)
- Pricing Scheme:
- Per Unit: Billing for each gigabyte of traffic.
- Total Volume: Billing for the total volume of traffic.
- Graduated: Billing on a graduated scale.
- Quantity Included: Allows you to set how many gigabytes are included in the plan.
- Price Per GB: Allows you to specify the cost per gigabyte of traffic in various currencies.
Overages Billing
- Check to Enable: Enables overage billing.
- Soft Limits:
- Disk Usage: not use.
- Bandwidth: Sets a soft limit for bandwidth usage (units: MB, GB, TB). For example, you can set a soft limit of 1 GB for bandwidth.
- Overage Costs:
- Disk Usage: not use.
- Bandwidth: Specifies the cost per unit over the soft limit for bandwidth usage.
- Price Per Unit Over Above: Sets the pricing for overage units.
Localization change Сonfiguration
WireGuard VPN module WHMCS
Order now | Download | FAQ
To ensure the functionality of changing localization, you need to make some settings. We will give an example of such a configuration with two independent installations where "(UA) PUQ WireGuard VPN" and "(PL) PUQ WireGuard VPN" are two different packages that have two independent groups of servers and have different locations. In our example, we simulate two localizations and the ability to change client packages, which allow changing localization, it is also worth noting that in our configuration example, many servers are used in each of the two groups, where the server is selected according to the least loaded one, which is necessary for correct load distribution between servers.
Attention! For the correct operation of this functionality, available servers are required. If the server is unavailable, changing the package when changing the locale will fail.
1. Add necessary services according to your requirements. (How to add servers)
2. Add your servers to specific server groups.
Add your servers for the first group:
Add your servers for the second group:
Server groups look like this:
Note. Currently only the "Add to the least full server" scenario is implemented.
3. Select the appropriate server groups in the corresponding product.
Choose your servers group for the first product:
Choose your servers group for the second product:
4. Select the appropriate package to update.
Choose your package update for the first product:
Choose your package update for the second product:
Note. Please note that in order to avoid double notification, notification by means of WHMCS is disabled, because a custom notification will be used.
Email Template (puqWireGuard Custom welcome email template)
WireGuard VPN module WHMCS
Order now | Download | FAQ
Create an email template for customer notifications.
System Settings->Email Templates->Create New Email Template
- Email Type: Product/service
Unique Name: puqWireGuard Custom welcome email template
Subject:
Welcome to Your New VPN Service - Connection Information Enclosed
Body:
Dear {$client_name},
Congratulations and welcome to your new VPN service! We are excited to have you on board, and we appreciate your trust in us to provide you with a secure, private, and fast online experience.
To get started, please find your VPN connection details below:
Username: {$user}
Password: {$password}
Server Hostname: {$server_hostname}
Available connection protocols: {$protocol}
One-time link where you will find all comprehensive information:
{$otl}
Here you will find all the information about the possibility of connecting to a VPN service.
Attention! You can use this link only once, if you need to get the login data from the link again, use the client panel to generate a new link.
Android app download link: https://play.google.com/store/apps/details?id=com.wireguard.android
iPhone app download link: https://apps.apple.com/us/app/wireguard/id1441195209
To quickly connect after downloading the official WireGuard app for your device, scan the QR code below.
{$qrimage_small}
small size
{$qrimage_medium}
medium size
{$qrimage_large}
large size
{$qrimage_max}
max size
You can use these credentials to connect to our VPN service using your preferred VPN client or app. If you need assistance with setting up the connection or require a step-by-step guide, please visit our support page: [your-company-support-page-link].
For your convenience, we have also attached a detailed user manual to this email. The manual will provide you with comprehensive instructions on how to use our service and configure your VPN connection.
Please keep this email safe, as it contains sensitive information about your VPN account. We strongly advise you not to share your login credentials with anyone.
Once again, thank you for choosing our VPN service. We are committed to providing you with the best online experience, and we look forward to serving you.
{$signature}
Email Template (puqWireGuard Custom change package Email template)
WireGuard VPN module WHMCS
Order now | Download | FAQ
Create an email template for customer notifications.
System Settings->Email Templates->Create New Email Template
- Email Type: Product/service
Unique Name: puqWireGuard Custom change package Email template
Subject:
You have changed the location in your VPN service - connection information is attached
Body:
Dear {$client_name},
You received this email because your connection location has changed.
To continue, find your VPN connection information below:
Username: {$user}
Password: {$password}
Server Hostname: {$server_hostname}
Available connection protocols: {$protocol}
One-time link where you will find all comprehensive information:
{$otl}
Here you will find all the information about the possibility of connecting to a VPN service.
Attention! You can use this link only once, if you need to get the login data from the link again, use the client panel to generate a new link.
Android app download link: https://play.google.com/store/apps/details?id=com.wireguard.android
iPhone app download link: https://apps.apple.com/us/app/wireguard/id1441195209
To quickly connect after downloading the official WireGuard app for your device, scan the QR code below.
{$qrimage_small}
small size
{$qrimage_medium}
medium size
{$qrimage_large}
large size
{$qrimage_max}
max size
You can use these credentials to connect to our VPN service using your preferred VPN client or app. If you need assistance with setting up the connection or require a step-by-step guide, please visit our support page: [your-company-support-page-link].
For your convenience, we have also attached a detailed user manual to this email. The manual will provide you with comprehensive instructions on how to use our service and configure your VPN connection.
Please keep this email safe, as it contains sensitive information about your VPN account. We strongly advise you not to share your login credentials with anyone.
Once again, thank you for choosing our VPN service. We are committed to providing you with the best online experience, and we look forward to serving you.
{$signature}
Important Information About Generating a Unique Open Link for QR Code Delivery in an Email Template
WireGuard VPN module WHMCS
Order now | Download | FAQ
Introduction
This process allows for the generation of unique open links for QR codes that can be incorporated into email templates in WHMCS. This is convenient for ensuring secure access to your user's configuration data.
Security Mechanism
The security mechanism built into this process has multiple layers of protection that ensure the safety of the data. Details about the implementation of the protection are not disclosed to maintain maximum security.
Activity Notifications
If there are attempts to unauthorized access to the QR code, the administrator will receive corresponding notifications in the WHMCS activity log. This ensures full control and visibility of any attempts to access the QR code.
Important: It's essential to react to these notifications in the activity log and take appropriate security measures.
Notification Levels
-
High level of danger: Notifications in the form of "Someone is trying to get a QR code, but the verification words are wrong. [additional data follows]". This indicates an attempt to access the QR code using incorrect verification parameters.
-
Low level of danger: Notifications in the form of "It looks like someone is trying to get a QR code. [additional data follows]". This indicates an attempt to access, but without any attempt to use verification parameters.
Reacting to Notifications
It's necessary to take appropriate security measures when receiving high-level danger notifications. Upon receiving low-level danger notifications, pay attention, but it's not critical. In any case, you will always be aware of attempts to access the QR code, and you will have the IP address of the device making such requests.
Conclusion
Using this mechanism ensures the safety and control of access to a user's configuration data via QR code.
Client Area
Home screen
WireGuard VPN module WHMCS
Order now | Download | FAQ
Client Area Description
Manage
- Network Configuration:
- VPN Protocols: Displays available VPN protocols such as WireGuard and IKEv2. The client will see the configuration for IKEv2 if available.
- Bandwidth download/upload: Shows the bandwidth rate available for each VPN client account, which is set in the package.
- User manual: Link to user manual or instructions for using the VPN service.
- Download VPN client: Link to download the VPN client software.
- Create one-time link: Button to generate a one-time link with connection parameters, useful for transferring connection settings to the end user.
- WireGuard Configuration:
- Download Config: Button to download the WireGuard configuration file.
- QR Code: QR code containing the WireGuard configuration details.
- Configuration Details: Displays detailed configuration settings such as address, DNS, private key, endpoint, public key, and allowed IPs.
- IKEv2 Configuration:
- Download CA Certificate: Button to download the IKEv2 CA certificate.
- Download Profile: Button to download the IKEv2 profile.
- Server Details: Displays the server address and username.
- Password: Displays the password for the IKEv2 configuration.
Metrics
- Usage Metrics:
- Bandwidth Usage In (GB): Displays the current usage, pricing, and last update time for incoming bandwidth usage.
- Bandwidth Usage Out (GB): Displays the current usage, pricing, and last update time for outgoing bandwidth usage.
- Example:
- Current Usage: GB (In), GB (Out)
- Pricing: Price / GB (set in the package)
- Last Update: Time of last data update
Resource Usage
- Bandwidth:
- Usage: Displays the current bandwidth usage and the total available bandwidth limit (e.g., 3111MB / 1024MB, which is set in the package).
- Last Updated: Shows the last update time of the resource usage metrics.
Summary of the Client Panel Page
- VPN Protocols: Lists available VPN protocols like WireGuard and IKEv2.
- Bandwidth download/upload: Indicates the bandwidth rate assigned to each VPN client account, as set in the package.
- User Manual and VPN Client Download: Provides links to the user manual and VPN client download.
- One-time Link Generation: Allows the creation of a one-time link for sharing connection parameters.
- WireGuard Configuration: Shows configuration options for WireGuard, including downloading the config file and displaying QR code and detailed settings.
- IKEv2 Configuration: Shows configuration options for IKEv2, including downloading CA certificate and profile, and displaying server and login details.
- Metrics Tab: Displays detailed usage metrics for bandwidth usage, including current usage, pricing (e.g., 10.00 EUR / GB, set in the package), and last update time.
- Resource Usage Tab: Displays current usage of disk space and bandwidth with the bandwidth limit set in the package (e.g., 3111MB / 1024MB) and the last updated time.
Traffic statistics
WireGuard VPN module WHMCS
Order now | Download | FAQ
This page displays information about client traffic statistics
Month: In this field, you can select the month for which you want to view traffic data
Year: In this field, you can select the year for which you want to view traffic data
Data type toggle: In this field, you can turn on or off the display of days with no traffic
Graph and table that display data according to the selected parameters. You can also sort data by clicking on the corresponding headings in the table.
Displaying data with the option to hide nulls enabled looks like this:
Admin Area
Product Home Screen
WireGuard VPN module WHMCS
Order now | Download | FAQ
The main screen of the product contains the following items.
- Ability to generate a one-time link with the client's configuration.
- WireGuard peer dump
- Firewall Mangle Rules
- Traffic Control Rules
- List of VPN client accounts