Skip to content

Commit 76bac4e

Browse files
author
Kristan Kenney
committed
Merge branch 'staging/fixes' into main
2 parents 03aa2c8 + 02236c6 commit 76bac4e

File tree

18 files changed

+181
-86
lines changed

18 files changed

+181
-86
lines changed

CHANGELOG.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,20 @@
11
# Changelog
22
All notable changes to this project will be documented in this file.
33

4+
## [1.3.2] - Service Release
5+
### Features
6+
- No new features have been introduced in this release.
7+
8+
### Bugfixes
9+
- Fixed an issue where Let's Encrypt certificates were not regenerated when changing domain aliases (#1353)
10+
- Fixed an issue where user name was duplicated when editing FTP users (#1411)
11+
- Fixed an issue where the iptables service would appear to be in a stopped state when fail2ban is stopped. (#1374)
12+
- Fixed an issue where the default language value was incorrectly set under Server Settings > Configure.
13+
- Fixed an issue with the dark theme where available updates were incorrectly displayed.
14+
- Fixed an issue where local and FTP backup files were not deleted when running `v-delete-user-backup`. (#1421)
15+
- Fixed an issue where IP addresses could not be deleted (#1423)
16+
- Improvements have been made to the API's error handling - thanks **@danielalexis**!
17+
418
## [1.3.1] - Service Release
519
### Features
620
- No new features have been introduced in this release.

CONTRIBUTING.md

Lines changed: 19 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,16 @@ Hestia Control Panel - Contribution Guidelines
44
Ways to contribute
55
-----------------------
66
- **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>
7+
- Download and install builds from the `beta` branch. If you encounter an issue with a beta build, file an issue report on [GitHub](https://www.github.com/hestiacp/hestiacp/issues).<br>
88
`v-update-sys-hestia-git hestiacp beta install` will install the latest beta build from our GitHub repository.
99
- **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.
10+
- Read over the code and if you notice errors (even spelling mistakes), submit a pull request with your changes.
1111
- **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.
12+
- Is there an awesome feature that you'd love to see included? Submit a pull request with your changes, and if approved your PR will be reviewed and merged for inclusion in an upcoming release. While our development team tries to accomodate all reasonable requests please remember that it does take time to develop, implement and test new features and as such we may not be able to fulfill all requests or may have to put a feature on backlog for a later date.
1313
- **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 go to [Hestia Translate](https://translate.hestiacp.com/projects/hestiacp/) to review the translations. For more information please read [How to contribute with Translations](https://forum.hestiacp.com/t/how-to-contribute-with-translations/1664). 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.
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 go to [Hestia Translate](https://translate.hestiacp.com/projects/hestiacp/) to review the translations database. For more information please read [How to contribute with Translations](https://forum.hestiacp.com/t/how-to-contribute-with-translations/1664) on our forum. You can also 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.
1515
- **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 donations through [PayPal](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=ST87LQH2CHGLA).
16+
- If you're not a developer but you still want to make a contribution to support Hestia Control Panel and our developers, 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 donations through [PayPal](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=ST87LQH2CHGLA).
1717

1818
Development Guidelines
1919
-----------------------
@@ -25,28 +25,27 @@ Development for this project takes place in branches to effectively develop, man
2525

2626
We have three primary or "evergreen" branches, which exist throughout our product's lifetime. Please refer to the following table for a description:
2727

28-
| Branch | Description | Cycle |
29-
|---------------|:---------------:|:---------------:|
30-
| `main` | Contains a snapshot of the latest development code.<br>**Not intended for production use and contains code from a merge snapshot.** | 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. This repository contains the same code as our compiled packages.** | Monthly |
28+
| Branch | Description
29+
|---------------|:---------------:|
30+
| `main` | Contains a snapshot of the latest development code.<br>**Not intended for production use and contains code from a merge snapshot.**
31+
| `beta` | Contains a snapshot of the next version which is currently in testing.<br>**Not intended for production use, however code from this branch should be stable.**
32+
| `release` | Contains a snapshot of the latest stable release.<br>**Intended for production use. This repository contains the same code as our compiled packages.**
3333

3434
### 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.
35+
The first step is to create a fork of the `hestiacp/hestiacp` repository under your GitHub account so that you may submit pull requests and patches.
3636

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:
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 your work.
3838

3939
### Branch naming convention:
4040
- **Prefix:** `topic/` (such as **fix**, **feature**, **refactor**, etc.)
41-
- **ID**: `888` (GitHub Issue ID if an issue exists) -or- `2020-07` (Year-Month if an issue does not already exist)
42-
- **Separator:** `_` (underscore)
41+
- **ID**: `888` (GitHub Issue ID if an issue exists)
4342
- **Title:** `my-awesome-patch`
4443

4544
Branch name examples:
46-
* `feature/777_my-awesome-new-feature` or `feature/2020-07_my-other-new-feature`
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`
45+
* `feature/777-my-awesome-new-feature` or `feature/my-other-new-feature`
46+
* `fix/000-some-bug-fix` or `fix/this-feature-is-broken`
47+
* `refactor/v-change-domain-owner`
48+
* `test/mail-domain-ssl`
5049

5150
### Squashing commits for smaller changes
5251
To aid other developers and keep the project's commit history clean, please **squash your commits** when it's appropriate. For example with smaller commits related to the same piece of code, such as commits labelled "Fixed item 1", "Adjusted color of button XYZ", "Adjusted alignment of button XYZ" can be squashed into one commit with the title "Fixed button issues in item".
@@ -55,48 +54,9 @@ To aid other developers and keep the project's commit history clean, please **sq
5554
- Our internal development team will review your work and validate your request.
5655
- Your changes will be tested to ensure that there are no issues.
5756
- 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:
59-
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.**
61-
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` |
69-
70-
Our development and release cycles
71-
-----------------------
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-
57+
- Once approved, your code will be merged for inclusion in an upcoming release of Hestia Control Panel.
9958

59+
All pull requests must include a brief but descriptive title, and a detailed description of the changes that you've made. **Only include commits that are related to your feature, bug fix, or patch in your pull request!**
10060

10161
Thank you!
10262
-----------------------

README.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,11 @@ Features and Services
2626
* Let's Encrypt SSL support with wildcard certificates
2727
* Firewall with brute-force attack detection and IP lists (iptables, fail2ban, and ipset).
2828

29-
Supported operating systems
29+
Supported platforms and operating systems
3030
----------------------------
31-
* Debian 10, 9 (amd64 only)
32-
* Ubuntu 20.04 LTS, 18.04 LTS, or 16.04 LTS (amd64 only)
31+
* **CPU Architecture:** AMD64 (x86_64 Intel/AMD)
32+
* **Debian:** 10, 9
33+
* **Ubuntu:** 20.04 LTS, 18.04 LTS, or 16.04 LTS
3334
* **NOTE:** Hestia Control Panel must be installed on top of a fresh operating system installation to ensure proper functionality.
3435

3536
Installing Hestia Control Panel
@@ -67,7 +68,7 @@ Alternatively, @gabizz has made available a command-line script generator at htt
6768

6869
Installing Hestia Control Panel
6970
============================
70-
Updates of existing installations are performed by the Auto Updater. If you want to do this manually, you can do it via the apt package manager;
71+
Automatic Updates are enabled by default on new installations of Hestia Control Panel and can be managed from **Server Settings > Updates**. To manually check for and install available updates, use the apt package manager:
7172
```bash
7273
apt-get update
7374
apt-get upgrade

bin/v-add-letsencrypt-domain

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,17 +100,36 @@ fi
100100

101101

102102

103+
# Dump debug info
104+
debug_log() {
105+
echo -e "\n==[${1}]==\n${2}\n" >> "$log_file"
106+
}
107+
103108
#----------------------------------------------------------#
104109
# Action #
105110
#----------------------------------------------------------#
106111

112+
113+
114+
107115
# Generate correct variables for mail domain SSL certificates
108116
if [ ! -z "$mail" ]; then
109117
root_domain=$domain
110118
domain="mail.$root_domain"
111119
aliases="$WEBMAIL_ALIAS.$root_domain"
112120
fi
113121

122+
log_file="/var/log/hestia/LE-${user}-${domain}-$(date +%Y%m%d-%H%M%S).log"
123+
touch "$log_file"
124+
chmod 600 "$log_file"
125+
126+
echo -e "\n\n=============================
127+
WEB_SYSTEM: ${WEB_SYSTEM}
128+
PROXY_SYSTEM: ${PROXY_SYSTEM}
129+
user: ${user}
130+
domain: ${domain}
131+
" >> "$log_file"
132+
114133
# Registering LetsEncrypt user account
115134
$BIN/v-add-letsencrypt-user $user
116135
if [ "$?" -ne 0 ]; then
@@ -134,6 +153,12 @@ else
134153
proto="http-01"
135154
fi
136155

156+
echo -e "
157+
- aliases: ${aliases}
158+
- proto: ${proto}
159+
- wildcard: ${wildcard}
160+
" >> "$log_file"
161+
137162
# Check if dns records exist for requested domain/aliases
138163
if [ "$proto" = "http-01" ]; then
139164
for identifier in $(echo $domain,$aliases |tr ',' '\n' |sort -u); do
@@ -164,6 +189,9 @@ fi
164189
answer=$(curl -s -I "$LE_API/directory")
165190
nonce=$(echo "$answer" |grep -i nonce |cut -f2 -d \ |tr -d '\r\n')
166191
status=$(echo "$answer"|grep HTTP/ |tail -n1 |cut -f 2 -d ' ')
192+
193+
debug_log "Step 1" "- status: ${status}\n- nonce: ${nonce}\n- answer: ${answer}"
194+
167195
if [[ "$status" -ne 200 ]]; then
168196
# Delete DNS CAA record
169197
if [ ! -z "$DNS_SYSTEM" ]; then
@@ -192,6 +220,9 @@ nonce=$(echo "$answer" |grep -i nonce |cut -f2 -d \ |tr -d '\r\n')
192220
authz=$(echo "$answer" |grep "acme/authz" |cut -f2 -d '"')
193221
finalize=$(echo "$answer" |grep 'finalize":' |cut -f4 -d '"')
194222
status=$(echo "$answer" |grep HTTP/ |tail -n1 |cut -f2 -d ' ')
223+
224+
debug_log "Step 2" "- status: ${status}\n- nonce: ${nonce}\n- authz: ${authz}\n- finalize: ${finalize}\n- payload: ${payload}\n- answer: ${answer}"
225+
195226
if [[ "$status" -ne 201 ]]; then
196227
# Delete DNS CAA record
197228
if [ ! -z "$DNS_SYSTEM" ]; then
@@ -212,6 +243,9 @@ for auth in $authz; do
212243
token=$(echo "$answer" |grep -A3 $proto |grep token |cut -f 4 -d \")
213244
nonce=$(echo "$answer" |grep -i nonce |cut -f2 -d \ |tr -d '\r\n')
214245
status=$(echo "$answer"|grep HTTP/ |tail -n1 |cut -f 2 -d ' ')
246+
247+
debug_log "Step 3" "- status: ${status}\n- nonce: ${nonce}\n- url: ${url}\n- token: ${token}\n- answer: ${answer}"
248+
215249
if [[ "$status" -ne 200 ]]; then
216250
# Delete DNS CAA record
217251
if [ ! -z "$DNS_SYSTEM" ]; then
@@ -303,6 +337,9 @@ for auth in $authz; do
303337
nonce=$(echo "$answer" |grep -i nonce |cut -f2 -d \ |tr -d '\r\n')
304338
status=$(echo "$answer"|grep HTTP/ |tail -n1 |cut -f 2 -d ' ')
305339
details=$(echo "$answer"| grep detail | cut -f 1 -d ',' | cut -f 2-4 -d ':' | cut -f 2 -d '"')
340+
341+
debug_log "Step 5" "- status: ${status}\n- nonce: ${nonce}\n- validation: ${validation}\n- details: ${details}\n- answer: ${answer}"
342+
306343
if [[ "$status" -ne 200 ]]; then
307344
# Delete DNS CAA record
308345
if [ ! -z "$DNS_SYSTEM" ]; then
@@ -315,6 +352,7 @@ for auth in $authz; do
315352
fi
316353
fi
317354
fi
355+
debug_log "Abort Step 5" "=> Wrong status"
318356
check_result $E_CONNECT "Let's Encrypt validation status $status. Details: $details"
319357
fi
320358

@@ -331,6 +369,7 @@ for auth in $authz; do
331369
fi
332370
fi
333371
fi
372+
debug_log "Abort Step 5" "=> Too many validation retries"
334373
check_result $E_CONNECT "Let's Encrypt domain validation timeout"
335374
fi
336375
sleep $((i*2))
@@ -362,6 +401,9 @@ answer=$(query_le_v2 "$finalize" "$payload" "$nonce")
362401
nonce=$(echo "$answer" |grep -i nonce |cut -f2 -d \ |tr -d '\r\n')
363402
status=$(echo "$answer"|grep HTTP/ |tail -n1 |cut -f 2 -d ' ')
364403
certificate=$(echo "$answer"|grep 'certificate":' |cut -f4 -d '"')
404+
405+
debug_log "Step 6" "- status: ${status}\n- nonce: ${nonce}\n- payload: ${payload}\n- certificate: ${certificate}\n- answer: ${answer}"
406+
365407
if [[ "$status" -ne 200 ]]; then
366408
[ -d "$ssl_dir" ] && rm -rf "$ssl_dir"
367409
check_result $E_CONNECT "Let's Encrypt finalize bad status $status"
@@ -370,6 +412,12 @@ fi
370412
# Downloading signed certificate / STEP 7
371413
answer=$(query_le_v2 "$certificate" "" "$nonce" "$ssl_dir/$domain.pem")
372414
status=$(echo "$answer"|grep HTTP/ |tail -n1 |cut -f 2 -d ' ')
415+
416+
debug_log "Step 7" "- status: ${status}\n- answer: ${answer}"
417+
debug_log "CERT DIR" "$(ls -las "$ssl_dir/")"
418+
debug_log "CERT PEM" "$(cat "$ssl_dir/$domain.pem")"
419+
420+
373421
if [[ "$status" -ne 200 ]]; then
374422
[ -d "$ssl_dir" ] && rm -rf "$ssl_dir"
375423
check_result $E_NOTEXIST "Let's Encrypt downloading signed cert failed status:$status"
@@ -384,10 +432,13 @@ ca_end=$(grep -n "BEGIN" $ssl_dir/$domain.pem |tail -n1 |cut -f 1 -d :)
384432
ca_end=$(( pem_lines - crt_end + 1 ))
385433
tail -n $ca_end $ssl_dir/$domain.pem > $ssl_dir/$domain.ca
386434

435+
debug_log "CERT CRT" "$(cat "$ssl_dir/$domain.crt")"
436+
debug_log "CERT CA-1" "$(cat "$ssl_dir/$domain.ca")"
387437
# Temporary fix for double "END CERTIFICATE"
388438
if [[ $(head -n 1 $ssl_dir/$domain.ca) = "-----END CERTIFICATE-----" ]]; then
389439
sed -i '1,2d' $ssl_dir/$domain.ca
390440
fi
441+
debug_log "CERT CA-2" "$(cat "$ssl_dir/$domain.ca")"
391442

392443
# Rename certs for mail
393444
if [ ! -z "$mail" ]; then
@@ -467,4 +518,7 @@ send_notice 'LETSENCRYPT' "$domain SSL has been installed successfully"
467518
# Logging
468519
log_event "$OK" "$ARGUMENTS"
469520

521+
# Cleanup debug since the SSL was issues succesfully
522+
rm -f "$log_file"
523+
470524
exit

bin/v-add-letsencrypt-host

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
# options: NONE
44
# labels: hestia
55
#
6+
# example: v-add-letsencrypt-host
7+
#
68
# The function check and validates the backend certificate and generate
79
# a new let's encrypt certificate.
810

bin/v-change-web-domain-ip

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,13 +76,13 @@ fi
7676
# Hestia #
7777
#----------------------------------------------------------#
7878

79+
# Update config
80+
update_object_value 'web' 'DOMAIN' "$domain" '$IP' "$3"
81+
7982
# Update counters
8083
increase_ip_value "$new"
8184
decrease_ip_value "$old"
8285

83-
# Update config
84-
update_object_value 'web' 'DOMAIN' "$domain" '$IP' "$3"
85-
8686
# Restart web server
8787
$BIN/v-restart-web $restart
8888
check_result $? "WEB restart failed" >/dev/null

0 commit comments

Comments
 (0)