Skip to content

Commit 0c2b28f

Browse files
author
Kristan Kenney
committed
Sync with upstream development branch
2 parents f9b7a13 + 15aedff commit 0c2b28f

File tree

21 files changed

+112
-40
lines changed

21 files changed

+112
-40
lines changed

bin/v-add-letsencrypt-domain

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,9 @@ fi
125125
url="$LE_API/acme/new-order"
126126
payload='{"identifiers":['
127127
for identifier in $(echo $domain,$aliases |tr ',' '\n' |sort -u); do
128+
if [[ "$identifier" = *[![:ascii:]]* ]]; then
129+
identifier=$(idn -t --quiet -a $identifier)
130+
fi
128131
payload=$payload'{"type":"dns","value":"'$identifier'"},'
129132
done
130133
payload=$(echo "$payload"|sed "s/,$//")

func/rebuild.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -667,7 +667,7 @@ rebuild_pgsql_database() {
667667
query="GRANT ALL PRIVILEGES ON DATABASE $DB TO $DBUSER"
668668
psql -h $HOST -U $USER -c "$query" > /dev/null 2>&1
669669

670-
query="GRANT CONNECT ON DATABASE template1 to $dbuser"
670+
query="GRANT CONNECT ON DATABASE template1 to $DBUSER"
671671
psql -h $HOST -U $USER -c "$query" > /dev/null 2>&1
672672
}
673673

install/hst-install-debian.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1108,7 +1108,7 @@ if [ "$nginx" = 'yes' ]; then
11081108
v_tpl=$(echo "$v" | sed -e 's/[.]//')
11091109
cp -f $hestiacp/multiphp/nginx/PHP-$v_tpl.* $HESTIA/data/templates/web/nginx/
11101110
cp -f $hestiacp/php-fpm/dummy.conf /etc/php/$v/fpm/pool.d/
1111-
sed -i "/s/9999/9999$v_tpl/g" /etc/php/$v/fpm/pool.d/dummy.conf
1111+
sed -i "s/9999/99$v_tpl/g" /etc/php/$v/fpm/pool.d/dummy.conf
11121112
done
11131113
cp -f $hestiacp/php-fpm/www.conf /etc/php/$fpm_v/fpm/pool.d/
11141114
chmod a+x $HESTIA/data/templates/web/nginx/*.sh

install/hst-install-ubuntu.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1076,7 +1076,7 @@ if [ "$nginx" = 'yes' ]; then
10761076
v_tpl=$(echo "$v" | sed -e 's/[.]//')
10771077
cp -f $hestiacp/multiphp/nginx/PHP-$v_tpl.* $HESTIA/data/templates/web/nginx/
10781078
cp -f $hestiacp/php-fpm/dummy.conf /etc/php/$v/fpm/pool.d/
1079-
sed -i "/s/9999/9999$v_tpl/g" /etc/php/$v/fpm/pool.d/dummy.conf
1079+
sed -i "s/9999/99$v_tpl/g" /etc/php/$v/fpm/pool.d/dummy.conf
10801080
done
10811081
cp -f $hestiacp/php-fpm/www.conf /etc/php/$fpm_v/fpm/pool.d/
10821082
chmod a+x $HESTIA/data/templates/web/nginx/*.sh

install/upgrade/0.9.8-29.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ if [ "$php_versions" -gt 1 ]; then
233233
for v in $(ls /etc/php/); do
234234
cp -f $hestiacp/php-fpm/dummy.conf /etc/php/$d/fpm/pool.d/
235235
v1=$(echo "$v" | sed -e 's/[.]//')
236-
sed -i "s/9999/9999$v1/g" /etc/php/$v/fpm/pool.d/dummy.conf
236+
sed -i "s/9999/99$v1/g" /etc/php/$v/fpm/pool.d/dummy.conf
237237
done
238238
fi
239239

src/hst_autocompile.sh

Lines changed: 42 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
# Autocompile Script for HestiaCP deb Files.
22

33
# Set compiling directory
4-
BUILD_DIR='/root'
4+
BUILD_DIR='/tmp/hestiacp-src/'
5+
DEB_DIR="$BUILD_DIR/debs/"
56
INSTALL_DIR='/usr/local/hestia'
67

78
# Set Version for compiling
@@ -12,6 +13,10 @@ PCRE_V='8.42'
1213
ZLIB_V='1.2.11'
1314
PHP_V='7.3.4'
1415

16+
# Create build directories
17+
rm -rf $BUILD_DIR
18+
mkdir -p $DEB_DIR
19+
1520
# Set package dependencies for compiling
1621
SOFTWARE='build-essential libxml2-dev libz-dev libcurl4-gnutls-dev unzip openssl libssl-dev pkg-config'
1722

@@ -20,6 +25,24 @@ timestamp() {
2025
date +%s
2126
}
2227

28+
branch=$2
29+
install=$3
30+
31+
# Set install flags
32+
if [ ! -z "$2" ]; then
33+
branch=$2
34+
else
35+
echo -n "Please enter the name of the branch to build from (e.g. master): "
36+
read branch
37+
fi
38+
39+
if [ ! -z "$3" ]; then
40+
install=$3
41+
else
42+
echo -n 'Would you like to install the compiled packages? [y/N] '
43+
read install
44+
fi
45+
2346
# Install needed software
2447
echo "Updating system APT repositories..."
2548
apt-get -qq update > /dev/null 2>&1
@@ -55,22 +78,22 @@ for arg; do
5578
done
5679

5780
if [[ $# -eq 0 ]] ; then
58-
echo "(!) Invalid compilation flag specified. Valid flags:"
59-
echo "--all"
60-
echo "--hestia"
61-
echo "--nginx"
62-
echo "--php"
81+
echo "ERROR: Invalid compilation flag specified. Valid flags include:"
82+
echo "--all: Build all hestia packages."
83+
echo "--hestia: Build only the Control Panel package."
84+
echo "--nginx: Build only the backend nginx engine package."
85+
echo "--php: Build only the backend php engine package"
86+
echo ""
87+
echo "For automated builds and installatioms, you may specify the branch"
88+
echo "after one of the above flags. To install the packages, specify 'Y'"
89+
echo "following the branch name."
90+
echo ""
91+
echo "Example: bash hst_autocompile.sh --hestia develop Y"
92+
echo "This would install a Hestia Control Panel package compiled with the"
93+
echo "develop branch code."
6394
exit 1
6495
fi
6596

66-
# Ask for branch
67-
echo -n "Please enter the name of the branch to build from (e.g. master): "
68-
read branch
69-
70-
# Ask if package should be installed after compilation
71-
echo -n 'Would you like to install the compiled packages? [y/N] '
72-
read INSTALL
73-
7497
# Set git repository raw path
7598
GIT_REP='https://raw.githubusercontent.com/hestiacp/hestiacp/'$branch'/src/deb'
7699

@@ -171,6 +194,7 @@ if [ "$NGINX_B" = true ] ; then
171194
cd $BUILD_DIR
172195
chown -R root:root hestia-nginx_$NGINX_V
173196
dpkg-deb --build hestia-nginx_$NGINX_V
197+
mv *.deb $DEB_DIR
174198

175199
# clear up the source folder
176200
rm -r hestia-nginx_$NGINX_V
@@ -245,6 +269,7 @@ if [ "$PHP_B" = true ] ; then
245269
cd $BUILD_DIR
246270
chown -R root:root hestia-php_$PHP_V
247271
dpkg-deb --build hestia-php_$PHP_V
272+
mv *.deb $DEB_DIR
248273

249274
# clear up the source folder
250275
rm -r hestia-php_$PHP_V
@@ -300,6 +325,7 @@ if [ "$HESTIA_B" = true ] ; then
300325
cd $BUILD_DIR
301326
chown -R root:root hestia_$HESTIA_V
302327
dpkg-deb --build hestia_$HESTIA_V
328+
mv *.deb $DEB_DIR
303329

304330
# clear up the source folder
305331
rm -r hestia_$HESTIA_V
@@ -313,8 +339,8 @@ fi
313339
#
314340
#################################################################################
315341

316-
if [ "$INSTALL" = 'y' ] || [ "$INSTALL" = 'Y' ]; then
317-
for i in $BUILD_DIR/*hestia*.deb; do
342+
if [ "$install" = 'yes' ] || [ "$install" = 'YES' ] || [ "$install" = 'y' ] || [ "$install" = 'Y' ]; then
343+
for i in $DEB_DIR/*.deb; do
318344
# Install all available packages
319345
dpkg -i $i
320346
done

web/add/cron/autoupdate/index.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@
55
session_start();
66
include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");
77

8+
// Check token
9+
if ((!isset($_GET['token'])) || ($_SESSION['token'] != $_GET['token'])) {
10+
header('location: /login/');
11+
exit();
12+
}
13+
814
if ($_SESSION['user'] == 'admin') {
915
exec (HESTIA_CMD."v-add-cron-hestia-autoupdate", $output, $return_var);
1016
$_SESSION['error_msg'] = __('Autoupdate has been successfully enabled');

web/add/cron/reports/index.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@
55
session_start();
66
include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");
77

8+
// Check token
9+
if ((!isset($_GET['token'])) || ($_SESSION['token'] != $_GET['token'])) {
10+
header('location: /login/');
11+
exit();
12+
}
13+
814
exec (HESTIA_CMD."v-add-cron-reports ".$user, $output, $return_var);
915
$_SESSION['error_msg'] = __('Cronjob email reporting has been successfully enabled');
1016
unset($output);

web/add/firewall/banlist/index.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@
66
// Main include
77
include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");
88

9+
// Check token
10+
if ((!isset($_GET['token'])) || ($_SESSION['token'] != $_GET['token'])) {
11+
header('location: /login/');
12+
exit();
13+
}
14+
915
// Check user
1016
if ($_SESSION['user'] != 'admin') {
1117
header("Location: /list/user");

web/delete/cron/autoupdate/index.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@
55
session_start();
66
include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");
77

8+
// Check token
9+
if ((!isset($_GET['token'])) || ($_SESSION['token'] != $_GET['token'])) {
10+
header('location: /login/');
11+
exit();
12+
}
13+
814
if ($_SESSION['user'] == 'admin') {
915
exec (HESTIA_CMD."v-delete-cron-hestia-autoupdate", $output, $return_var);
1016
$_SESSION['error_msg'] = __('Autoupdate has been successfully disabled');

0 commit comments

Comments
 (0)