Skip to content

Commit 38e9337

Browse files
authored
docs: add repo readme and install instructions (#69)
Add README to the repository with installation instructions, including screenshots to guide the process. Co-authored-by: Ville Skyttä <ville.skytta@upcloud.com> Signed-off-by: Ville Vesilehto <ville.vesilehto@upcloud.com>
1 parent 974a8fa commit 38e9337

12 files changed

Lines changed: 279 additions & 0 deletions

README.md

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
# UpCloud WHMCS Module
2+
3+
This is the official WHMCS provisioning module for [UpCloud](https://upcloud.com/), allowing you to offer and manage UpCloud VPS services through your WHMCS installation.
4+
5+
## Features
6+
7+
- Automated provisioning of UpCloud VPS servers
8+
- Server management capabilities (start, stop, reboot)
9+
- Client area interface for server management
10+
- Bandwidth monitoring and usage tracking
11+
- Reverse DNS management
12+
- Package/plan upgrades and downgrades
13+
- Support for UpCloud's API
14+
15+
## Requirements
16+
17+
- WHMCS 7.x or later
18+
- PHP 7.0 or later
19+
- UpCloud API credentials
20+
21+
## Installation
22+
23+
See [docs/INSTALL.md] for instructions.
24+
25+
## Client Area Features
26+
27+
The module provides a comprehensive client area interface that allows your clients to:
28+
29+
- View server details and specifications
30+
- Monitor bandwidth usage
31+
- Start, stop, and reboot their VPS
32+
- Manage reverse DNS settings
33+
- View server status and uptime
34+
35+
## Admin Features
36+
37+
As an administrator, you can:
38+
39+
- Provision new VPS servers automatically
40+
- Suspend, unsuspend, and terminate accounts
41+
- Change server packages/plans
42+
- View detailed server information
43+
- Manage reverse DNS settings
44+
45+
## Module Structure
46+
47+
The module follows the standard WHMCS module structure:
48+
49+
```
50+
modules/servers/upCloudVps/
51+
├── upCloudVps.php # Main module file with all WHMCS hook functions
52+
├── templates/ # Client area templates
53+
│ ├── overview.tpl # Main client area template
54+
│ ├── error.tpl # Error template
55+
│ └── assets/ # CSS, JS, and image assets
56+
├── lib/ # Module libraries and classes
57+
├── cron/ # Cron job scripts for usage updates
58+
└── lang/ # Language files for internationalization
59+
```
60+
61+
## Contributing
62+
63+
Contributions to the UpCloud WHMCS module are welcome. To contribute:
64+
65+
1. Fork the repository
66+
2. Create a feature branch (`git checkout -b feature/amazing-feature`)
67+
3. Commit your changes (`git commit`), prefer commit messages that adhere to [conventional commits](https://www.conventionalcommits.org)
68+
4. Push the branch (`git push -u origin feature/amazing-feature`)
69+
5. Open a Pull Request
70+
71+
## License
72+
73+
This module is released under the MIT License. See the [LICENSE](LICENSE) file for details.

docs/INSTALL.md

Lines changed: 206 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,206 @@
1+
# UpCloud WHMCS Module Installation Guide
2+
3+
This guide will walk you through the process of installing and configuring the UpCloud VPS Module for WHMCS.
4+
5+
## Table of Contents
6+
7+
- [Overview](#overview)
8+
- [Features](#features)
9+
- [Installation](#installation)
10+
- [Downloading and Uploading to WHMCS](#downloading-and-uploading-to-whmcs)
11+
- [Obtaining API Credentials](#obtaining-api-credentials)
12+
- [Creating Your First WHMCS Server](#creating-your-first-whmcs-server)
13+
- [Creating a Server Group](#creating-a-server-group)
14+
- [Configuration](#configuration)
15+
- [Creating a Product Group](#creating-a-product-group)
16+
- [Creating a New Product](#creating-a-new-product)
17+
- [Module Settings](#module-settings)
18+
- [Configurable Options](#configurable-options)
19+
- [Adding Existing VPS to Users](#adding-existing-vps-to-users)
20+
21+
## Overview
22+
23+
The UpCloud VPS Module for WHMCS is a versatile tool designed to assist businesses of all sizes in efficiently managing their Cloud Instances. It simplifies the process of configuring and overseeing VM instances, providing users with seamless control and automation capabilities.
24+
25+
## Features
26+
27+
### Admin Features:
28+
29+
1. **Deployment**: Administrators can manually deploy VMs by clicking 'Create' or set up automatic deployment during product setup, specifying location, region, OS, and custom fields like SSH keys or user data (cloud-init) initialization.
30+
31+
2. **Termination**: VM termination can be done manually or automated, with the option to set up automatic termination through WHMCS automation settings, which functions based on WHMCS cron jobs.
32+
33+
3. **Upgrade/Downgrade**: Administrators can manually adjust CPU/RAM/Storage configurations by clicking the 'Change Package' button, or configure automatic upgrades/downgrades.
34+
35+
4. **VM Management**: Administrators can start, stop, restart, suspend, unsuspend VMs, and view all basic VM information including VPS, VNC, IP addresses, etc.
36+
37+
5. **Reverse PTR**: Admins can set and view reverse PTR records.
38+
39+
6. **Login Credentials**: If configured, the system can even send login credentials automatically.
40+
41+
7. **Custom Plans**: Once set by admin during product setup, users can customize their plans and select them for deployment after making a payment.
42+
43+
8. **Cron Job**: The administrator must schedule cron jobs to run every 5 minutes to generate bandwidth usage graphs.
44+
45+
9. **Pricing Adjustment**: While UpCloud has predefined prices for Windows, CPU, RAM, and storage, you have the flexibility to adjust them according to your specific requirements.
46+
47+
### Client Features:
48+
49+
1. **VM Information**: Clients can view basic VM information such as VPS, VNC, IP addresses details.
50+
51+
2. **VNC Management**: Clients can enable/disable VNC access.
52+
53+
3. **Password Management**: Clients can change their VNC passwords.
54+
55+
4. **Reverse PTR**: Clients can view and set reverse PTR records.
56+
57+
5. **VM Control**: Clients can start, stop, and restart their VMs.
58+
59+
6. **Configuration Modification**: Clients can modify server configurations to suit their needs.
60+
61+
7. **Bandwidth Usage Graph**: Clients can view bandwidth usage graphs for intervals spanning 24 hours, a week, a month, and a year.
62+
63+
## Installation
64+
65+
### Downloading and Uploading to WHMCS
66+
67+
1. Obtain the module from our GitHub repository.
68+
2. Unpack the module on your local system and transfer the "upCloudVps" folder to your WHMCS directory named "/path-to-your-WHMCS/modules/servers/" on your WHMCS installation.
69+
70+
### Obtaining API Credentials
71+
72+
1. Access the UpCloud Hub at https://hub.upcloud.com and log in using your credentials.
73+
2. Navigate to the "People" section from the left sidebar.
74+
3. Proceed to create a sub-account by selecting the "Create subaccount" button.
75+
4. Enter a username, password, and complete other required details (Personal Information), then click "Create subaccount" at the bottom.
76+
5. After creating the user, click on "Edit", then navigate to the Permissions section and click on "Go to permissions".
77+
6. Enable all permissions except "Control Panel" and save the changes.
78+
79+
80+
81+
### Creating Your First WHMCS Server
82+
83+
Reference: https://docs.whmcs.com/Servers
84+
85+
1. Log in to your WHMCS as an admin user and go to Configuration > System Settings > Servers.
86+
2. Select "Add New Server" and choose "UpCloud VPS" from the module dropdown.
87+
3. Enter the Hostname or IP Address as: api.upcloud.com (you can assign any name).
88+
4. For Username, input your API username created in the previous step.
89+
5. For Password, input your API password created in the previous step.
90+
6. Proceed by clicking on "Test Connection" or "Continue Anyway".
91+
92+
### Creating a Server Group
93+
94+
1. Click Create New Group under the Options heading.
95+
2. Enter a name for your group.
96+
3. Select the servers you want to assign (previously created) to this group in the box on the left.
97+
4. Click Add to move them to the box on the right, which contains the servers for this group.
98+
5. Click Save Changes to complete the process.
99+
100+
## Configuration
101+
102+
### Creating a Product Group
103+
104+
1. Navigate to Configuration > System Settings > Product/Services
105+
106+
![Producs & Services](images/products_services.png)
107+
108+
109+
2. Click on Create Product Group
110+
111+
![Product Group](images/product_group.png)
112+
113+
114+
3. Provide a Product Group name and adjust all other settings based on your requirements
115+
116+
![Product Config](images/product_config.png)
117+
118+
4. Click on Save Changes
119+
120+
121+
### Creating a New Product
122+
123+
1. Click on Create a New Product
124+
125+
![New Product](images/new_product.png)
126+
2. Configure the following details:
127+
- **Product Type**: Select as "Other"
128+
- **Product Group**: Select the product group that you created
129+
- **Product Name**: Provide your product name
130+
- **Module**: UpCloud VPS
131+
- **Create as Hidden**: Off
132+
3. Click on Save Changes
133+
134+
### Module Settings
135+
136+
On the next page:
137+
1. Verify the Product Type
138+
2. Set Welcome Email to "Dedicated/VPS Server Welcome Email"
139+
3. Go to the Module Settings Tab
140+
4. Select the required details:
141+
- Module Name
142+
- Server group
143+
- Default Location
144+
- Plan
145+
- Template
146+
5. If for Plans you selected "Custom", then users will have the ability to choose their own CPU, RAM, and Storage space based on which VMs will be created.
147+
148+
![Server Plan Config](images/server_plan_config.png)
149+
150+
6. Decide whether the product requires manual approval from admins or is automatically deployed upon order.
151+
7. Click the Save Changes button.
152+
153+
![Server Plan Ready](images/server_plan_ready.png)
154+
155+
This will create custom fields named (`instanceId`, `ssh_key` & `userData`) as shown below:
156+
157+
![Custom Fields](images/custom_fields.png)
158+
159+
### Configurable Options
160+
161+
The module will automatically create Configurable Options when you create your first product. You can select option groups that apply to your product.
162+
163+
To adjust these options:
164+
165+
1. Go to System Settings -> Configurable Options
166+
2. Edit the newly created Options
167+
168+
![Configurable Options](images/configurable_options_normal.png)
169+
170+
Through these configurations you can:
171+
172+
- Set custom pricing for backup options
173+
- Configure available locations
174+
- Configure available custom plans
175+
- Adjust prices for available images (such as Windows)
176+
- Backup and Location: set custom pricing for backup options, and configure available locations
177+
178+
If custom plans are utilised:
179+
180+
- **Memory**: Users can choose the memory of a VPS, ranging from 4GB to 64GB.
181+
- **vCPU**: Users can choose the vCPU of a VPS, ranging from 2 cores to 24 cores.
182+
- **Storage**: Users can choose the storage of a VPS, ranging from 50GB to 460GB.
183+
184+
Note that custom plans are a discontinued feature. See the [UpCloud product documentation](https://upcloud.com/docs/products/cloud-servers/pricing/flexible-plans/) for more information.
185+
186+
## Adding Existing VPS to Users
187+
188+
To add an existing UpCloud VPS to a user's account:
189+
1. Edit the user's product
190+
2. Within the custom field named "Instance Id", add your VPS UUID that you can obtain from UpCloud Hub
191+
192+
![Existing VPS](images/existing_vps.png)
193+
194+
## Additional Configuration
195+
196+
### Product/Service -> Custom Fields
197+
198+
- **User Data/Cloud-init**: If provided by the user, these scripts will initiate after VM creation to kickstart the initialization process.
199+
- **SSH Key**: If supplied by the user during VM creation, it will be utilized for user authentication instead of a password; otherwise, the system will default to using a password for authentication. Note that some templates only support SSH keys.
200+
- **Instance Id**: This field is used to assign a user with a VPS
201+
202+
## Cron Job Setup
203+
204+
The administrator must schedule cron jobs to run every 5 minutes to generate bandwidth usage graphs. This is essential for the bandwidth monitoring feature to work properly.
205+
206+
![Bandwidth](images/bandwidth.png)

docs/images/bandwidth.png

60.1 KB
Loading
69.2 KB
Loading

docs/images/custom_fields.png

94.2 KB
Loading

docs/images/existing_vps.png

31.7 KB
Loading

docs/images/new_product.png

91.7 KB
Loading

docs/images/product_config.png

344 KB
Loading

docs/images/product_group.png

95.1 KB
Loading

docs/images/products_services.png

251 KB
Loading

0 commit comments

Comments
 (0)