Skip to content
This repository has been archived by the owner on Apr 8, 2023. It is now read-only.

Commit

Permalink
Update documentation / Origanised it and added new infor regarding 1.…
Browse files Browse the repository at this point in the history
…4 release features and often asked questions
  • Loading branch information
jaapmarcus committed May 23, 2021
1 parent 1f7a09c commit 361f5bc
Show file tree
Hide file tree
Showing 20 changed files with 805 additions and 480 deletions.
14 changes: 8 additions & 6 deletions admin_docs.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,14 @@ Admin Documentation
#######################################

.. toctree::
:maxdepth: 3
:maxdepth: 2
:glob:

admin_docs/server_management.rst
admin_docs/web.rst
admin_docs/dns.rst
admin_docs/mail.rst
admin_docs/database.rst
admin_docs/cron.rst
admin_docs/backups.rst
admin_docs/ssl_certificates.rst
admin_docs/user_management.rst
admin_docs/filemanager.rst
admin_docs/rest_api.rst
admin_docs/settings.rst
admin_docs/api.rst
106 changes: 106 additions & 0 deletions admin_docs/api.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
##################################
Rest Api
##################################

The Hestia WEB API is available to perform core functions of the Control Panel. We use it internaly to synchronyze DNS clusters, to integrate WHMCS billing system The API can be used as well to create new user accounts, domains, databases or even to build an alternative web interface.

This reference provides php code samples demonstrating how you can seamlessly integrate API into your application or script. However you can use other languages to communicate with API.

.. toctree::
:maxdepth: 2
:glob:

api/rest_api.rst

************************************************
Unable to connect to the api
************************************************

With the release of 1.4 Hestia has decided it was needed to tighten the security. If you connect from a remote server to the api. You are required to enter the ip address into the white. By default 127.0.0.1 is always allowed. If you need multiple ip addresses separate them with an enter.

.. image:: ../images/api/api-1.png
:width: 600px
:align: center
:height: 376px
:alt: Api settings

************************************************
Can I disable the api
************************************************

Disable the api via the settings. The file will be deleted from the server and all connections will get ignored. Please note some functions may not work without the api enabled.

************************************************
Return Codes
************************************************

.. list-table::
:header-rows: 1

* - VALUE
- NAME
- COMMENT
* - 0
- OK
- Command has been successfuly performed
* - 1
- E_ARGS
- Not enough arguments provided
* - 2
- E_INVALID
- Object or atgument is not valid
* - 3
- E_NOTEXIST
- Object doesn't exist
* - 4
- E_EXISTS
- Object already exists
* - 5
- E_SUSPENDED
- Object already exists
* - 6
- E_UNSUSPENDED
- Object is already unsuspended
* - 7
- E_INUSE
- Object can't be deleted because it is used by another object
* - 8
- E_LIMIT
- Object cannot be created because of hosting package limits
* - 9
- E_PASSWORD
- Wrong password
* - 10
- E_FORBIDEN
- Object cannot be accessed by this user
* - 11
- E_DISABLED
- Subsystem is disabled
* - 12
- E_PARSING
- Configuration is broken
* - 13
- E_DISK
- Not enough disk space to complete the action
* - 14
- E_LA
- Server is to busy to complete the action
* - 15
- E_CONNECT
- Connection failed. Host is unreachable
* - 16
- E_FTP
- FTP server is not responding
* - 17
- E_DB
- Database server is not responding
* - 18
- E_RRD
- RRDtool failed to update the database
* - 19
- E_UPDATE
- Update operation failed
* - 20
- E_RESTART
- Service restart failed

82 changes: 1 addition & 81 deletions admin_docs/rest_api.rst → admin_docs/api/rest_api.rst
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
##################################
REST API
Examples
##################################

The Hestia WEB API is available to perform core functions of the Control Panel. We use it internaly to synchronyze DNS clusters, to integrate WHMC billing system and to reset mail account passwords in Roundcube. The API can be used as well to create new user accounts, domains, databases or even to build an alternative web interface.

This reference provides php code samples demonstrating how you can seamlessly integrate API into your application or script. However you can use other languages to commmunicate with API.


************************************************
Create User Account
************************************************
Expand Down Expand Up @@ -648,78 +643,3 @@ Check Username and Password
.catch(function (error) {
console.log(error);
});

************************************************
Return Codes
************************************************

.. list-table::
:header-rows: 1

* - VALUE
- NAME
- COMMENT
* - 0
- OK
- Command has been successfuly performed
* - 1
- E_ARGS
- Not enough arguments provided
* - 2
- E_INVALID
- Object or atgument is not valid
* - 3
- E_NOTEXIST
- Object doesn't exist
* - 4
- E_EXISTS
- Object already exists
* - 5
- E_SUSPENDED
- Object already exists
* - 6
- E_UNSUSPENDED
- Object is already unsuspended
* - 7
- E_INUSE
- Object can't be deleted because it is used by another object
* - 8
- E_LIMIT
- Object cannot be created because of hosting package limits
* - 9
- E_PASSWORD
- Wrong password
* - 10
- E_FORBIDEN
- Object cannot be accessed by this user
* - 11
- E_DISABLED
- Subsystem is disabled
* - 12
- E_PARSING
- Configuration is broken
* - 13
- E_DISK
- Not enough disk space to complete the action
* - 14
- E_LA
- Server is to busy to complete the action
* - 15
- E_CONNECT
- Connection failed. Host is unreachable
* - 16
- E_FTP
- FTP server is not responding
* - 17
- E_DB
- Database server is not responding
* - 18
- E_RRD
- RRDtool failed to update the database
* - 19
- E_UPDATE
- Update operation failed
* - 20
- E_RESTART
- Service restart failed

36 changes: 36 additions & 0 deletions admin_docs/backups.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,42 @@
Backups / Restore
#############################

************************************************
How to move a user to a new server?
************************************************

The current restore function accept both VestaCP and HestiaCP generated backups

#. Make a user backup on the old server. In this example we will use username as the reference.

.. code-block:: bash
v-backup-user username
#. Copy tarball to the new server and place it in the /backup directory

.. code-block:: bash
scp /home/backup/username.2020.01.01-00-00.tar [email protected]:/backup/
#. Restore backup on the new server

.. code-block:: bash
v-restore-user username username.2020.01.01-00-00.tar
Want to restore a different user?

Use

.. code-block:: bash
v-restore-user newusername username.2020.01.01-00-00.tar
User accounts that don not exist will be created.



************************************************
What kind of backups are able to be restored
************************************************
Expand Down
9 changes: 9 additions & 0 deletions admin_docs/cron.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#####################
Cronjobs
#####################

*****************************************
Can I update my cronjobs via crontab -e?
*****************************************

No currently HestiaCP overwrites every time we upgrade or you restore the user account the crontab -e page. Also changes will not get saved in backups.
47 changes: 47 additions & 0 deletions admin_docs/database.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
###############################
Database
###############################

************************************************
How to setup a remote database server
************************************************

#. It is assumed you already have your second server up and running
#. On your Hestia Server run the following command

.. code-block:: bash
v-add-database-host mysql new-server.com root password
Mysql maybe replaced by the PostgreSQL

#. To make sure database has been added run following command

.. code-block:: bash
v-list-database-hosts
***************************************************************
Why I can't use :samp:`http://ip/phpmyadmin/`
***************************************************************

For security reason we have decided to disable this option

Please use :samp:`https://host.domain.tld/phpmyadmin/`


***************************************************************
How can I connect from a remote location to the database
***************************************************************

By default connections are disabled open port 3306 in the firewall. Open port 3306 in the firewall

.. image:: ../images/ipset/ipset-3.png
:width: 350
:align: center
:height: 391px
:alt: Add Firewall rule

Then edit /etc/mysql/mariadb.conf.d/50-server.cnf

And set bind-address = 0.0.0.0 or bind-address = "your.server.ip.address"
48 changes: 48 additions & 0 deletions admin_docs/dns.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
###############################
DNS Management / DNS server
###############################

************************************************
How to setup a DNS Cluster
************************************************

If you are looking for the options to minimize DNS-related downtime or the way to manage dns across all server you have, you might consider to set up dns cluster.

#. Create user **dns-cluster** on a server which will be used as dns slave
#. Run following command on a master

.. code-block:: bash
v-add-remote-dns-host slave.yourhost.com 8083 admin p4sw0rd
Password and host name should be replaced with relevant data of course.

Alternatively you can run on the slave server the following command

.. code-block:: bash
v-generate-api-key
This will generate an API key. Replace the username "admin" with the generated key. This will keep the ability to change the admin password without issues in the future.

.. code-block:: bash
v-add-remote-dns-host slave.yourhost.com 8083 api_key
This way you can set up master->slave or master-master-master cluster. There is no limitation on how to chain dns servers.

************************************************
Can I seperate DNS accounts by users
************************************************

Yes you can just supply the user varibale behind the command.

.. code-block:: bash
v-add-remote-dns-host slave.yourhost.com 8083 admin p4sw0rd useraccount
Or

.. code-block:: bash
v-add-remote-dns-host slave.yourhost.com 8083 api_key '' useraccount
Loading

0 comments on commit 361f5bc

Please sign in to comment.