Skip to content

Commit 2f91cc8

Browse files
authored
Merge pull request hestiacp#1624 from hestiacp/releases/v1.3.3
Release Hestia v1.3.3
2 parents 49aed0a + 4ce4d38 commit 2f91cc8

File tree

12 files changed

+100
-31
lines changed

12 files changed

+100
-31
lines changed

CHANGELOG.md

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

4+
## [1.3.3] - Service Release
5+
### Bugfixes
6+
- Improved permission handling.
7+
48
## [1.3.2] - Service Release
59
### Features
610
- Added PHP v8.0 support for multiphp environment.

README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,11 +74,12 @@ apt-get update
7474
apt-get upgrade
7575
```
7676

77-
Issues
77+
Issues & Support Requests
7878
=============================
79-
If you've run into a problem, [file a new issue report via GitHub](https://github.com/hestiacp/hestiacp/issues) so that we may investigate further.
79+
* If you encounter a general problem while using Hestia Control Panel and need help, please [visit our forum](https://forum.hestiacp.com/) to search for potential solutions or post a new thread where community members can assist.
80+
* Bugs and other reproducible issues should be filed via GitHub by [creating a new issue report](https://github.com/hestiacp/hestiacp/issues) so that our developers can investigate further. Please note that requests for support will be redirected to our forum.
8081

81-
**We cannot provide support for requests that do not describe the troubleshooting steps that have already been performed, or for third-party applications which do not relate to Hestia Control Panel. Please make sure that you fill in the necessary details in your issue reports!**
82+
**IMPORTANT: We _cannot_ provide support for requests that do not describe the troubleshooting steps that have already been performed, or for third-party applications not related to Hestia Control Panel (such as WordPress). Please make sure that you include as much information as possible in your forum posts or issue reports!**
8283

8384
Contributions
8485
=============================

bin/v-add-web-domain

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,8 @@ check_hestia_demo_mode
6868
# Reading user values
6969
source $USER_DATA/user.conf
7070

71+
[[ -e "$HOMEDIR/$user/web/$domain" ]] && check_result $E_EXISTS "Web domain folder for $domain should not exist"
72+
7173
# Creating domain directories
7274
$BIN/v-add-fs-directory "$user" "$HOMEDIR/$user/web/$domain"
7375
$BIN/v-add-fs-directory "$user" "$HOMEDIR/$user/web/$domain/public_html"
@@ -95,10 +97,10 @@ done
9597
chown -R $user:$user $HOMEDIR/$user/web/$domain
9698
chown root:$user /var/log/$WEB_SYSTEM/domains/$domain.* $conf
9799
chmod 640 /var/log/$WEB_SYSTEM/domains/$domain.*
98-
chmod 751 $HOMEDIR/$user/web/$domain $HOMEDIR/$user/web/$domain/*
99-
chmod 551 $HOMEDIR/$user/web/$domain/stats $HOMEDIR/$user/web/$domain/logs
100-
chmod 644 $HOMEDIR/$user/web/$domain/public_*html/*
101-
chown $user:www-data $HOMEDIR/$user/web/$domain/public_*html
100+
user_exec chmod 751 $HOMEDIR/$user/web/$domain $HOMEDIR/$user/web/$domain/*
101+
user_exec chmod 551 $HOMEDIR/$user/web/$domain/stats $HOMEDIR/$user/web/$domain/logs
102+
user_exec chmod 644 $HOMEDIR/$user/web/$domain/public_*html/*
103+
chown --no-dereference $user:www-data $HOMEDIR/$user/web/$domain/public_*html
102104

103105
# Addding PHP-FPM backend
104106
if [ ! -z "$WEB_BACKEND" ]; then

bin/v-check-api-key

Lines changed: 25 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,18 @@
1212
# Variable&Function #
1313
#----------------------------------------------------------#
1414

15-
if [ -z "$1" ]; then
15+
[[ -z $HESTIA ]] && HESTIA="/usr/local/hestia"
16+
17+
source $HESTIA/func/main.sh
18+
19+
new_timestamp
20+
21+
abort_missmatch() {
1622
echo "Error: key missmatch"
17-
exit 9
18-
fi
19-
key=$(basename $1)
23+
echo "$date $time api $ip failed to login" >> $HESTIA/log/auth.log
24+
exit $E_PASSWORD
25+
}
26+
2027
ip=${2-127.0.0.1}
2128
time_n_date=$(date +'%T %F')
2229
time=$(echo "$time_n_date" |cut -f 1 -d \ )
@@ -27,11 +34,20 @@ date=$(echo "$time_n_date" |cut -f 2 -d \ )
2734
# Action #
2835
#----------------------------------------------------------#
2936

30-
if [ ! -e $HESTIA/data/keys/$key ]; then
31-
echo "Error: key missmatch"
32-
echo "$date $time api $ip failed to login" >> $HESTIA/log/auth.log
33-
exit 9
34-
fi
37+
key="$(basename "$1")"
38+
39+
# Exit if Key is unset or to short
40+
[[ -z $key || ${#key} -lt 16 ]] && abort_missmatch
41+
42+
# Key file must exist
43+
maybe_key_path="$(readlink -e "${HESTIA}/data/keys/${key}")"
44+
[[ -z $maybe_key_path ]] && abort_missmatch
45+
46+
# Key file cannot be the key store
47+
[[ $maybe_key_path == "${HESTIA}/data/keys" ]] && abort_missmatch
48+
49+
# Key file must be in the key store
50+
[[ $maybe_key_path == "${HESTIA}/data/keys/"* ]] || abort_missmatch
3551

3652

3753
#----------------------------------------------------------#

bin/v-generate-api-key

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,9 @@ HASH=$(keygen)
2424
#----------------------------------------------------------#
2525

2626
if [ ! -d ${KEYS} ]; then
27-
mkdir -p ${KEYS}
27+
mkdir -p ${KEYS}
28+
chown admin:root ${KEYS}
29+
chmod 750 ${KEYS}
2830
fi
2931

3032
if [[ -e ${KEYS}${HASH} ]] ; then

func/main.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1165,3 +1165,14 @@ user_exec() {
11651165

11661166
setpriv --groups "$user_groups" --reuid "$user" --regid "$user" -- $@
11671167
}
1168+
1169+
# Simple chmod wrapper that skips symlink files after glob expand
1170+
no_symlink_chmod() {
1171+
local filemode=$1; shift;
1172+
1173+
for i in "$@"; do
1174+
[[ -L ${i} ]] && continue
1175+
1176+
chmod "${filemode}" "${i}"
1177+
done
1178+
}

func/rebuild.sh

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ rebuild_user_conf() {
8282

8383
chmod a+x $HOMEDIR/$user
8484
chmod a+x $HOMEDIR/$user/conf
85-
chown $user:$user \
85+
chown --no-dereference $user:$user \
8686
$HOMEDIR/$user \
8787
$HOMEDIR/$user/.config \
8888
$HOMEDIR/$user/.cache \
@@ -119,7 +119,7 @@ rebuild_user_conf() {
119119
chmod 751 $HOMEDIR/$user/conf/web
120120
chmod 751 $HOMEDIR/$user/web
121121
chmod 771 $HOMEDIR/$user/tmp
122-
chown $user:$user $HOMEDIR/$user/web
122+
chown --no-dereference $user:$user $HOMEDIR/$user/web
123123
if [ -z "$create_user" ]; then
124124
$BIN/v-rebuild-web-domains $user $restart
125125
fi
@@ -244,7 +244,7 @@ rebuild_web_domain_conf() {
244244
fi
245245

246246
# Set ownership
247-
chown $user:$user \
247+
chown --no-dereference $user:$user \
248248
$HOMEDIR/$user/web/$domain \
249249
$HOMEDIR/$user/web/$domain/private \
250250
$HOMEDIR/$user/web/$domain/cgi-bin \
@@ -404,18 +404,17 @@ rebuild_web_domain_conf() {
404404
done
405405

406406
# Set folder permissions
407-
chmod 551 $HOMEDIR/$user/web/$domain \
407+
no_symlink_chmod 551 $HOMEDIR/$user/web/$domain \
408408
$HOMEDIR/$user/web/$domain/stats \
409409
$HOMEDIR/$user/web/$domain/logs
410-
chmod 751 $HOMEDIR/$user/web/$domain/private \
410+
no_symlink_chmod 751 $HOMEDIR/$user/web/$domain/private \
411411
$HOMEDIR/$user/web/$domain/cgi-bin \
412412
$HOMEDIR/$user/web/$domain/public_html \
413413
$HOMEDIR/$user/web/$domain/public_shtml \
414414
$HOMEDIR/$user/web/$domain/document_errors
415415
chmod 640 /var/log/$WEB_SYSTEM/domains/$domain.*
416416

417-
chown $user:www-data $HOMEDIR/$user/web/$domain/public_html \
418-
$HOMEDIR/$user/web/$domain/public_shtml
417+
chown --no-dereference $user:www-data $HOMEDIR/$user/web/$domain/public_*html
419418
}
420419

421420
# DNS domain rebuild

install/hst-install-debian.sh

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ HESTIA_INSTALL_DIR="$HESTIA/install/deb"
2323
VERBOSE='no'
2424

2525
# Define software versions
26-
HESTIA_INSTALL_VER='1.3.2'
26+
HESTIA_INSTALL_VER='1.3.3'
2727
pma_v='5.0.4'
2828
multiphp_v=("5.6" "7.0" "7.1" "7.2" "7.3" "7.4" "8.0")
2929
fpm_v="7.4"
@@ -949,6 +949,12 @@ mkdir -p /etc/sudoers.d
949949
cp -f $HESTIA_INSTALL_DIR/sudo/admin /etc/sudoers.d/
950950
chmod 440 /etc/sudoers.d/admin
951951

952+
# Add Hestia global config
953+
if [[ ! -e /etc/hestiacp/hestia.conf ]]; then
954+
mkdir -p /etc/hestiacp
955+
echo -e "# Do not edit this file, will get overwritten on next upgrade, use /etc/hestiacp/local.conf instead\n\nexport HESTIA='/usr/local/hestia'\n\n[[ -f /etc/hestiacp/local.conf ]] && source /etc/hestiacp/local.conf" > /etc/hestiacp/hestia.conf
956+
fi
957+
952958
# Configuring system env
953959
echo "export HESTIA='$HESTIA'" > /etc/profile.d/hestia.sh
954960
echo 'PATH=$PATH:'$HESTIA'/bin' >> /etc/profile.d/hestia.sh

install/hst-install-ubuntu.sh

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ HESTIA_INSTALL_DIR="$HESTIA/install/deb"
2323
VERBOSE='no'
2424

2525
# Define software versions
26-
HESTIA_INSTALL_VER='1.3.2'
26+
HESTIA_INSTALL_VER='1.3.3'
2727
pma_v='5.0.4'
2828
multiphp_v=("5.6" "7.0" "7.1" "7.2" "7.3" "7.4" "8.0")
2929
fpm_v="7.4"
@@ -1006,6 +1006,12 @@ mkdir -p /etc/sudoers.d
10061006
cp -f $HESTIA_INSTALL_DIR/sudo/admin /etc/sudoers.d/
10071007
chmod 440 /etc/sudoers.d/admin
10081008

1009+
# Add Hestia global config
1010+
if [[ ! -e /etc/hestiacp/hestia.conf ]]; then
1011+
mkdir -p /etc/hestiacp
1012+
echo -e "# Do not edit this file, will get overwritten on next upgrade, use /etc/hestiacp/local.conf instead\n\nexport HESTIA='/usr/local/hestia'\n\n[[ -f /etc/hestiacp/local.conf ]] && source /etc/hestiacp/local.conf" > /etc/hestiacp/hestia.conf
1013+
fi
1014+
10091015
# Configuring system env
10101016
echo "export HESTIA='$HESTIA'" > /etc/profile.d/hestia.sh
10111017
echo 'PATH=$PATH:'$HESTIA'/bin' >> /etc/profile.d/hestia.sh

install/upgrade/upgrade.conf

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,21 +21,21 @@
2121
# Update default templates when performing an upgrade
2222
# These flags should be set to true if any changes are made to the template files
2323
# to ensure that they are properly updated on the end-user's system.
24-
UPGRADE_UPDATE_WEB_TEMPLATES='true'
24+
UPGRADE_UPDATE_WEB_TEMPLATES='false'
2525
UPGRADE_UPDATE_MAIL_TEMPLATES='false'
2626
UPGRADE_UPDATE_DNS_TEMPLATES='false'
2727

2828
# Update phpMyAdmin to the latest version during upgrade
29-
UPGRADE_UPDATE_PHPMYADMIN='true'
29+
UPGRADE_UPDATE_PHPMYADMIN='false'
3030

3131
# Update the File Manager or it's configuration file
3232
# UPGRADE_UPDATE_FILEMANAGER: Performs an upgrade/repair install of the File Manager
3333
# UPGRADE_UPDATE_FILEMANAGER: Updates only the configuration file
3434
UPGRADE_UPDATE_FILEMANAGER='false'
35-
UPGRADE_UPDATE_FILEMANAGER_CONFIG='true'
35+
UPGRADE_UPDATE_FILEMANAGER_CONFIG='false'
3636

3737
# Post installation clean-up
38-
UPGRADE_REBUILD_USERS='false'
38+
UPGRADE_REBUILD_USERS='true'
3939
UPGRADE_RESTART_SERVICES='true'
4040

4141
#######################################################################################

0 commit comments

Comments
 (0)