File tree Expand file tree Collapse file tree 15 files changed +127
-70
lines changed
Expand file tree Collapse file tree 15 files changed +127
-70
lines changed Original file line number Diff line number Diff line change @@ -132,7 +132,7 @@ if [ "$UPDATE" == "no" ]; then
132132 if [ ! -d $RC_LOG ]; then
133133 mkdir $RC_LOG
134134 fi
135- chown www-data:root $RC_LOG
135+ chown www-data:www-data $RC_LOG
136136 chmod 751 $RC_LOG
137137
138138 if [ ! -z " $( echo " $DB_SYSTEM " | grep -w ' mysql' ) " ]; then
Original file line number Diff line number Diff line change 1414
1515# Argument definition
1616user=$1
17- key=$( echo " $2 " | tr ' [:lower:]' ' [:upper:]' | sed " s/^/$/ " )
17+ key=$( echo " $2 " | tr ' [:lower:]' ' [:upper:]' )
1818
1919# Includes
2020# shellcheck source=/etc/hestiacp/hestia.conf
Original file line number Diff line number Diff line change @@ -50,9 +50,8 @@ if [ "$1" = 'scheduled' ] || [ -z "$1" ] && [ "$SCHEDULED_RESTART" = 'yes' ]; th
5050fi
5151
5252tmpfile=$( mktemp)
53- php_versions=$( ls /usr/sbin/php* fpm* | cut -d' /' -f4 | sed ' s|php-fpm||' )
5453# Substitute php-fpm service name formats
55- for version in $php_versions ; do
54+ for version in $( $BIN /v-list-sys-php plain ) ; do
5655 v_php=" php$version -fpm"
5756 if [ ! -f " /etc/php/${version} /fpm/pool.d/dummy.conf" ]; then
5857 cp -f " $HESTIA_INSTALL_DIR /php-fpm/dummy.conf" " /etc/php/${version} /fpm/pool.d/"
Original file line number Diff line number Diff line change @@ -85,11 +85,19 @@ if [ ! -e "$BACKUP/$backup" ]; then
8585 ftp_download " $backup "
8686 downloaded=' yes'
8787 fi
88+ if [[ " $BACKUP_SYSTEM " =~ " b2" ]] && [ -z " $downloaded " ]; then
89+ b2_download " $backup "
90+ downloaded=' yes'
91+ fi
8892 if [ -z " $downloaded " ]; then
8993 check_result " $E_NOTEXIST " " backup file $backup doesn't exist in '${BACKUP} ' folder"
9094 fi
9195fi
9296
97+ if [ ! -e " $BACKUP /$backup " ]; then
98+ check_result " $E_NOTEXIST " " backup file $backup doesn't exist in '${BACKUP} ' folder"
99+ fi
100+
93101# Checking user existence on the server
94102check_user=$( is_object_valid ' user' ' USER' " $user " )
95103if [ -z " $check_user " ]; then
Original file line number Diff line number Diff line change @@ -459,3 +459,17 @@ b2_backup() {
459459 done
460460 fi
461461}
462+
463+ b2_download () {
464+ # Defining backblaze b2 settings
465+ source_conf " $HESTIA /conf/b2.backup.conf"
466+
467+ # Recreate backblaze auth file ~/.b2_account_info (for situation when key was changed in b2.backup.conf)
468+ b2 clear-account > /dev/null 2>&1
469+ b2 authorize-account $B2_KEYID $B2_KEY > /dev/null 2>&1
470+ cd $BACKUP
471+ b2 download-file-by-name $BUCKET $user /$1 $1 > /dev/null 2>&1
472+ if [ " $? " -ne 0 ]; then
473+ check_result " $E_CONNECT " " b2 failed to download $user .$1 "
474+ fi
475+ }
Original file line number Diff line number Diff line change @@ -53,11 +53,10 @@ server {
5353 proxy_pass https://%ip%:%web_ssl_port%;
5454 }
5555
56- location ~ /\.ht {return 404;}
57- location ~ /\.svn/ {return 404;}
58- location ~ /\.git/ {return 404;}
59- location ~ /\.hg/ {return 404;}
60- location ~ /\.bzr/ {return 404;}
56+ location ~ /\.(?!well-known\/) {
57+ deny all;
58+ return 404;
59+ }
6160
6261 proxy_hide_header Upgrade;
6362
Original file line number Diff line number Diff line change @@ -48,11 +48,10 @@ server {
4848 proxy_pass http://% ip% :% web_port% ;
4949 }
5050
51- location ~ /\.ht { return 404;}
52- location ~ /\.svn/ { return 404;}
53- location ~ /\.git/ { return 404;}
54- location ~ /\.hg/ { return 404;}
55- location ~ /\.bzr/ { return 404;}
51+ location ~ /\.(?!well-known\/) {
52+ deny all;
53+ return 404;
54+ }
5655
5756 include %home%/%user%/conf/web/%domain%/nginx.conf_*;
5857}
Original file line number Diff line number Diff line change @@ -33,11 +33,10 @@ server {
3333 proxy_pass https://%ip%:%web_ssl_port%;
3434 }
3535
36- location ~ /\.ht {return 404;}
37- location ~ /\.svn/ {return 404;}
38- location ~ /\.git/ {return 404;}
39- location ~ /\.hg/ {return 404;}
40- location ~ /\.bzr/ {return 404;}
36+ location ~ /\.(?!well-known\/) {
37+ deny all;
38+ return 404;
39+ }
4140
4241 proxy_hide_header Upgrade;
4342
Original file line number Diff line number Diff line change @@ -28,11 +28,10 @@ server {
2828 proxy_pass http://% ip% :% web_port% ;
2929 }
3030
31- location ~ /\.ht { return 404;}
32- location ~ /\.svn/ { return 404;}
33- location ~ /\.git/ { return 404;}
34- location ~ /\.hg/ { return 404;}
35- location ~ /\.bzr/ { return 404;}
31+ location ~ /\.(?!well-known\/) {
32+ deny all;
33+ return 404;
34+ }
3635
3736 include %home%/%user%/conf/web/%domain%/nginx.conf_*;
3837}
Original file line number Diff line number Diff line change @@ -33,11 +33,10 @@ server {
3333 proxy_pass https://%ip%:%web_ssl_port%;
3434 }
3535
36- location ~ /\.ht {return 404;}
37- location ~ /\.svn/ {return 404;}
38- location ~ /\.git/ {return 404;}
39- location ~ /\.hg/ {return 404;}
40- location ~ /\.bzr/ {return 404;}
36+ location ~ /\.(?!well-known\/) {
37+ deny all;
38+ return 404;
39+ }
4140
4241 disable_symlinks if_not_owner from=%docroot%;
4342
You can’t perform that action at this time.
0 commit comments