diff --git a/document_roots/webhost/api_testing.html b/document_roots/webhost/api_testing.html new file mode 100644 index 0000000..a3278a7 --- /dev/null +++ b/document_roots/webhost/api_testing.html @@ -0,0 +1,84 @@ + + + + Private Test + + + +
+ + + + + + + + + + + + + + + + + + + +
gPanel Login
Username:
Password:
+
+ +
+ + + + + + + + + + + + + + + + + + + +
gPanel Registration
Username:
Password:
+
+ + + + diff --git a/document_roots/webhost/gPanel.html b/document_roots/webhost/gPanel.html deleted file mode 100644 index 2fbd0d8..0000000 --- a/document_roots/webhost/gPanel.html +++ /dev/null @@ -1,547 +0,0 @@ - - - - gPanel - Home - - - - - - - - - - - - - -
-
-
-
- -
- -
-
Basic WebHost Manager Setup
-
Change Root Password
-
Configure ePanel Cron Jobs
-
Initial Quota Setup
-
Server Time
-
Statistics Software Configuration
-
Tweak Settings
-
Update Preferences
-
-
- -
-
-

- Support -

-
-
-
Create Support Ticket
-
Grant gPanel Support Access
-
Support Center
-
-
- -
- -
-
Change Hostname
-
Resolver Configuration
-
-
- -
-
-

- Security Center -

-
-
-
Apache mod_userdir Tweak
-
Compiler Access
-
Configure Security Policies
-
cPHulk Brute Force Protection
-
Host Access Control
-
Manage External Authentications
-
Manage root’s SSH Keys
-
Manage Wheel Group Users
-
ModSecurity™ Configuration
-
ModSecurity™ Tools
-
ModSecurity™ Vendors
-
Password Strength Configuration
-
PHP open_basedir Tweak
-
cPanel Security Advisor
-
Security Questions
-
Shell Fork Bomb Protection
-
SMTP Restrictions
-
SSH Password Authorization Tweak
-
Traceroute Enable/Disable
-
Two-Factor Authentication
-
-
- -
-
-

- Server Contacts -

-
-
-
Contact Manager
-
Edit System Mail Preferences
-
-
- -
-
-

- Reseller -

-
-
-
Change Ownership of an Account
-
Change Ownership of Multiple Accounts
-
Edit Reseller Nameservers and Privileges
-
Email All Resellers
-
Manage Reseller’s IP Delegation
-
Manage Reseller’s Shared IP
-
Reseller Center
-
Reset Resellers
-
Show Reseller Accounts
-
View Reseller Usage and Manage Account Status
-
-
- -
-
-

- Locales -

-
-
-
Configure Application Locales
-
Copy a Locale
-
Delete a Locale
-
Edit a Locale
-
Locale XML Download
-
Locale XML Upload
-
View Available Locales
-
-
- -
-
-

- Backup -

-
-
-
Backup Configuration
-
Backup Restoration
-
Backup User Selection
-
Configuration File Rollback
-
Legacy Backup Configuration
-
Legacy Restore Backups
-
Legacy Restore Multiple Backups
-
Restore a Full Backup/cpmove File
-
-
- - -
-
-

- Clusters -

-
-
-
Configuration Cluster
-
DNS Cluster
-
Remote Access Key
-
-
- - -
-
-

- System Reboot -

-
-
-
Forceful Server Reboot
-
Graceful Server Reboot
-
-
- -
-
-

- Server Status -

-
-
-
Apache Status
-
Daily Process Log
-
Server Information
-
Service Status
-
-
- -
- -
-
List Accounts
-
List Parked Domains
-
List Subdomains
-
Suspended Accounts
-
Show Accounts Over Quota
-
View Bandwidth Usage
-
-
- -
- -
-
Change Site’s IP Address
-
Create a New Account
-
Email All Users
-
Force Password Change
-
Limit Bandwidth Usage
-
Manage Account Suspension
-
Manage Demo Mode
-
Manage Shell Access
-
Modify an Account
-
Password Modification
-
Quota Modification
-
Raw Apache Log Download
-
Raw FTP Log Download
-
Rearrange an Account
-
Reset Account Bandwidth Limit
-
Show Active and Inactive Accounts
-
Skeleton Directory
-
Terminate Accounts
-
Unsuspend Bandwidth Exceeders
-
Upgrade/Downgrade an Account
-
Web Template Editor
-
-
- -
- -
-
Change Multiple Sites’ IP Addresses
-
Modify/Upgrade Multiple Accounts
-
-
- -
-
-

- Transfers -

-
-
-
Convert Addon Domain to Account
-
Copy an Account From Another Server With an Account Password
-
Review Transfers and Restores
-
Transfer Tool
-
-
- -
-
-

- Themes -

-
-
-
Change WebHost Manager® Theme
-
Theme Manager
-
-
- -
-
-

- Packages -

-
-
-
Add a Package
-
Delete a Package
-
Edit a Package
-
Feature Manager
-
-
- -
-
-

- DNS Functions -

-
-
-
Add a DNS Zone
-
Add an A Entry for Your Hostname
-
DNS Zone Removal
-
DNS Zone Editor
-
MX Entry Editor
-
Edit Zone Templates
-
Nameserver Record Report
-
Park a Domain
-
Perform a DNS Cleanup
-
Reset a DNS Zone
-
Set Zone Time To Live (TTL)
-
Setup/Edit Domain Forwarding
-
Synchronize DNS Records
-
-
- -
-
-

- SQL Services -

-
-
-
Additional MySQL Access Hosts
-
Change MySQL User Password
-
Database Map Tool
-
Manage Database Users
-
Manage Databases
-
Manage MySQL® Profiles
-
MySQL Root Password
-
phpMyAdmin
-
Repair a MySQL Database
-
Show MySQL Processes
-
-
- -
-
-

- IP Functions -

-
-
-
Add a New IP Address
-
Assign IPv6 Address
-
Change a Site’s IP Address
-
Configure Remote Service IPs
-
IP Migration Wizard
-
IPv6 Address Ranges
-
Rebuild the IP Address Pool
-
Show IP Address Usage
-
Show or Delete Current IP Addresses
-
Show/Edit Reserved IPs
-
-
- -
-
-

- Software -

-
-
-
EasyApache 4
-
Install a Perl Module
-
Install an RPM
-
Module Installers
-
MultiPHP INI Editor
-
MultiPHP Manager
-
MySQL/MariaDB Upgrade
-
Rebuild RPM Database
-
System Update
-
Update Server Software
-
-
- -
-
-

- Email -

-
-
-
Greylisting
-
Mail Delivery Reports
-
Mail Queue Manager
-
Mail Troubleshooter
-
Mailbox Conversion
-
Repair Mailbox Permissions
-
Spamd Startup Configuration
-
View Mail Statistics Summary
-
View Relayers
-
View Sent Summary
-
-
- -
-
-

- System Health -

-
-
-
Background Process Killer
-
Process Manager
-
Show Current Disk Usage
-
Show Current Running Processes
-
-
- -
-
-

- cPanel -

-
-
-
Customization
-
Install cPAddons Site Software
-
Manage cPAddons Site Software
-
Manage Plugins
-
Modify cPanel & WHM News
-
Reset a Mailman Password
-
Synchronize FTP Passwords
-
Upgrade to Latest Version
-
-
- -
-
-

- SSL/TLS -

-
-
-
Generate an SSL Certificate and Signing Request
-
Install an SSL Certificate on a Domain
-
Manage AutoSSL
-
Manage SSL Hosts
-
Purchase and Install an SSL Certificate
-
SSL Storage Manager
-
-
- -
-
-

- Market -

-
-
-
Market Provider Manager
-
-
- -
- -
-
DNS Server
-
FTP Server (ProFTPd/PureFTPd)
-
HTTP Server (Apache)
-
IMAP Server
-
Mail Server (Exim)
-
Mailing List Manager (Mailman)
-
PHP-FPM service for Apache
-
SQL Server (MySQL)
-
SSH Server (OpenSSH)
-
-
- -
-
-

- Development -

-
-
-
Apps Managed by AppConfig
-
cPanel Developement Forum
-
cPanel Plugin File Generator
-
Manage Hooks
-
Software Development Kit
-
-
- -
-
-
-

Help Wanted

-
-

Help Wanted

-
-

Help Wanted

-
-

Help Wanted

-
-
Help Wanted
-
-
Help Wanted
-
-
-
- - - - - - - - diff --git a/document_roots/webhost/index.html b/document_roots/webhost/index.html index 5f2cad4..2fbd0d8 100644 --- a/document_roots/webhost/index.html +++ b/document_roots/webhost/index.html @@ -1,84 +1,547 @@ - + - Private Test - + gPanel - Home + + + + + + + + + -
- - - - - - - - - - - - - - - - - - - -
gPanel Login
Username:
Password:
-
+ -
- - - - - - - - - - - - - - - - - - - -
gPanel Registration
Username:
Password:
-
+
+
+
+
- +
+
+

+ Server Contacts +

+
+
+
Contact Manager
+
Edit System Mail Preferences
+
+
+ +
+
+

+ Reseller +

+
+
+
Change Ownership of an Account
+
Change Ownership of Multiple Accounts
+
Edit Reseller Nameservers and Privileges
+
Email All Resellers
+
Manage Reseller’s IP Delegation
+
Manage Reseller’s Shared IP
+
Reseller Center
+
Reset Resellers
+
Show Reseller Accounts
+
View Reseller Usage and Manage Account Status
+
+
+ +
+
+

+ Locales +

+
+
+
Configure Application Locales
+
Copy a Locale
+
Delete a Locale
+
Edit a Locale
+
Locale XML Download
+
Locale XML Upload
+
View Available Locales
+
+
+ +
+
+

+ Backup +

+
+
+
Backup Configuration
+
Backup Restoration
+
Backup User Selection
+
Configuration File Rollback
+
Legacy Backup Configuration
+
Legacy Restore Backups
+
Legacy Restore Multiple Backups
+
Restore a Full Backup/cpmove File
+
+
+ + +
+
+

+ Clusters +

+
+
+
Configuration Cluster
+
DNS Cluster
+
Remote Access Key
+
+
+ + +
+
+

+ System Reboot +

+
+
+
Forceful Server Reboot
+
Graceful Server Reboot
+
+
+ +
+
+

+ Server Status +

+
+
+
Apache Status
+
Daily Process Log
+
Server Information
+
Service Status
+
+
+ +
+ +
+
List Accounts
+
List Parked Domains
+
List Subdomains
+
Suspended Accounts
+
Show Accounts Over Quota
+
View Bandwidth Usage
+
+
+ +
+ +
+
Change Site’s IP Address
+
Create a New Account
+
Email All Users
+
Force Password Change
+
Limit Bandwidth Usage
+
Manage Account Suspension
+
Manage Demo Mode
+
Manage Shell Access
+
Modify an Account
+
Password Modification
+
Quota Modification
+
Raw Apache Log Download
+
Raw FTP Log Download
+
Rearrange an Account
+
Reset Account Bandwidth Limit
+
Show Active and Inactive Accounts
+
Skeleton Directory
+
Terminate Accounts
+
Unsuspend Bandwidth Exceeders
+
Upgrade/Downgrade an Account
+
Web Template Editor
+
+
+ +
+ +
+
Change Multiple Sites’ IP Addresses
+
Modify/Upgrade Multiple Accounts
+
+
+ +
+
+

+ Transfers +

+
+
+
Convert Addon Domain to Account
+
Copy an Account From Another Server With an Account Password
+
Review Transfers and Restores
+
Transfer Tool
+
+
+ +
+
+

+ Themes +

+
+
+
Change WebHost Manager® Theme
+
Theme Manager
+
+
+ +
+
+

+ Packages +

+
+
+
Add a Package
+
Delete a Package
+
Edit a Package
+
Feature Manager
+
+
+ +
+
+

+ DNS Functions +

+
+
+
Add a DNS Zone
+
Add an A Entry for Your Hostname
+
DNS Zone Removal
+
DNS Zone Editor
+
MX Entry Editor
+
Edit Zone Templates
+
Nameserver Record Report
+
Park a Domain
+
Perform a DNS Cleanup
+
Reset a DNS Zone
+
Set Zone Time To Live (TTL)
+
Setup/Edit Domain Forwarding
+
Synchronize DNS Records
+
+
+ +
+
+

+ SQL Services +

+
+
+
Additional MySQL Access Hosts
+
Change MySQL User Password
+
Database Map Tool
+
Manage Database Users
+
Manage Databases
+
Manage MySQL® Profiles
+
MySQL Root Password
+
phpMyAdmin
+
Repair a MySQL Database
+
Show MySQL Processes
+
+
+ +
+
+

+ IP Functions +

+
+
+
Add a New IP Address
+
Assign IPv6 Address
+
Change a Site’s IP Address
+
Configure Remote Service IPs
+
IP Migration Wizard
+
IPv6 Address Ranges
+
Rebuild the IP Address Pool
+
Show IP Address Usage
+
Show or Delete Current IP Addresses
+
Show/Edit Reserved IPs
+
+
+ +
+
+

+ Software +

+
+
+
EasyApache 4
+
Install a Perl Module
+
Install an RPM
+
Module Installers
+
MultiPHP INI Editor
+
MultiPHP Manager
+
MySQL/MariaDB Upgrade
+
Rebuild RPM Database
+
System Update
+
Update Server Software
+
+
+ +
+
+

+ Email +

+
+
+
Greylisting
+
Mail Delivery Reports
+
Mail Queue Manager
+
Mail Troubleshooter
+
Mailbox Conversion
+
Repair Mailbox Permissions
+
Spamd Startup Configuration
+
View Mail Statistics Summary
+
View Relayers
+
View Sent Summary
+
+
+ +
+
+

+ System Health +

+
+
+
Background Process Killer
+
Process Manager
+
Show Current Disk Usage
+
Show Current Running Processes
+
+
+ +
+
+

+ cPanel +

+
+
+
Customization
+
Install cPAddons Site Software
+
Manage cPAddons Site Software
+
Manage Plugins
+
Modify cPanel & WHM News
+
Reset a Mailman Password
+
Synchronize FTP Passwords
+
Upgrade to Latest Version
+
+
+ +
+
+

+ SSL/TLS +

+
+
+
Generate an SSL Certificate and Signing Request
+
Install an SSL Certificate on a Domain
+
Manage AutoSSL
+
Manage SSL Hosts
+
Purchase and Install an SSL Certificate
+
SSL Storage Manager
+
+
+ +
+
+

+ Market +

+
+
+
Market Provider Manager
+
+
+ +
+ +
+
DNS Server
+
FTP Server (ProFTPd/PureFTPd)
+
HTTP Server (Apache)
+
IMAP Server
+
Mail Server (Exim)
+
Mailing List Manager (Mailman)
+
PHP-FPM service for Apache
+
SQL Server (MySQL)
+
SSH Server (OpenSSH)
+
+
+ +
+
+

+ Development +

+
+
+
Apps Managed by AppConfig
+
cPanel Developement Forum
+
cPanel Plugin File Generator
+
Manage Hooks
+
Software Development Kit
+
+
+ +
+
+
+

Help Wanted

+
+

Help Wanted

+
+

Help Wanted

+
+

Help Wanted

+
+
Help Wanted
+
+
Help Wanted
+
+
+
+ + + + + + diff --git a/pkg/api/README.md b/pkg/api/README.md index dede893..729c649 100644 --- a/pkg/api/README.md +++ b/pkg/api/README.md @@ -1,8 +1,23 @@ -# A list of API calls +# Working API Calls -``` +```go +// User Authentication API - pkg/api/user_auth.go +/* +JSON Data Required: + { + "user": "test", + "pass": "test", + } +*/ func UserAuthentication(res http.ResponseWriter, req *http.Request) bool +// User Registration API - pkg/api/user_auth.go +/* +JSON Data Required: + { + "user": "test", + "pass": "test", + } +*/ func UserRegistration(res http.ResponseWriter, req *http.Request) bool ``` - diff --git a/pkg/api/api_handler.go b/pkg/api/api_handler.go index 0d09820..f969709 100644 --- a/pkg/api/api_handler.go +++ b/pkg/api/api_handler.go @@ -14,9 +14,9 @@ func HandleAPI(path string, res http.ResponseWriter, req *http.Request) (bool, b suspectApi := strings.ToLower(splitUrl[len(splitUrl)-1]) switch suspectApi { - case "authentication": + case "user_auth": return true, UserAuthentication(res, req) - case "registration": + case "user_register": return true, UserRegistration(res, req) default: return false, false diff --git a/pkg/api/user.go b/pkg/api/user.go index 74ef509..760eae9 100644 --- a/pkg/api/user.go +++ b/pkg/api/user.go @@ -23,7 +23,8 @@ var userDatabaseData struct { } // UserAuthentication function is accessed by an API call from the webhost root -// by accessing /authentication and sending it a post request with +// by accessing /user_auth and sending it a post request with userRequestData +// struct in JSON format. func UserAuthentication(res http.ResponseWriter, req *http.Request) bool { if req.Method != "POST" { http.Error(res, req.Method+" HTTP method is unsupported for this API.", http.StatusMethodNotAllowed) @@ -60,8 +61,9 @@ func UserAuthentication(res http.ResponseWriter, req *http.Request) bool { return true } -// UserAuthentication function is accessed by an API call from the webhost root -// by accessing /authentication and sending it a post request with +// UserRegistration function is accessed by an API call from the webhost root +// by accessing /user_register and sending it a post request with userRequestData +// struct in JSON format. func UserRegistration(res http.ResponseWriter, req *http.Request) bool { if req.Method != "POST" { http.Error(res, req.Method+" HTTP method is unsupported for this API.", http.StatusMethodNotAllowed)