diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..e69de29 diff --git a/README.md b/README.md index d927339..fdb867c 100644 --- a/README.md +++ b/README.md @@ -12,36 +12,34 @@ WHMCS module for integration with [WGDashboard](https://github.com/donaldzou/WGD ## 🚀 Installation 1. Upload the module files to the WHMCS directory: + ``` /modules/servers/wgdashboard/ ``` - 2. File structure: + ``` modules/server/wgdashboard/ ├── wgdashboard.php └── clientarea.tpl ``` - 3. In the WHMCS admin panel, navigate to: **Setup → Products/Services → Servers → Add New Server** - 4. Configure the server: + - **Hostname**: IP or domain of WGDashboard (e.g., `10.0.238.222` or `vpn.example.com`) - **Module**: WGDashboard - **Port**: API port (e.g., `10086`) - **Password**: WGDashboard API Key - 5. Click **Test Connection** to validate the configuration. ## ⚙️ Product Configuration 1. Create or edit a product in **Setup → Products/Services** - 2. In the **Module Settings** tab: + - **Module Name**: WGDashboard - **Server Group**: Select the configured server - 3. **Configuration Options**: - **Allowed IPs**: Allowed IPs for the peer (default: `0.0.0.0/0`) @@ -59,6 +57,7 @@ WHMCS module for integration with [WGDashboard](https://github.com/donaldzou/WGD ``` Available placeholders: + - `{{client_email}}` - Client's email - `{{domain}}` - Service domain - `{{serviceid}}` - Service ID in WHMCS @@ -82,7 +81,6 @@ Client Area: - 📄 **Formatted Configuration**: Ready-to-use WireGuard configuration file - 📋 **Download**: Button to download `.conf` file - ### Admin Panel In the client's service tab, the administrator views: @@ -95,7 +93,6 @@ In the client's service tab, the administrator views: - **Data Received**: Volume of data received From peer to server - **Data Sent**: Volume of data sent From server to peer - ## 🌐 WGDashboard Configuration To use this module, ensure the WGDashboard API is enabled: @@ -110,16 +107,19 @@ To use this module, ensure the WGDashboard API is enabled: ### Connection Test Fails **Error 401/403**: Verify API Key + ``` Solution: Confirm that the API Key is correct in the server's Password field ``` **Error 404**: Endpoint not found + ``` Solution: Check if your WGDashboard version supports the API ``` **Error 500**: WGDashboard internal error + ``` Solution: Check WGDashboard logs on the server ``` @@ -134,6 +134,7 @@ Solution: Check WGDashboard logs on the server ### QR Code Doesn't Appear Check: + - If JavaScript is enabled in the browser - Browser console for errors (F12) - If QRCode.js library is loading correctly @@ -144,14 +145,15 @@ The module uses WHMCS's **Server Port** field to define the API port. Do not include the port in the hostname, only in the dedicated field. ✅ **Correct**: + - Hostname: `10.0.0.55` - Port: `10086` ❌ **Incorrect**: + - Hostname: `10.0.0.55:10086` - Port: (empty) - ## 🔄 Compatibility - **WHMCS**: 7.0+ @@ -182,6 +184,7 @@ Contributions are welcome! To contribute: ## 📋 Changelog ### v1.0.0 + - ✨ Initial release - ✅ Peer creation, suspension, reactivation, and termination - 📱 Client area with QR code and formatted configuration @@ -189,4 +192,4 @@ Contributions are welcome! To contribute: - 🔐 Local WireGuard key generation - 📊 Admin panel with peer statistics ---- \ No newline at end of file +--- diff --git a/WGDashboard/clientarea.tpl b/WGDashboard/clientarea.tpl index 31a8a17..0e48f54 100644 --- a/WGDashboard/clientarea.tpl +++ b/WGDashboard/clientarea.tpl @@ -1,6 +1,6 @@ {if $error}
- Erro: {$error} + Error: {$error}
{else}
@@ -9,15 +9,15 @@

- Código QR + QR Code

-

Escaneie este código QR com seu cliente WireGuard

+

Scan this QR code with your WireGuard client

@@ -26,11 +26,11 @@

- Código QR + QR Code

-

Configuração não disponível

+

Configuration not available

{/if} @@ -40,25 +40,25 @@

- Configuração WireGuard + WireGuard Configuration

{if $formatted_config}
- +
{$formatted_config|escape}
{else} -

Configuração não disponível

+

Configuration not available

{/if}
@@ -66,41 +66,41 @@
{/if} -{* Modal de Instruções *} +{* Instructions Modal *}