Skip to content

Commit 9f98277

Browse files
authored
Merge branch 'staging/fixes' into main
2 parents 4b21afa + efbdb64 commit 9f98277

File tree

172 files changed

+3369
-1369
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

172 files changed

+3369
-1369
lines changed

.github/FUNDING.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
custom: ["https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=ST87LQH2CHGLA"]

CHANGELOG.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,31 @@
22
All notable changes to this project will be documented in this file.
33

44
## [CURRENT] - Development
5+
### Features
6+
7+
### Bugfixes
8+
- Create mailhelo.conf if it doesnt exist to prevent a error message during grep.
9+
10+
## [1.2.1] - Service Release 1 (beta)
11+
### Features
12+
- Consolidated First and Last Name fields to a singular name field to simply input.
13+
- v-change-user-name will now accept both "First Last" (single argument) and First Last (two arguments) for backward compatibility.
14+
- Removed ntpdate from new installations and enable systemd timesync daemon instead (thanks **@braewoods**)
15+
16+
### Bugfixes
17+
- Fixed an issue where Composer would fail to install due to missing default directory.
18+
- Corrected an issue where two-factor authentication validation was causing high CPU load during the login process. The login screen has been re-designed as a multi-step process (Username > Password > OTP PIN).
19+
- Corrected an issue where text entry fields on the login screen were not automatically focused by default.
20+
- Fixed an issue where RDNS value was incorrectly set if dig failed to resolve the server name.
21+
- Fixed an issue where icons were pushed down in the header when using Bulgarian as the display language. (#932)
22+
- Fixed an issue where new backups were not created when running v-schedule-user-backup-download. (#918)
23+
- Fixed an issue where default configuration files and templates were not backed up correctly.
24+
- Improved quality of default web domain templates for Drupal. (#916)
25+
- Added missing strings to translation files (translations to follow).
26+
- Corrected an issue where toolbars were out of place on the Mail and Firewall pages when using Bulgarian or Greek languages due to string length.
27+
- Improved Spanish translations (thanks **@Wibol**)
28+
- Improved German translations (thanks **@ronald-at**)
29+
- Improved Russian translations (thanks **@Pleskan**)
530

631
## [1.2.0] - Major Release (Feature / Quality Update)
732
### Features

CONTRIBUTING.md

Lines changed: 85 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,106 @@
1-
Code Contributions & Pull Requests - Guidelines
1+
Hestia Control Panel - Contribution Guidelines
22
-----------------------
33

4-
All pull requests must include a brief but descriptive title, and a description of the changes that you've made with as much detail as possible. **Only include commits that are related to your feature, bug fix, or patch in your pull request.**
5-
6-
## Code formatting and comments:
4+
Ways to contribute
5+
-----------------------
6+
- **Beta testing**:
7+
- Download and install builds from the `beta` branch. Provide feedback to our developers and file any issues that you come across on [GitHub](https://www.github.com/hestiacp/hestiacp/issues).<br>
8+
`v-update-sys-hestia-git hestiacp beta install` will install the latest beta build from our GitHub repository.
9+
- **Code review and bug fixes**:
10+
- Read over the code and if you notice errors (even spelling mistakes), submit a pull request with your fixes.
11+
- **New features**:
12+
- Is there an awesome feature that you'd love to see included? While our development team tries to fulfill all reasonable requests, it can take time to implement new features depending on the amount of work involved. Submit a pull request with your code and if your idea is approved, we'll review and test it for inclusion with an upcoming release.
13+
- **Translations**:
14+
- If you are a non-English speaker and would like to improve the quality of the translations used in Hestia Control Panel's web interface, please review the `.php` files found under `hestiacp/web/inc/i18n` and submit a pull request or open an issue report [GitHub](https://www.github.com/hestiacp/hestiacp/issues) highlighting the issue with the current translation so that it can be corrected.
15+
- **Donations**:
16+
- If you're not a developer but you still want to make a contribution, you can make a donation to the Hestia Control Panel project to further its development (or if you'd just like to buy our developers a lunch, we'd appreciate that too). We currently accept dontations through [PayPal](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=ST87LQH2CHGLA).
17+
18+
Development Guidelines
19+
-----------------------
20+
### Code formatting and comments
721
We ask that you follow existing naming schemes and coding conventions where possible, and that you add comments in your source code where appropriate to aid other developers in debugging and understanding your code in the future.
822

9-
## Squashing commits for smaller changes:
10-
When submitting a pull request with multiple smaller commits which are related to the same issue (or file), we ask that you please **squash your commits** in order to keep the project's commit history clean and easy to follow for other developers.
11-
12-
## Working with branches:
13-
Development for this project takes place in branches to effectively develop, manage, and test new features and code changes, helping to ensure that each release meets high quality standards. Our primary branches are as follows:
23+
### Workflow and process
24+
Development for this project takes place in branches to effectively develop, manage, and test new features and code changes. Our tiered approach allows us to closely control the quality of code as it is checked in for inclusion.
1425

15-
### Primary branches:
26+
We have three primary or "evergreen" branches, which exist throughout our product's lifetime. Please refer to the following table for a description:
1627

17-
* `develop`: Active development code for the the next version of Hestia Control Panel, considered to be unstable.
18-
* `beta`: Feature locked code for the next release, which receives fixes only and goes through feedback and testing.
19-
* `release`: Code in this branch aligns with the latest packages available on our APT repositories.
28+
| Branch | Description | Cycle |
29+
|---------------|:---------------:|:---------------:|
30+
| `main` | Contains a snapshot of the latest development code.<br>**Not intended for production use and may be unstable.** | Daily |
31+
| `beta` | Contains a snapshot of the next version which is currently in testing.<br>**Not intended for production but should be highly stable.** | Weekly |
32+
| `release` | Contains a snapshot of the latest stable release.<br>**Intended for production use. Same code as packages in repository.** | Monthly |
2033

21-
### I want to contribute some code to Hestia Control Panel, where do I start?
34+
### Creating a new branch and submitting pull requests
35+
The first step is to create a fork of the `hestiacp/hestiacp` repository under your account so that you may submit pull requests and patches via GitHub.
2236

23-
First, create a new branch for your work based on the `develop` branch to ensure that you have the latest commits in your local repository, which will help make sure that your pull requests only contain the commits that are necessary.
37+
Once you've created your fork, clone the repository to your computer and make sure that you've checked out the `main` branch. **Always** create a new topic branch for you work. When submitting pull requests it is important that you target the correct branch to ensure that your changes are properly integrated and tested based on our release schedule. When creating a new branch, we ask that you please adhere to the following naming conventions as much as possible:
2438

25-
When creating your branches, **please adhere to the following naming conventions:**
26-
27-
- **Prefix:** `bugfix/` or `feature/` based on the type of submission.
39+
### Branch naming convention:
40+
- **Prefix:** `topic/` (such as **bugfix**, **feature**, **refactor**, etc.)
2841
- **ID**: `888` (GitHub Issue ID if an issue exists) -or- `2020-07` (Year-Month if an issue does not already exist)
2942
- **Separator:** `_` (underscore)
3043
- **Title:** `my-awesome-patch`
3144

3245
Branch name examples:
3346
* `feature/777_my-awesome-new-feature` or `feature/2020-07_my-other-new-feature`
34-
* `bugfix/000_some-bug-fix` or `bugfix/2020-07_this-feature-is-broken`
47+
* `fix/000_some-bug-fix` or `fix/2020-07_this-feature-is-broken`
48+
* `refactor/2020-07_v-change-domain-owner`
49+
* `test/2020-07_mail-domain-ssl`
3550

36-
Once your code is complete and you have reviewed it for errors, submit a pull request to the correct integration branch:
51+
### Squashing commits for smaller changes
52+
When submitting a pull request with multiple smaller commits which are related to the same file or issue, we ask that you please **squash your commits** whenever appropriate in order to keep the project's commit history clean and easy to follow for other developers.
3753

38-
* `staging/fixes`: bugfix/ branches will merge to this branch when they have been tested/verified.
39-
* `staging/features`: feature/ branches will merge to this branch when they have been tested/verified.
54+
### What happens when I submit a pull request?
55+
- Our internal development team will review your work and validate your request.
56+
- Your changes will be tested to ensure that there are no issues.
57+
- If changes need to be made, you will be notified via GitHub.
58+
- Once approved, your code will be merged to the appropriate `staging/*` branch based on the chart below:
4059

41-
All `staging` branches will integrate to `develop` to form the next release of Hestia Control Panel. Once all features and fixes planned for the release are merged, the code will then be pushed to the `beta` branch where it is feature locked, assigned a version number, and will receive thorough testing before being pushed to the `release` branch with new packages being pushed to APT.
60+
All pull requests must include a brief but descriptive title, and a description of the changes that you've made with as much detail as possible. **Only include commits that are related to your feature, bug fix, or patch in your pull request.**
4261

43-
**Please ensure that all pull requests meet the guidelines listed above; those that do not will be rejected and sent back for review.**
62+
| Topic branches: | Primary Target: | Final destination: |
63+
| -----------------------------|:---------------------------:|:-------------------------------------:|
64+
| **`feature/*`** | `staging/features` | `main` |
65+
| **`fix/*`** | `staging/fixes` | `main` **and** `beta` *or* `release` |
66+
| **`refactor/*`** | `staging/refactoring` | `main` |
67+
| **`test/*`** | `staging/tests` | `main` |
68+
| **`doc/*`** | `staging/docs` | `main`, `beta`, *or* `release` |
4469

45-
Donations
70+
Our development and release cycles
4671
-----------------------
47-
If you would like to make a donation to the Hestia Control Panel project to further its development (or if you'd like to buy our developers a lunch), please feel free to do so via [PayPal](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=ST87LQH2CHGLA).
72+
### During the development cycle:
73+
- `topic/*` branches are submitted to our team via a pull request. Your changes will be reviewed and tested, and if all appropriate quality assurance checks pass the branch will be merged to the corresponding `staging/*` branch.
74+
75+
- `staging/*` branches merge into `main` at various intervals throughout the development process.
76+
77+
- When all planned features and fixes have been merged to `main`, the code is tested for regressions and bugs.
78+
79+
- A snapshot of `main` is pushed to a temporary branch called `staging/refactoring`, and final code review, refactoring, and optimization takes place. Once complete, `staging/refactoring` merges back to `main` bringing the codebase up-to-date. All other `staging/*` branches synchronize with `main` at this time.
80+
81+
- After final validation checks pass, our development team signs off on the release and the code is pushed from `main` to `beta`.
82+
83+
### During the release cycle:
84+
- **What happens when code moves from `main` to `beta`**:<br>
85+
- **No new feature requests will be approved**.
86+
- `main` will receive an increment in it's version number signaling the start of a new development cycle.
87+
- `fix/*` topic branches/commits will be cherry picked to `beta` as necessary.
88+
- `staging/docs` will merge into `beta` prior to the code being pushed to `release` to bring documentation and supporting files up-to-date.
89+
90+
- If all quality assurance checks pass, our development team will then:
91+
- Sign off on the code in `beta`.
92+
- Push the code to the `release` branch and create a corresponding version tag.
93+
- Compile new packages and publish them to our APT repository.
94+
- **Notes:**
95+
- `release` always contains the highest released version of Hestia Control Panel.
96+
- For major releases, a `release/vX.x` branch will be created for maintenance and servicing purposes.
97+
98+
99+
100+
101+
Thank you!
102+
-----------------------
103+
We appreciate **all** contributions no matter what size; your feedback and input directly shapes the future of Hestia Control Panel and we could not do it without your support.
104+
105+
Thank you for your time and we look forward to seeing your pull requests,<br>
106+
The Hestia Control Panel development team

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
[Hestia Control Panel](https://www.hestiacp.com/)
44
==================================================
55
**Latest stable release:** Version 1.2.0 | [View Changelog](https://github.com/hestiacp/hestiacp/blob/release/CHANGELOG.md)<br>
6+
**Latest beta release:** Version 1.2.1 | [View Changelog](https://github.com/hestiacp/hestiacp/blob/beta/CHANGELOG.md)<br>
7+
**Latest unstable development snapshot:** Version 1.2.2 | [View Changelog](https://github.com/hestiacp/hestiacp/blob/main/CHANGELOG.md)<br>
68

79
**Web:** [www.hestiacp.com](https://www.hestiacp.com/)<br>
810
**Documentation:** [docs.hestiacp.com](https://docs.hestiacp.com/)<br>

bin/v-add-cron-hestia-autoupdate

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,6 @@ time_n_date=$(date +'%T %F')
4444
time=$(echo "$time_n_date" |cut -f 1 -d \ )
4545
date=$(echo "$time_n_date" |cut -f 2 -d \ )
4646

47-
# Remove existing cron job
48-
$BIN/v-delete-cron-hestia-autoupdate
49-
5047
# Define time somewhere at night
5148
if [ -z "$mode" ] || [ "$mode" = "apt" ]; then
5249
min=$(generate_password '012345' '2')
@@ -82,9 +79,6 @@ sort_cron_jobs
8279
# Sync cronjobs with system crond
8380
sync_cron_jobs
8481

85-
# Perform verification if read-only mode is enabled
86-
check_hestia_demo_mode
87-
8882
#----------------------------------------------------------#
8983
# Hestia #
9084
#----------------------------------------------------------#
@@ -97,7 +91,7 @@ $BIN/v-restart-cron
9791
check_result $? "Cron restart failed" >/dev/null
9892

9993
# Logging
100-
log_history "added cron job $job"
94+
log_history "enabled automatic updates"
10195
log_event "$OK" "$ARGUMENTS"
10296

10397
exit

bin/v-add-database-host

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,10 @@ type=$1
1818
host=$2
1919
dbuser=$3
2020
password=$4; HIDE=4
21-
max_db=${6-500}
22-
charsets=${7-UTF8,LATIN1,WIN1250,WIN1251,WIN1252,WIN1256,WIN1258,KOI8}
23-
template=${8-template1}
21+
max_db=${5-500}
22+
charsets=${6}
23+
template=${7}
24+
port=${8}
2425

2526
# Includes
2627
source $HESTIA/func/main.sh
@@ -33,6 +34,8 @@ is_mysql_host_alive() {
3334
echo "host='$HOST'" >> $mycnf
3435
echo "user='$USER'" >> $mycnf
3536
echo "password='$PASSWORD'" >> $mycnf
37+
echo "port='$PORT'" >> $mycnf
38+
3639
chmod 600 $mycnf
3740
mysql --defaults-file=$mycnf -e 'SELECT VERSION()' >/dev/null 2>&1
3841
rm $mycnf
@@ -45,7 +48,7 @@ is_mysql_host_alive() {
4548

4649
is_pgsql_host_alive() {
4750
export PGPASSWORD="$dbpass"
48-
psql -h $host -U $dbuser -c "SELECT VERSION()" > /dev/null 2>&1
51+
psql -h $host -U $dbuser -p $port -c "SELECT VERSION()" > /dev/null 2>&1
4952
if [ '0' -ne "$?" ]; then
5053
echo "Error: PostgreSQL connection to $host failed"
5154
log_event "$E_CONNECT" "$ARGUMENTS"
@@ -58,14 +61,21 @@ is_pgsql_host_alive() {
5861
# Verifications #
5962
#----------------------------------------------------------#
6063

61-
args_usage='TYPE HOST DBUSER DBPASS [MAX_DB] [CHARSETS] [TPL]'
64+
args_usage='TYPE HOST DBUSER DBPASS [MAX_DB] [CHARSETS] [TPL] [PORT]'
6265
check_args '4' "$#" "$args_usage"
63-
is_format_valid 'host' 'dbuser' 'max_db' 'charsets' 'template'
66+
67+
if [ -z $charsets ]; then charsets="UTF8,LATIN1,WIN1250,WIN1251,WIN1252,WIN1256,WIN1258,KOI8"; fi
68+
if [ -z $template ]; then template="template1"; fi
69+
70+
database_set_default_ports
71+
72+
is_format_valid 'host' 'dbuser' 'max_db' 'charsets' 'template' 'port'
6473
#is_system_enabled "$DB_SYSTEM" 'DB_SYSTEM'
6574
#is_type_valid "$DB_SYSTEM" "$type"
6675
is_dbhost_new
6776
is_password_valid
6877
dbpass="$password"
78+
6979
case $type in
7080
mysql) is_mysql_host_alive ;;
7181
pgsql) is_pgsql_host_alive ;;
@@ -85,11 +95,11 @@ date=$(echo "$time_n_date" |cut -f 2 -d \ )
8595
case $type in
8696
mysql) str="HOST='$host' USER='$dbuser' PASSWORD='$dbpass'";
8797
str="$str CHARSETS='$charsets' MAX_DB='$max_db' U_SYS_USERS=''";
88-
str="$str U_DB_BASES='0' SUSPENDED='no' TIME='$time' DATE='$date'";;
98+
str="$str U_DB_BASES='0' SUSPENDED='no' TIME='$time' DATE='$date' PORT='$port'";;
8999
pgsql) str="HOST='$host' USER='$dbuser' PASSWORD='$dbpass'";
90100
str="$str CHARSETS='$charsets' TPL='$template' MAX_DB='$max_db'";
91101
str="$str U_SYS_USERS='' U_DB_BASES='0' SUSPENDED='no'";
92-
str="$str TIME='$time' DATE='$date'";;
102+
str="$str TIME='$time' DATE='$date' PORT='$port'";;
93103
esac
94104

95105

bin/v-add-mail-domain

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,11 @@ if [[ "$MAIL_SYSTEM" =~ exim ]]; then
101101
echo "$local_ip" > $HOMEDIR/$user/conf/mail/$domain/ip
102102
fi
103103

104+
# Touch mailhelo.conf if it doesnt exist
105+
if [ ! -f "/etc/exim4/mailhelo.conf" ]; then
106+
touch /etc/exim4/mailhelo.conf
107+
fi
108+
104109
# Setting HELO for mail domain
105110
if [ ! -z "$local_ip" ]; then
106111
IP_RDNS=$(is_ip_rdns_valid "$local_ip")

bin/v-add-sys-webmail

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
#!/bin/bash
22
# info: add webmail support for a domain
3-
# options: USER DOMAIN [RESTART]
3+
# options: USER DOMAIN [RESTART] [QUIET]
44
#
5+
# this function adds support for webmail services
6+
# to a mail domain.
57

68
#----------------------------------------------------------#
79
# Variable&Function #
@@ -11,6 +13,7 @@
1113
user=$1
1214
domain=$2
1315
restart="$3"
16+
quiet=$4
1417

1518
# Additional argument formatting
1619
if [[ "$domain" =~ [[:upper:]] ]]; then
@@ -123,7 +126,9 @@ if [ "$3" = 'yes' ]; then
123126
fi
124127

125128
# Logging
126-
log_history "enabled webmail support for $domain"
129+
if [ "$quiet" != 'yes' ]; then
130+
log_history "enabled webmail support for $domain"
131+
fi
127132
log_event "$OK" "$ARGUMENTS"
128133

129134
exit

bin/v-add-user

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/bash
22
# info: add system user
3-
# options: USER PASSWORD EMAIL [PACKAGE] [FNAME] [LNAME]
3+
# options: USER PASSWORD EMAIL [PACKAGE] [NAME]
44
#
55
# The function creates new user account.
66

@@ -14,8 +14,7 @@ user=$1
1414
password=$2; HIDE=2
1515
email=$3
1616
package=${4-default}
17-
fname=$5
18-
lname=$6
17+
name=$5
1918

2019
# Includes
2120
source $HESTIA/func/main.sh
@@ -32,11 +31,12 @@ is_user_free() {
3231
# Verifications #
3332
#----------------------------------------------------------#
3433

35-
check_args '3' "$#" 'USER PASSWORD EMAIL [PACKAGE] [FNAME] [LNAME]'
34+
check_args '3' "$#" 'USER PASSWORD EMAIL [PACKAGE] [NAME] '
3635
is_format_valid 'user' 'email' 'package'
37-
if [ ! -z "$fname" ]; then
38-
is_format_valid 'fname' 'lname'
36+
if [ ! -z "$name" ]; then
37+
is_format_valid 'name'
3938
fi
39+
4040
is_user_free "$user"
4141
is_password_valid
4242
is_package_valid
@@ -176,8 +176,7 @@ else
176176
u_users=1
177177
fi
178178

179-
echo "FNAME='$fname'
180-
LNAME='$lname'
179+
echo "NAME='$name'
181180
PACKAGE='$package'
182181
$pkg_data
183182
CONTACT='$email'
@@ -230,7 +229,7 @@ fi
230229

231230
# Run template trigger
232231
if [ -x "$HESTIA/data/packages/$package.sh" ]; then
233-
$HESTIA/data/packages/$package.sh "$user" "$email" "$fname" "$lname"
232+
$HESTIA/data/packages/$package.sh "$user" "$email" "$name"
234233
fi
235234

236235
# Adding jailed sftp env

0 commit comments

Comments
 (0)