Просмотр исходного кода

Merge branch 'main' into staging/fixes

Raphael Schneeberger 5 лет назад
Родитель
Сommit
b52c4f8798

+ 2 - 0
bin/v-change-sys-config-value

@@ -23,6 +23,8 @@ source $HESTIA/conf/hestia.conf
 
 PATH="$PATH:/usr/local/sbin:/sbin:/usr/sbin:/root/bin"
 
+# Perform verification if read-only mode is enabled
+check_hestia_demo_mode
 
 #----------------------------------------------------------#
 #                    Verifications                         #

+ 0 - 8
install/deb/nginx/nginx.conf

@@ -131,14 +131,6 @@ http {
     proxy_cache_use_stale error timeout invalid_header http_502;
     proxy_cache_valid any 1d;
 
-    # FastCGI Cache settings
-    fastcgi_cache_path /var/cache/nginx/php-fpm levels=2 keys_zone=cache:10m inactive=60m max_size=1024m;
-    fastcgi_cache_key "$host$request_uri $cookie_user";
-    fastcgi_temp_path  /var/cache/nginx/temp;
-    fastcgi_ignore_headers Expires Cache-Control;
-    fastcgi_cache_use_stale error timeout invalid_header;
-    fastcgi_cache_valid any 1d;
-
     # Cache bypass
     map $http_cookie $no_cache {
         default 0;

+ 1 - 1
install/deb/templates/web/nginx/caching.stpl

@@ -17,7 +17,7 @@ server {
     location / {
         proxy_pass      https://%ip%:%web_ssl_port%;
 
-        proxy_cache %domain%;
+        proxy_cache cache;
         proxy_cache_valid 15m;
         proxy_cache_valid 404 1m;
         proxy_no_cache $no_cache;

+ 1 - 1
install/deb/templates/web/nginx/caching.tpl

@@ -12,7 +12,7 @@ server {
     location / {
         proxy_pass      http://%ip%:%web_port%;
 
-        proxy_cache %domain%;
+        proxy_cache cache;
         proxy_cache_valid 15m;
         proxy_cache_valid 404 1m;
         proxy_no_cache $no_cache;

+ 0 - 19
install/deb/templates/web/nginx/php-fpm/caching.sh

@@ -1,19 +0,0 @@
-#!/bin/bash
-
-user=$1
-domain=$2
-ip=$3
-home=$4
-docroot=$5
-
-str="fastcgi_cache_path /var/cache/nginx/php-fpm/$domain levels=2" 
-str="$str keys_zone=$domain:10m inactive=60m max_size=512m;" 
-conf='/etc/nginx/conf.d/01_caching_pool.conf'
-if [ -e "$conf" ]; then
-    if [ -z "$(grep "=${domain}:" $conf)" ]; then
-        echo "$str" >> $conf
-    fi
-else
-    echo "$str" >> $conf
-fi
-

+ 0 - 63
install/deb/templates/web/nginx/php-fpm/caching.stpl

@@ -1,63 +0,0 @@
-#=======================================================================#
-# Default Web Domain Template                                           #
-# DO NOT MODIFY THIS FILE! CHANGES WILL BE LOST WHEN REBUILDING DOMAINS #
-#=======================================================================#
-
-server {
-    listen      %ip%:%web_ssl_port% ssl http2;
-    server_name %domain_idn% %alias_idn%;
-    root        %sdocroot%;
-    index       index.php index.html index.htm;
-    access_log  /var/log/nginx/domains/%domain%.log combined;
-    access_log  /var/log/nginx/domains/%domain%.bytes bytes;
-    error_log   /var/log/nginx/domains/%domain%.error.log error;
-
-    ssl_certificate      %ssl_pem%;
-    ssl_certificate_key  %ssl_key%;
-    ssl_stapling on;
-    ssl_stapling_verify on;
-
-    include %home%/%user%/conf/web/%domain%/nginx.hsts.conf*;
-
-    location / {
-
-        location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
-            expires     max;
-            fastcgi_hide_header "Set-Cookie";
-        }
-
-        location ~ [^/]\.php(/|$) {
-            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
-            if (!-f $document_root$fastcgi_script_name) {
-                return  404;
-            }
-
-            fastcgi_pass    %backend_lsnr%;
-            fastcgi_index   index.php;
-            include         /etc/nginx/fastcgi_params;
-
-            fastcgi_cache %domain%;
-            fastcgi_no_cache $no_cache;
-            fastcgi_cache_bypass $no_cache;
-            fastcgi_cache_bypass $cookie_session $http_x_update;
-        }
-    }
-
-    location /error/ {
-        alias   %home%/%user%/web/%domain%/document_errors/;
-    }
-
-    location ~* "/\.(htaccess|htpasswd)$" {
-        deny    all;
-        return  404;
-    }
-
-    location /vstats/ {
-        alias   %home%/%user%/web/%domain%/stats/;
-        include %home%/%user%/web/%domain%/stats/auth.conf*;
-    }
-
-    include     /etc/nginx/conf.d/phpmyadmin.inc*;
-    include     /etc/nginx/conf.d/phppgadmin.inc*;
-    include     %home%/%user%/conf/web/%domain%/nginx.ssl.conf_*;
-}

+ 0 - 58
install/deb/templates/web/nginx/php-fpm/caching.tpl

@@ -1,58 +0,0 @@
-#=======================================================================#
-# Default Web Domain Template                                           #
-# DO NOT MODIFY THIS FILE! CHANGES WILL BE LOST WHEN REBUILDING DOMAINS #
-#=======================================================================#
-
-server {
-    listen      %ip%:%web_port%;
-    server_name %domain_idn% %alias_idn%;
-    root        %docroot%;
-    index       index.php index.html index.htm;
-    access_log  /var/log/nginx/domains/%domain%.log combined;
-    access_log  /var/log/nginx/domains/%domain%.bytes bytes;
-    error_log   /var/log/nginx/domains/%domain%.error.log error;
-        
-    include %home%/%user%/conf/web/%domain%/nginx.forcessl.conf*;
-
-    location / {
-
-        location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
-            expires     max;
-            fastcgi_hide_header "Set-Cookie";
-        }
-
-        location ~ [^/]\.php(/|$) {
-            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
-            if (!-f $document_root$fastcgi_script_name) {
-                return  404;
-            }
-
-            fastcgi_pass    %backend_lsnr%;
-            fastcgi_index   index.php;
-            include         /etc/nginx/fastcgi_params;
-
-            fastcgi_cache %domain%;
-            fastcgi_no_cache $no_cache;
-            fastcgi_cache_bypass $no_cache;
-            fastcgi_cache_bypass $cookie_session $http_x_update;
-        }
-    }
-
-    location /error/ {
-        alias   %home%/%user%/web/%domain%/document_errors/;
-    }
-
-    location ~* "/\.(htaccess|htpasswd)$" {
-        deny    all;
-        return  404;
-    }
-
-    location /vstats/ {
-        alias   %home%/%user%/web/%domain%/stats/;
-        include %home%/%user%/web/%domain%/stats/auth.conf*;
-    }
-
-    include     /etc/nginx/conf.d/phpmyadmin.inc*;
-    include     /etc/nginx/conf.d/phppgadmin.inc*;
-    include     %home%/%user%/conf/web/%domain%/nginx.conf_*;
-}

+ 1 - 1
src/deb/hestia/control

@@ -1,7 +1,7 @@
 Source: hestia
 Package: hestia
 Priority: optional
-Version: 1.3.1
+Version: 1.3.1~RC
 Section: admin
 Maintainer: HestiaCP <info@hestiacp.com>
 Homepage: https://www.hestiacp.com

+ 1 - 1
src/deb/php/control

@@ -1,7 +1,7 @@
 Source: hestia-php
 Package: hestia-php
 Priority: optional
-Version: 7.4.12
+Version: 7.4.12-1
 Section: admin
 Maintainer: HestaCP <info@hestiacp.com>
 Homepage: https://www.hestiacp.com

+ 3 - 3
src/hst_autocompile.sh

@@ -180,7 +180,7 @@ NGINX='https://nginx.org/download/nginx-'$(echo $NGINX_V |cut -d"~" -f1)'.tar.gz
 OPENSSL='https://www.openssl.org/source/openssl-'$OPENSSL_V'.tar.gz'
 PCRE='https://ftp.pcre.org/pub/pcre/pcre-'$PCRE_V'.tar.gz'
 ZLIB='https://www.zlib.net/zlib-'$ZLIB_V'.tar.gz'
-PHP='http://de2.php.net/distributions/php-'$(echo $PHP_V |cut -d"-" -f1)'.tar.gz'
+PHP='http://de2.php.net/distributions/php-'$(echo $PHP_V |cut -d"~" -f1)'.tar.gz'
 
 # Forward slashes in branchname are replaced with dashes to match foldername in github archive.
 branch=$(echo "$branch" |sed 's/\//-/g');
@@ -330,7 +330,7 @@ if [ "$PHP_B" = true ] ; then
     download_file $PHP '-' | tar xz
 
     # Change to php directory
-    cd php-$(echo $PHP_V |cut -d"-" -f1)
+    cd php-$(echo $PHP_V |cut -d"~" -f1)
 
     # Configure PHP
     ./configure   --prefix=/usr/local/hestia/php \
@@ -355,7 +355,7 @@ if [ "$PHP_B" = true ] ; then
 
     # Cleare up unused files
     cd $BUILD_DIR
-    rm -r php-$(echo $PHP_V |cut -d"-" -f1)
+    rm -r php-$(echo $PHP_V |cut -d"~" -f1)
 
     # Prepare Deb Package Folder Structure
     cd hestia-php_$PHP_V/

+ 5 - 2
web/add/user/index.php

@@ -123,8 +123,11 @@ unset($output);
 
 // List languages
 exec (HESTIA_CMD."v-list-sys-languages json", $output, $return_var);
-$languages = json_decode(implode('', $output), true);
-unset($output);
+$language = json_decode(implode('', $output), true);
+foreach($language as $lang){
+    $languages[$lang] = translate_json($lang);
+}
+asort($languages);
 
 // Render page
 render_page($user, $TAB, 'add_user');

+ 6 - 2
web/edit/server/index.php

@@ -91,9 +91,13 @@ $v_php_versions = array_map(function($php_version) use ($backend_templates, $bac
     return $phpinfo;
 }, $v_php_versions);
 
-// List supported languages
+// List languages
 exec (HESTIA_CMD."v-list-sys-languages json", $output, $return_var);
-$languages = json_decode(implode('', $output), true);
+$language = json_decode(implode('', $output), true);
+foreach($language as $lang){
+    $languages[$lang] = translate_json($lang);
+}
+asort($languages);
 unset($output);
 
 // List themes

+ 5 - 1
web/edit/user/index.php

@@ -70,7 +70,11 @@ unset($output);
 
 // List languages
 exec (HESTIA_CMD."v-list-sys-languages json", $output, $return_var);
-$languages = json_decode(implode('', $output), true);
+$language = json_decode(implode('', $output), true);
+foreach($language as $lang){
+    $languages[$lang] = translate_json($lang);
+}
+asort($languages);
 unset($output);
 
 // List shells

+ 11 - 1
web/inc/i18n.php

@@ -25,7 +25,17 @@ function detect_user_language() {
        return 'en';
    }
 }
-
+/**
+ * Translate ISO2 to "Language" 
+ * nl = Dutch, de = German
+ * @param string iso2 code
+ * @return string Language
+ */
+function translate_json($string){
+    $json = file_get_contents($_SERVER['DOCUMENT_ROOT'].'/locale/languages.json');
+    $json_a = json_decode($json, true);
+    return $json_a[$string][0] .' ('.$json_a[$string.'_locale'][0].')';
+}
 /**
  * Detects user language .
  * @param string Fallback language (default: 'en')

Разница между файлами не показана из-за своего большого размера
+ 0 - 0
web/locale/languages.json


+ 3 - 4
web/templates/admin/add_user.html

@@ -154,13 +154,12 @@
                                     <select class="vst-list" name="v_language" tabindex="7" >
                                         <?php
                                             foreach ($languages as $key => $value) {
-                                                echo "\n\t\t\t\t\t\t\t\t\t<option value=\"".htmlentities($value)."\"";
-                                                $svalue = "'".$value."'";
-                                                if (( $value == $_SESSION['LANGUAGE'] ) && (empty($v_language))){
+                                                echo "\n\t\t\t\t\t\t\t\t\t<option value=\"".htmlentities($key)."\"";
+                                                if (( $key == $_SESSION['LANGUAGE'] ) && (empty($v_language))){
                                                     echo ' selected' ;
                                                 }
                                                 if (isset($v_language)){
-                                                    if (( $value == $v_language ) || ( $svalue == $v_language)){
+                                                    if ( $key == $v_language ){
                                                         echo ' selected' ;
                                                     }
                                                 }

+ 6 - 6
web/templates/admin/edit_server.html

@@ -131,14 +131,14 @@
                                                 <select class="vst-list" name="v_language">
                                                     <?php
                                                         foreach ($languages as $key => $value) {
-                                                            echo "\t\t\t\t<option value=\"".$value."\"";
-                                                            if ((!empty($_SESSION['LANGUAGE'])) && ( $value == $_SESSION['LANGUAGE'])){
-                                                                echo ' selected' ;
+                                                            echo "\n\t\t\t\t\t\t\t\t\t<option value=\"".$key."\"";
+                                                            if ( $key == $v_language ){
+                                                                echo 'selected' ;
                                                             }
-                                                            if ((!empty($_SESSION['LANGUAGE'])) && ( $value == $_POST['v_language'])){
-                                                                echo ' selected' ;
+                                                            if (( $key == detect_user_language() ) && (empty($v_language))){
+                                                                echo 'selected' ;
                                                             }
-                                                            echo ">".$value."</option>\n";
+                                                            echo ">".htmlentities($value)."</option>\n";
                                                         }
                                                     ?>
                                                 </select>

+ 4 - 4
web/templates/admin/edit_user.html

@@ -163,12 +163,12 @@
                                     <select class="vst-list" name="v_language">
                                         <?php
                                             foreach ($languages as $key => $value) {
-                                                echo "\n\t\t\t\t\t\t\t\t\t<option value=\"".$value."\"";
-                                                $svalue = "'".$value."'";
-                                                if (( $value == $v_language ) || ( $svalue == $v_language)){
+                                                echo "\n\t\t\t\t\t\t\t\t\t<option value=\"".$key."\"";
+                                                $skey = "'".$key."'";
+                                                if (( $key == $v_language ) || ( $skey == $v_language)){
                                                     echo 'selected' ;
                                                 }
-                                                if (( $value == detect_user_language() ) && (empty($v_language))){
+                                                if (( $key == detect_user_language() ) && (empty($v_language))){
                                                     echo 'selected' ;
                                                 }
                                                 echo ">".htmlentities($value)."</option>\n";

+ 3 - 4
web/templates/user/edit_user.html

@@ -127,12 +127,11 @@
                                     <select class="vst-list" name="v_language">
                                         <?php
                                             foreach ($languages as $key => $value) {
-                                                echo "\n\t\t\t\t\t\t\t\t\t<option value=\"".$value."\"";
-                                                $svalue = "'".$value."'";
-                                                if (( $value == $v_language ) || ( $svalue == $v_language)){
+                                                echo "\n\t\t\t\t\t\t\t\t\t<option value=\"".$key."\"";
+                                                if ( $key == $v_language ){
                                                     echo 'selected' ;
                                                 }
-                                                if (( $value == detect_user_language() ) && (empty($v_language))){
+                                                if (( $key == detect_user_language() ) && (empty($v_language))){
                                                     echo 'selected' ;
                                                 }
                                                 echo ">".htmlentities($value)."</option>\n";

Некоторые файлы не были показаны из-за большого количества измененных файлов