Skip to content

Commit 9d1ed02

Browse files
jaapmarcusAlecRust
andauthored
Update documentation development instructions (hestiacp#3098)
* Update documentation development instructions - Use yarn instead pnpm - Update command * Add VM and UI development instructions * Add links to yarnpkg.com and nodejs.org Co-authored-by: Alec Rust <me@alecrust.com>
1 parent 46a1e76 commit 9d1ed02

File tree

2 files changed

+132
-15
lines changed

2 files changed

+132
-15
lines changed

docs/docs/contributing/development.md

Lines changed: 128 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,132 @@
11
# Contributing to Hestia’s development
22

3-
[View the current guidelines](https://github.com/hestiacp/hestiacp/blob/main/CONTRIBUTING.md).
3+
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.
4+
5+
Hestia is designed to run on a web server. To develop Hestia locally, we recommend using a virtual machine.
46

57
::: warning
6-
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).
8+
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).
9+
:::
10+
11+
## Running Hestia in a virtual machine
12+
13+
Here are example instructions for running Hestia for development in a virtual machine.
14+
15+
These instructions use [Multipass](https://multipass.run/) to create the VM. Feel free to adapt the commands for any virtualization software you prefer.
16+
17+
1. [Install Multipass](https://multipass.run/install) for your OS.
18+
19+
1. [Fork Hestia](https://github.com/hestiacp/hestiacp/fork) and clone the repository to your local machine
20+
21+
```bash
22+
git clone https://github.com/YourUsername/hestiacp.git $HOME/projects
23+
```
24+
25+
1. Create an Ubuntu VM with at least 2G of memory
26+
27+
```bash
28+
multipass launch --name hestia-dev --mem 2G
29+
```
30+
31+
1. Map your cloned repository to the VM's home directory
32+
33+
```bash
34+
multipass mount $HOME/projects/hestiacp hestia-dev:/home/ubuntu/hestiacp
35+
```
36+
37+
1. SSH into the VM as root and install some required packages
38+
39+
```bash
40+
multipass exec hestiacp-dev -- sudo bash
41+
sudo apt update && sudo apt install -y jq libjq1
42+
```
43+
44+
1. Navigate to `/src` and build Hestia packages
45+
46+
```bash
47+
cd src
48+
./hst_autocompile.sh --hestia --noinstall --keepbuild '~localsrc'
49+
```
50+
51+
1. Navigate to `/install` and install Hestia
52+
53+
_(update the [installation flags](../introduction/getting-started#list-of-installation-options) to your liking, note that login credentials are set here)_
54+
55+
```bash
56+
cd ../install
57+
bash hst-install.sh -D /tmp/hestiacp-src/deb/ --interactive no --email admin@example.com --password password123 --hostname demo.hestiacp.com -f
58+
```
59+
60+
1. Reboot VM (and exit SSH session)
61+
62+
```bash
63+
reboot
64+
```
65+
66+
1. Find the IP address of the VM
67+
68+
```bash
69+
multipass list
70+
```
71+
72+
1. Visit the VM's IP address in your browser using the default Hestia port, bypass any SSL warnings and login with `admin`/`password123`
73+
74+
```bash
75+
e.g. https://192.168.64.15:8083
76+
```
77+
78+
You now have Hestia running in a virtual machine. The following section will cover how to make changes to Hestia and test them locally.
79+
80+
## Making changes to Hestia
81+
82+
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.
83+
84+
The following are example instructions for making a change to Hestia's UI and testing it locally.
85+
86+
::: info
87+
Please ensure you have [Yarn](https://yarnpkg.com) v3 installed and are using [Node.js](https://nodejs.org/en/) v16 or higher.
788
:::
889

9-
## Compiling
90+
1. At the root of the project on your local machine, install Node dependencies
91+
92+
```bash
93+
yarn install
94+
```
95+
96+
1. Make a change to a file that we can later test, then build the UI assets
97+
98+
_e.g. change the body background color to red in `web/css/src/base.css` then run:_
99+
100+
```bash
101+
yarn build
102+
```
103+
104+
1. SSH into the VM as root and navigate to `/src`
105+
106+
```bash
107+
multipass exec hestia-dev -- sudo bash
108+
cd src
109+
```
110+
111+
1. Run the Hestia build script
112+
113+
```bash
114+
./hst_autocompile.sh --hestia --install '~localsrc'
115+
```
116+
117+
1. Reload the page in your browser to see your changes
118+
119+
Please refer to the [contributing guidelines](https://github.com/hestiacp/hestiacp/blob/main/CONTRIBUTING.md) for more details on submitting code changes for review.
120+
121+
### Building packages
10122

11123
::: info
12124
For building `hestia-nginx` or `hestia-php`, at least 2 GB of memory is required!
13125
:::
14126

15-
Go into the `src` folder and run one of these commands:
127+
Here is more detailed information about the build scripts that are run from `src`:
16128

17-
### Compile only
129+
#### Build packages only
18130

19131
```bash
20132
# Only Hestia
@@ -26,10 +138,10 @@ Go into the `src` folder and run one of these commands:
26138
./hst_autocompile.sh --all --noinstall --keepbuild '~localsrc'
27139
```
28140

29-
### Compile and install
141+
#### Build and install packages
30142

31143
::: info
32-
Use this only if you have Hestia already installed.
144+
Use if you have Hestia already installed, for your changes to take effect.
33145
:::
34146

35147
```bash
@@ -42,7 +154,9 @@ Use this only if you have Hestia already installed.
42154
./hst_autocompile.sh --all --install '~localsrc'
43155
```
44156

45-
## Install Hestia from packages
157+
## Installing Hestia from a branch
158+
159+
The following is useful for testing a Pull Request or a branch on a fork.
46160

47161
```bash
48162
# 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/
64178

65179
Any option can be appended to the installer command. [See the complete list](../introduction/getting-started#list-of-installation-options).
66180

67-
## Update Hestia from GitHub
181+
## Updating Hestia from GitHub
182+
183+
The following is useful for pulling the latest staging/beta changes from GitHub and compiling the changes.
68184

69185
::: info
70186
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
74190
v-update-sys-hestia-git [USERNAME] [BRANCH]
75191
```
76192

77-
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:
193+
**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:
78194

79195
```bash
80196
dpkg: error processing package hestia (–install):
@@ -87,9 +203,9 @@ To solve this issue, run:
87203
apt install -f
88204
```
89205

90-
## Automated testing
206+
## Running automated tests
91207

92-
For automated testing, we currently use [Bats](https://github.com/bats-core/bats-core).
208+
For automated tests we currently use [Bats](https://github.com/bats-core/bats-core).
93209

94210
### Install
95211

docs/docs/contributing/documentation.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,13 @@ The documentation is built using [VitePress](https://vitepress.vuejs.org). There
44

55
## Requirements
66

7-
- Node.js 16 or higher with [pnpm installed](https://pnpm.io/installation);
7+
- Node.js 16 or higher
8+
- [Yarn](https://yarnpkg.com/getting-started/install) package manager
89
- A code editor with Vue and Markdown support. We suggest [Visual Studio Code](https://code.visualstudio.com).
910

1011
## Viewing your changes locally
1112

1213
1. Open the project folder in your terminal.
13-
2. If the dependencies are not installed yet, install them by running `pnpm i`.
14-
3. Run `pnpm dev`.
14+
2. If the dependencies are not installed yet, install them by running `yarn install`.
15+
3. Run `yarn docs:dev`.
1516
4. Navigate to `http://localhost:5173` in your browser.

0 commit comments

Comments
 (0)