|
@@ -1,20 +1,132 @@
|
|
|
# Contributing to Hestia’s development
|
|
# Contributing to Hestia’s development
|
|
|
|
|
|
|
|
-[View the current guidelines](https://github.com/hestiacp/hestiacp/blob/main/CONTRIBUTING.md).
|
|
|
|
|
|
|
+Hestia is an open-source project, and we welcome contributions from the community. Please read the [contributing guidelines](https://github.com/hestiacp/hestiacp/blob/main/CONTRIBUTING.md) for additional information.
|
|
|
|
|
+
|
|
|
|
|
+Hestia is designed to run on a web server. To develop Hestia locally, we recommend using a virtual machine.
|
|
|
|
|
|
|
|
::: warning
|
|
::: warning
|
|
|
-Development builds are always unstable. If you encounter a bug please [report it via GitHub](https://github.com/hestiacp/hestiacp/issues/new/choose) or [submit a Pull request](https://github.com/hestiacp/hestiacp/pulls).
|
|
|
|
|
|
|
+Development builds are unstable. If you encounter a bug please [report it via GitHub](https://github.com/hestiacp/hestiacp/issues/new/choose) or [submit a Pull request](https://github.com/hestiacp/hestiacp/pulls).
|
|
|
|
|
+:::
|
|
|
|
|
+
|
|
|
|
|
+## Running Hestia in a virtual machine
|
|
|
|
|
+
|
|
|
|
|
+Here are example instructions for running Hestia for development in a virtual machine.
|
|
|
|
|
+
|
|
|
|
|
+These instructions use [Multipass](https://multipass.run/) to create the VM. Feel free to adapt the commands for any virtualization software you prefer.
|
|
|
|
|
+
|
|
|
|
|
+1. [Install Multipass](https://multipass.run/install) for your OS.
|
|
|
|
|
+
|
|
|
|
|
+1. [Fork Hestia](https://github.com/hestiacp/hestiacp/fork) and clone the repository to your local machine
|
|
|
|
|
+
|
|
|
|
|
+ ```bash
|
|
|
|
|
+ git clone https://github.com/YourUsername/hestiacp.git $HOME/projects
|
|
|
|
|
+ ```
|
|
|
|
|
+
|
|
|
|
|
+1. Create an Ubuntu VM with at least 2G of memory
|
|
|
|
|
+
|
|
|
|
|
+ ```bash
|
|
|
|
|
+ multipass launch --name hestia-dev --mem 2G
|
|
|
|
|
+ ```
|
|
|
|
|
+
|
|
|
|
|
+1. Map your cloned repository to the VM's home directory
|
|
|
|
|
+
|
|
|
|
|
+ ```bash
|
|
|
|
|
+ multipass mount $HOME/projects/hestiacp hestia-dev:/home/ubuntu/hestiacp
|
|
|
|
|
+ ```
|
|
|
|
|
+
|
|
|
|
|
+1. SSH into the VM as root and install some required packages
|
|
|
|
|
+
|
|
|
|
|
+ ```bash
|
|
|
|
|
+ multipass exec hestiacp-dev -- sudo bash
|
|
|
|
|
+ sudo apt update && sudo apt install -y jq libjq1
|
|
|
|
|
+ ```
|
|
|
|
|
+
|
|
|
|
|
+1. Navigate to `/src` and build Hestia packages
|
|
|
|
|
+
|
|
|
|
|
+ ```bash
|
|
|
|
|
+ cd src
|
|
|
|
|
+ ./hst_autocompile.sh --hestia --noinstall --keepbuild '~localsrc'
|
|
|
|
|
+ ```
|
|
|
|
|
+
|
|
|
|
|
+1. Navigate to `/install` and install Hestia
|
|
|
|
|
+
|
|
|
|
|
+ _(update the [installation flags](../introduction/getting-started#list-of-installation-options) to your liking, note that login credentials are set here)_
|
|
|
|
|
+
|
|
|
|
|
+ ```bash
|
|
|
|
|
+ cd ../install
|
|
|
|
|
+ bash hst-install.sh -D /tmp/hestiacp-src/deb/ --interactive no --email admin@example.com --password password123 --hostname demo.hestiacp.com -f
|
|
|
|
|
+ ```
|
|
|
|
|
+
|
|
|
|
|
+1. Reboot VM (and exit SSH session)
|
|
|
|
|
+
|
|
|
|
|
+ ```bash
|
|
|
|
|
+ reboot
|
|
|
|
|
+ ```
|
|
|
|
|
+
|
|
|
|
|
+1. Find the IP address of the VM
|
|
|
|
|
+
|
|
|
|
|
+ ```bash
|
|
|
|
|
+ multipass list
|
|
|
|
|
+ ```
|
|
|
|
|
+
|
|
|
|
|
+1. Visit the VM's IP address in your browser using the default Hestia port, bypass any SSL warnings and login with `admin`/`password123`
|
|
|
|
|
+
|
|
|
|
|
+ ```bash
|
|
|
|
|
+ e.g. https://192.168.64.15:8083
|
|
|
|
|
+ ```
|
|
|
|
|
+
|
|
|
|
|
+You now have Hestia running in a virtual machine. The following section will cover how to make changes to Hestia and test them locally.
|
|
|
|
|
+
|
|
|
|
|
+## Making changes to Hestia
|
|
|
|
|
+
|
|
|
|
|
+After setting up Hestia in a VM you can now make changes to the source code in `$HOME/projects/hestiacp` on your local machine using your editor of choice.
|
|
|
|
|
+
|
|
|
|
|
+The following are example instructions for making a change to Hestia's UI and testing it locally.
|
|
|
|
|
+
|
|
|
|
|
+::: info
|
|
|
|
|
+Please ensure you have [Yarn](https://yarnpkg.com) v3 installed and are using [Node.js](https://nodejs.org/en/) v16 or higher.
|
|
|
:::
|
|
:::
|
|
|
|
|
|
|
|
-## Compiling
|
|
|
|
|
|
|
+1. At the root of the project on your local machine, install Node dependencies
|
|
|
|
|
+
|
|
|
|
|
+ ```bash
|
|
|
|
|
+ yarn install
|
|
|
|
|
+ ```
|
|
|
|
|
+
|
|
|
|
|
+1. Make a change to a file that we can later test, then build the UI assets
|
|
|
|
|
+
|
|
|
|
|
+ _e.g. change the body background color to red in `web/css/src/base.css` then run:_
|
|
|
|
|
+
|
|
|
|
|
+ ```bash
|
|
|
|
|
+ yarn build
|
|
|
|
|
+ ```
|
|
|
|
|
+
|
|
|
|
|
+1. SSH into the VM as root and navigate to `/src`
|
|
|
|
|
+
|
|
|
|
|
+ ```bash
|
|
|
|
|
+ multipass exec hestia-dev -- sudo bash
|
|
|
|
|
+ cd src
|
|
|
|
|
+ ```
|
|
|
|
|
+
|
|
|
|
|
+1. Run the Hestia build script
|
|
|
|
|
+
|
|
|
|
|
+ ```bash
|
|
|
|
|
+ ./hst_autocompile.sh --hestia --install '~localsrc'
|
|
|
|
|
+ ```
|
|
|
|
|
+
|
|
|
|
|
+1. Reload the page in your browser to see your changes
|
|
|
|
|
+
|
|
|
|
|
+Please refer to the [contributing guidelines](https://github.com/hestiacp/hestiacp/blob/main/CONTRIBUTING.md) for more details on submitting code changes for review.
|
|
|
|
|
+
|
|
|
|
|
+### Building packages
|
|
|
|
|
|
|
|
::: info
|
|
::: info
|
|
|
For building `hestia-nginx` or `hestia-php`, at least 2 GB of memory is required!
|
|
For building `hestia-nginx` or `hestia-php`, at least 2 GB of memory is required!
|
|
|
:::
|
|
:::
|
|
|
|
|
|
|
|
-Go into the `src` folder and run one of these commands:
|
|
|
|
|
|
|
+Here is more detailed information about the build scripts that are run from `src`:
|
|
|
|
|
|
|
|
-### Compile only
|
|
|
|
|
|
|
+#### Build packages only
|
|
|
|
|
|
|
|
```bash
|
|
```bash
|
|
|
# Only Hestia
|
|
# Only Hestia
|
|
@@ -26,10 +138,10 @@ Go into the `src` folder and run one of these commands:
|
|
|
./hst_autocompile.sh --all --noinstall --keepbuild '~localsrc'
|
|
./hst_autocompile.sh --all --noinstall --keepbuild '~localsrc'
|
|
|
```
|
|
```
|
|
|
|
|
|
|
|
-### Compile and install
|
|
|
|
|
|
|
+#### Build and install packages
|
|
|
|
|
|
|
|
::: info
|
|
::: info
|
|
|
-Use this only if you have Hestia already installed.
|
|
|
|
|
|
|
+Use if you have Hestia already installed, for your changes to take effect.
|
|
|
:::
|
|
:::
|
|
|
|
|
|
|
|
```bash
|
|
```bash
|
|
@@ -42,7 +154,9 @@ Use this only if you have Hestia already installed.
|
|
|
./hst_autocompile.sh --all --install '~localsrc'
|
|
./hst_autocompile.sh --all --install '~localsrc'
|
|
|
```
|
|
```
|
|
|
|
|
|
|
|
-## Install Hestia from packages
|
|
|
|
|
|
|
+## Installing Hestia from a branch
|
|
|
|
|
+
|
|
|
|
|
+The following is useful for testing a Pull Request or a branch on a fork.
|
|
|
|
|
|
|
|
```bash
|
|
```bash
|
|
|
# Replace with https://github.com/username/hestiacp.git if you want to test a branch that you created yourself
|
|
# Replace with https://github.com/username/hestiacp.git if you want to test a branch that you created yourself
|
|
@@ -64,7 +178,9 @@ bash hst-install-{os}.sh --with-debs /tmp/hestiacp-src/deb/
|
|
|
|
|
|
|
|
Any option can be appended to the installer command. [See the complete list](../introduction/getting-started#list-of-installation-options).
|
|
Any option can be appended to the installer command. [See the complete list](../introduction/getting-started#list-of-installation-options).
|
|
|
|
|
|
|
|
-## Update Hestia from GitHub
|
|
|
|
|
|
|
+## Updating Hestia from GitHub
|
|
|
|
|
+
|
|
|
|
|
+The following is useful for pulling the latest staging/beta changes from GitHub and compiling the changes.
|
|
|
|
|
|
|
|
::: info
|
|
::: info
|
|
|
The following method only supports building the `hestia` package. If you need to build `hestia-nginx` or `hestia-php`, use one of the previous commands.
|
|
The following method only supports building the `hestia` package. If you need to build `hestia-nginx` or `hestia-php`, use one of the previous commands.
|
|
@@ -74,7 +190,7 @@ The following method only supports building the `hestia` package. If you need to
|
|
|
v-update-sys-hestia-git [USERNAME] [BRANCH]
|
|
v-update-sys-hestia-git [USERNAME] [BRANCH]
|
|
|
```
|
|
```
|
|
|
|
|
|
|
|
-Sometimes dependencies will get added or removed when the packages are installed with `dpkg`. It is not possible to preload the dependencies. If this happens, you will see an error like:
|
|
|
|
|
|
|
+**Note:** Sometimes dependencies will get added or removed when the packages are installed with `dpkg`. It is not possible to preload the dependencies. If this happens, you will see an error like this:
|
|
|
|
|
|
|
|
```bash
|
|
```bash
|
|
|
dpkg: error processing package hestia (–install):
|
|
dpkg: error processing package hestia (–install):
|
|
@@ -87,9 +203,9 @@ To solve this issue, run:
|
|
|
apt install -f
|
|
apt install -f
|
|
|
```
|
|
```
|
|
|
|
|
|
|
|
-## Automated testing
|
|
|
|
|
|
|
+## Running automated tests
|
|
|
|
|
|
|
|
-For automated testing, we currently use [Bats](https://github.com/bats-core/bats-core).
|
|
|
|
|
|
|
+For automated tests we currently use [Bats](https://github.com/bats-core/bats-core).
|
|
|
|
|
|
|
|
### Install
|
|
### Install
|
|
|
|
|
|