Skip to content

Commit e2d7eb9

Browse files
authored
2072 Disable access phpmyadmin on ip (hestiacp#2227)
* 2072 Disable access phpmyadmin on ip + phppgadmin * Due changes in php8.1 change order of implode
1 parent 2f79dcd commit e2d7eb9

File tree

18 files changed

+37
-31
lines changed

18 files changed

+37
-31
lines changed

bin/v-change-sys-db-alias

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -50,15 +50,14 @@ check_hestia_demo_mode
5050
if [ "$type" = "pma" ] || [ "$type" = "PMA" ] || [ "$type" = "phpmyadmin" ]; then
5151
# Set database editor friendly name
5252
db_editor="phpMyAdmin"
53-
5453
# Set new alias value
5554
$BIN/v-change-sys-config-value 'DB_PMA_ALIAS' "$alias"
5655

5756
# Replace old configuration files and update alias
58-
if [ -e "/etc/apache2/conf.d/phpmyadmin.conf" ]; then
59-
rm -f /etc/apache2/conf.d/phpmyadmin.conf
60-
cp -f $HESTIA_INSTALL_DIR/pma/apache.conf /etc/apache2/conf.d/phpmyadmin.conf
61-
sed -i "s|%pma_alias%|$alias|g" /etc/apache2/conf.d/phpmyadmin.conf
57+
if [ -e "/etc/apache2/conf.d/phpmyadmin.inc" ]; then
58+
rm -f /etc/apache2/conf.d/phpmyadmin.inc
59+
cp -f $HESTIA_INSTALL_DIR/pma/apache.conf /etc/apache2/conf.d/phpmyadmin.inc
60+
sed -i "s|%pma_alias%|$alias|g" /etc/apache2/conf.d/phpmyadmin.inc
6261

6362
# Restart services
6463
$HESTIA/bin/v-restart-service apache2
@@ -83,10 +82,10 @@ if [ "$type" = "pga" ] || [ "$type" = "PGA" ] || [ "$type" = "phppgadmin" ]; the
8382
$BIN/v-change-sys-config-value 'DB_PGA_ALIAS' "$alias"
8483

8584
# Replace old configuration files and update alias
86-
if [ -e "/etc/apache2/conf.d/phppgadmin.conf" ]; then
87-
rm -f /etc/apache2/conf.d/phppgadmin.conf
88-
cp -f $HESTIA_INSTALL_DIR/pga/phppgadmin.conf /etc/apache2/conf.d/phppgadmin.conf
89-
sed -i "s|%pga_alias%|$alias|g" /etc/apache2/conf.d/phppgadmin.conf
85+
if [ -e "/etc/apache2/conf.d/phppgadmin.inc" ]; then
86+
rm -f /etc/apache2/conf.d/phppgadmin.inc
87+
cp -f $HESTIA_INSTALL_DIR/pga/phppgadmin.conf /etc/apache2/conf.d/phppgadmin.inc
88+
sed -i "s|%pga_alias%|$alias|g" /etc/apache2/conf.d/phppgadmin.inc
9089

9190
# Restart services
9291
$HESTIA/bin/v-restart-service apache2

func/backup.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -434,12 +434,12 @@ b2_backup() {
434434
echo -e "$(date "+%F %T") Upload to B2: $user/$user.$backup_new_date.tar"
435435
if [ "$localbackup" = 'yes' ]; then
436436
cd $BACKUP
437-
b2 upload-file $BUCKET $user.$backup_new_date.tar $user/$user.$backup_new_date.tar > /dev/null 2>&1
437+
b2 upload-file $BUCKET $user.$backup_new_date.tar $user/$user.tar
438438
else
439439
cd $tmpdir
440440
tar -cf $BACKUP/$user.$backup_new_date.tar .
441441
cd $BACKUP/
442-
b2 upload-file $BUCKET $user.$backup_new_date.tar $user/$user.$backup_new_date.tar > /dev/null 2>&1
442+
b2 upload-file $BUCKET $user.$backup_new_date.tar $user/$user.tar
443443
rc=$?
444444
rm -f $user.$backup_new_date.tar
445445
if [ "$rc" -ne 0 ]; then

install/deb/phpmyadmin/hestia-sso.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ public function get_user_ip()
113113
$user_combined_ip[] = $_SERVER['HTTP_CF_CONNECTING_IP'];
114114
}
115115
}
116-
return implode($user_combined_ip, '|');
116+
return implode('|',$user_combined_ip);
117117
}
118118
}
119119

install/deb/templates/web/apache2/default.stpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,6 @@
4444
</IfModule>
4545

4646
IncludeOptional %home%/%user%/conf/web/%domain%/%web_system%.ssl.conf_*
47-
47+
IncludeOptional /etc/apache2/conf.d/*.inc
4848
</VirtualHost>
4949

install/deb/templates/web/apache2/default.tpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,6 @@
4141
</IfModule>
4242

4343
IncludeOptional %home%/%user%/conf/web/%domain%/%web_system%.conf_*
44-
44+
IncludeOptional /etc/apache2/conf.d/*.inc
4545
</VirtualHost>
4646

install/deb/templates/web/apache2/hosting.stpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,6 @@
5050
</IfModule>
5151

5252
IncludeOptional %home%/%user%/conf/web/%domain%/%web_system%.ssl.conf_*
53-
53+
IncludeOptional /etc/apache2/conf.d/*.inc*
5454
</VirtualHost>
5555

install/deb/templates/web/apache2/hosting.tpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,6 @@
4747
</IfModule>
4848

4949
IncludeOptional %home%/%user%/conf/web/%domain%/%web_system%.conf_*
50-
50+
IncludeOptional /etc/apache2/conf.d/*.inc
5151
</VirtualHost>
5252

install/deb/templates/web/apache2/php-fpm/default.stpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,6 @@
3636
SetEnvIf Authorization .+ HTTP_AUTHORIZATION=$0
3737

3838
IncludeOptional %home%/%user%/conf/web/%domain%/%web_system%.ssl.conf_*
39-
39+
IncludeOptional /etc/apache2/conf.d/*.inc
4040
</VirtualHost>
4141

install/deb/templates/web/apache2/php-fpm/default.tpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,6 @@
3333
SetEnvIf Authorization .+ HTTP_AUTHORIZATION=$0
3434

3535
IncludeOptional %home%/%user%/conf/web/%domain%/%web_system%.conf_*
36-
36+
IncludeOptional /etc/apache2/conf.d/*.inc
3737
</VirtualHost>
3838

install/deb/templates/web/apache2/phpcgi.stpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,6 @@
3939
%ssl_ca_str%SSLCertificateChainFile %ssl_ca%
4040

4141
IncludeOptional %home%/%user%/conf/web/%domain%/%web_system%.ssl.conf_*
42-
42+
IncludeOptional /etc/apache2/conf.d/*.inc
4343
</VirtualHost>
4444

0 commit comments

Comments
 (0)