Przeglądaj źródła

Version changes for nginx and php, merge autocompile scripts.

Raphael Schneeberger 7 lat temu
rodzic
commit
cc2a987921
5 zmienionych plików z 56 dodań i 510 usunięć
  1. 0 171
      install/hst-migration.sh
  2. 1 1
      src/deb/nginx/control
  3. 1 1
      src/deb/php/control
  4. 54 8
      src/hst_autocompile.sh
  5. 0 329
      src/hst_compile.sh

+ 0 - 171
install/hst-migration.sh

@@ -1,171 +0,0 @@
-#!/bin/bash
-# Hestia installation wrapper
-# https://www.hestiacp.com
-
-#
-# Currently supported Operating Systems:
-#
-#   Debian 8, 9
-#   Ubuntu 14.04, 16.04, 18.04
-#
-
-HESTIA="/usr/local/hestia"
-RHOST='apt.hestiacp.com'
-os=$(head -n1 /etc/issue | cut -f 1 -d ' ')
-apt="/etc/apt/sources.list.d"
-
-# Detect OS
-case $os in
-    Debian)     type="debian" ;;
-    Ubuntu)     type="ubuntu" ;;
-    *)          type="NoSupport" ;;
-esac
-
-# Check if OS is supported
-if [ "$type" = "NoSupport" ]; then
-    echo "Your OS is currently not supported."
-    exit 1;
-fi
-
-# Detect codename
-if [ "$type" = "debian" ]; then
-    codename="$(cat /etc/os-release |grep VERSION= |cut -f 2 -d \(|cut -f 1 -d \))"
-    release=$(cat /etc/debian_version|grep -o [0-9]|head -n1)
-    VERSION='debian'
-fi
-
-if [ "$type" = "ubuntu" ]; then
-    codename="$(lsb_release -s -c)"
-    release="$(lsb_release -s -r)"
-    VERSION='ubuntu'
-fi
-
-hestiacp="$HESTIA/install/deb"
-
-# Am I root?
-if [ "x$(id -u)" != 'x0' ]; then
-    echo 'Error: this script can only be executed by root'
-    exit 1
-fi
-
-# Check if Vesta is installed
-if [ -f /usr/local/vesta/conf/vesta.conf ]; then
-    source /usr/local/vesta/conf/vesta.conf
-else
-    echo "Vesta not found, stopping here."
-    exit 1
-fi
-
-# Check current Vesta version
-if [ ! "$VERSION" = "0.9.8" ]; then
-    echo "Wrong Vesta version, stopping here."
-    exit 1
-fi
-
-# Inform user and request confirmation for migration
-loop=1
-while [ "$loop" -eq 1 ]; do
-    echo "Would you like to migrate to HestiaCP?"
-    read -p "Please be warned, that we have removed and do not support Softaculous and paid VestaCP extensions! [yes/no]: " sure
-    if [ $sure == 'yes' ] || [ $sure == 'no' ]; then
-        loop=0
-        if [ $sure == 'no' ]; then
-            echo "Cancelling migration..."
-            exit 1
-        fi
-    else
-        echo "Please enter yes or no!"
-    fi
-done
-
-# Update apt repository
-echo "Updating system repository..."
-apt-get -qq update
-
-# Check if apt-transport-https is installed
-if [ ! -e '/usr/lib/apt/methods/https' ]; then
-    apt-get -y install apt-transport-https
-    check_result $? "Can't install apt-transport-https"
-fi
-
-# Remove Vesta Repository if it exists
-echo "Removeing VestaCP Repository..."
-if [ -f /usr/local/vesta/conf/vesta.conf ]; then
-    rm /etc/apt/sources.list.d/vesta.list*
-fi
-
-if [ "$type" = "debian" ]; then
-    # Installing sury PHP repo
-    echo "deb https://packages.sury.org/php/ $codename main" > $apt/php.list
-    wget https://packages.sury.org/php/apt.gpg -O /tmp/php_signing.key
-    apt-key add /tmp/php_signing.key
-fi
-
-if [ "$type" = "ubuntu" ]; then
-    # Check if apt-add-repository is installed
-    if [ ! -e '/usr/bin/apt-add-repository' ]; then
-        apt-get -y install python-software-properties
-        check_result $? "Can't install python-software-properties"
-    fi
-    add-apt-repository -y ppa:ondrej/php > /dev/null 2>&1
-fi
-
-# Installing HestiaCP repo
-echo "deb https://$RHOST/ $codename main" > $apt/hestia.list
-wget https://gpg.hestiacp.com/deb_signing.key -O deb_signing.key
-apt-key add deb_signing.key
-
-# Remove Vesta packages
-echo "Removing VestaCP packages..."
-systemctl stop vesta
-apt-get -qq remove vesta vesta-nginx vesta-php vesta-ioncube vesta-softaculous -y > /dev/null 2>&1
-
-# Remove Softaculous
-rm -fr /usr/local/vesta/softaculous
-sed -i '/SOFTACULOUS/d' /usr/local/vesta/conf/vesta.conf
-
-# Move Vesta to Hestia Folder
-mv /etc/profile.d/vesta.sh /etc/profile.d/hestia.sh
-mv /usr/local/vesta $HESTIA
-mv $HESTIA/conf/vesta.conf $HESTIA/conf/hestia.conf
-
-# Install Hestia packages
-echo "Update System Repository and install HestiaCP Packages..."
-apt-get -qq update
-apt-get -qq upgrade -y  > /dev/null 2>&1
-apt-get -qq install hestia hestia-nginx hestia-php -y  > /dev/null 2>&1
-
-# Add modified configuration files
-echo "export HESTIA='$HESTIA'" >> /etc/profile.d/hestia.sh
-
-rm /etc/sudoers.d/admin
-cp -f $hestiacp/sudo/admin /etc/sudoers.d/
-chmod 440 /etc/sudoers.d/admin
-
-sed -i 's/vesta/hestia/g' /root/.bash_profile
-sed -i 's/VESTA/HESTIA/g' /etc/profile.d/hestia.sh
-sed -i 's/vesta/hestia/g' /etc/profile.d/hestia.sh
-
-cp -rf $hestiacp/firewall $HESTIA/data/
-rm -f /var/log/vesta
-
-rm /usr/share/roundcube/plugins/password/drivers/vesta.php
-cp -f $hestiacp/roundcube/hestia.php \
-    /usr/share/roundcube/plugins/password/drivers/
-sed -i 's/vesta/hestia/g' /etc/roundcube/config.inc.php
-
-rm /etc/logrotate.d/vesta
-cp -f $hestiacp/logrotate/vesta /etc/logrotate.d/hestia
-
-# Restart Hestia service
-systemctl restart hestia
-
-# Create compatiblity symlinks
-ln -s $HESTIA /usr/local/vesta
-ln -s $HESTIA/conf/hestia.conf /usr/local/vesta/conf/vesta.conf
-
-# Update firewall rules
-$HESTIA/bin/v-update-firewall
-
-echo "Migration has finished successfully! You are now running HestiaCP instead of VestaCP."
-echo "Please contact us in case you face any issues, by using our forum: https://forum.hestiacp.com"

+ 1 - 1
src/deb/nginx/control

@@ -1,7 +1,7 @@
 Source: hestia-nginx
 Package: hestia-nginx
 Priority: optional
-Version: 0.9.8-28
+Version: 1.15.10
 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: 0.9.8-28
+Version: 7.3.4
 Section: admin
 Maintainer: HestaCP <info@hestiacp.com>
 Homepage: https://www.hestiacp.com

+ 54 - 8
src/hst_autocompile.sh

@@ -15,14 +15,6 @@ PCRE_V='8.42'
 ZLIB_V='1.2.11'
 PHP_V='7.3.4'
 
-# Generate Links for sourcecode
-HESTIA='https://github.com/hestiacp/hestiacp/archive/master.zip'
-NGINX='https://nginx.org/download/nginx-'$NGINX_V'.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-'$PHP_V'.tar.gz'
-
 # Set package dependencies for compiling
 SOFTWARE='build-essential libxml2-dev libz-dev libcurl4-gnutls-dev unzip openssl libssl-dev pkg-config'
 
@@ -59,17 +51,54 @@ for arg; do
         --hestia)
           HESTIA_B='true'
           ;;
+        --install)
+          answer='Y'
+          ;; 
         *)
           NOARGUMENT='true'
           ;;
     esac
 done
 
+# If branch was specified at run-time, convert its value to the branch variable
+if [ "$3" ]; then
+    branch=$3
+fi
+
+if [ ! "$1" = "--all" ] || [ ! "$1" = "--hestia" ] || [ ! "$1" = "--nginx" ] || [ ! "$1" = "--php" ];  then
+  echo "(!) Invalid compilation flag specified. Valid flags:"
+  echo "--all"
+  echo "--hestia"
+  echo "--nginx"
+  echo "--php"
+  echo ""
+  echo "You may also specify --install to install the packages after compilation."
+fi
+
+# Prompt for Git branch to download and build from if not specified at run-time
+if [ ! $3 ]; then
+  echo -n "Please enter the name of the branch to build from (e.g. master): "
+  read branch
+fi
+
 if [[ $# -eq 0 ]] ; then
     echo "!!! Please run with argument --all, --hestia, --nginx or --php !!!"
     exit 1
 fi
 
+if [ ! "$2" = "--install" ]; then
+  echo -n 'Would you like to install the compiled packages? [Y/N] '
+  read answer
+fi
+
+# Generate Links for sourcecode
+HESTIA='https://github.com/hestiacp/hestiacp/archive/$branch.zip'
+NGINX='https://nginx.org/download/nginx-'$NGINX_V'.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-'$PHP_V'.tar.gz'
+
 
 #################################################################################
 #
@@ -164,6 +193,7 @@ if [ "$NGINX_B" = true ] ; then
     rm -r hestia-nginx_$NGINX_V
 fi
 
+
 #################################################################################
 #
 # Building hestia-php
@@ -237,6 +267,7 @@ if [ "$PHP_B" = true ] ; then
     rm -r hestia-php_$PHP_V
 fi
 
+
 #################################################################################
 #
 # Building hestia
@@ -291,3 +322,18 @@ if [ "$HESTIA_B" = true ] ; then
     rm -r hestia_$HESTIA_V
     rm -r hestiacp-master
 fi
+
+
+#################################################################################
+#
+# Install Packages
+#
+#################################################################################
+
+if [ "$answer" = 'y' ] || [ "$answer" = 'Y'  ]; then
+    for i in ~/*hestia*.deb; do
+      # Install all available packages
+      dpkg -i $i
+    done
+    unset $answer
+fi

+ 0 - 329
src/hst_compile.sh

@@ -1,329 +0,0 @@
-# Manual Compile script for Hestia CP files.
-
-# Set packages to compile
-for arg; do
-  case "$1" in
-    --all)
-      NGINX_B='true'
-      PHP_B='true'
-      HESTIA_B='true'
-      ;;
-    --nginx)
-      NGINX_B='true'
-      ;;
-    --php)
-      PHP_B='true'
-      ;;
-    --hestia)
-      HESTIA_B='true'
-      ;;
-    -ia)
-      HESTIA_B='true'
-      NGINX_B='true'
-      PHP_B='true'
-      INSTALL_P='true'
-      ;;
-    -ih)
-      HESTIA_B='true'
-      INSTALL_P='true'
-      ;;
-    *)
-      NOARGUMENT='true'
-      ;;
-  esac
-done
-
-if [[ $# -eq 0 ]] ; then
-  echo "ERROR: No flag was specified. Valid options are --all, --nginx, --php,"
-  echo "       --hestia, -ia, or -ih"
-  exit 1
-fi
-
-# If branch was specified at run-time, convert its value to the branch variable
-if [ "$2" ]; then
-    branch=$2
-fi
-
-# Prompt for Git branch to download and build from if not specified at run-time
-if [ ! $2 ]; then
-  echo -n "Please enter the name of the branch to build from (e.g. master): "
-  read branch
-fi
-
-# Set compiling directory
-BUILD_DIR='/root'
-INSTALL_DIR='/usr/local/hestia'
-
-# Set Version for compiling
-HESTIA_V='0.9.8-28_amd64'
-NGINX_V='1.15.10'
-OPENSSL_V='1.1.1b'
-PCRE_V='8.42'
-ZLIB_V='1.2.11'
-PHP_V='7.3.4'
-
-# Generate Links for sourcecode
-HESTIA='https://github.com/hestiacp/hestiacp/archive/'$branch'.zip'
-NGINX='https://nginx.org/download/nginx-'$NGINX_V'.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-'$PHP_V'.tar.gz'
-
-# Set repository path
-GIT_REP='https://raw.githubusercontent.com/hestiacp/hestiacp/'$branch'/src/deb/'
-
-# Set package dependencies for compiling
-SOFTWARE='build-essential libxml2-dev libz-dev libcurl4-gnutls-dev unzip openssl libssl-dev pkg-config'
-
-# Define a timestamp function
-timestamp() {
-    date +%s
-}
-
-# Install needed software
-echo "Update system repository..."
-apt-get -qq update
-echo "Installing dependencies for compilation..."
-apt-get -qq install -y $SOFTWARE
-
-# Fix for Debian PHP Envroiment
-if [ ! -e /usr/local/include/curl ]; then
-    ln -s /usr/include/x86_64-linux-gnu/curl /usr/local/include/curl
-fi
-
-#################################################################################
-#
-# Building hestia-nginx
-#
-#################################################################################
-
-if [ "$NGINX_B" = true ] ; then
-    # Change to build directory
-    cd $BUILD_DIR
-
-    # Check if target directory exist
-    if [ -d $BUILD_DIR/hestia-nginx_$HESTIA_V ]; then
-          #mv $BUILD_DIR/hestia-nginx_$HESTIA_V $BUILD_DIR/hestia-nginx_$HESTIA_V-$(timestamp)
-          rm -r $BUILD_DIR/hestia-nginx_$HESTIA_V
-    fi
-
-    # Create directory
-    mkdir $BUILD_DIR/hestia-nginx_$HESTIA_V
-
-    # Download and unpack source files
-    wget -qO- $NGINX | tar xz
-    wget -qO- $OPENSSL | tar xz
-    wget -qO- $PCRE | tar xz
-    wget -qO- $ZLIB | tar xz
-
-    # Change to nginx directory
-    cd nginx-$NGINX_V
-
-    # configure nginx
-    ./configure   --prefix=/usr/local/hestia/nginx \
-                  --with-http_ssl_module \
-                  --with-openssl=../openssl-$OPENSSL_V \
-                  --with-openssl-opt=enable-ec_nistp_64_gcc_128 \
-                  --with-openssl-opt=no-nextprotoneg \
-                  --with-openssl-opt=no-weak-ssl-ciphers \
-                  --with-openssl-opt=no-ssl3 \
-                  --with-pcre=../pcre-$PCRE_V \
-                  --with-pcre-jit \
-                  --with-zlib=../zlib-$ZLIB_V
-
-    # Check install directory and move if exists
-    if [ -d $INSTALL_DIR ]; then
-          #mv $INSTALL_DIR $INSTALL_DIR$(timestamp)
-          rm -r $INSTALL_DIR
-    fi
-
-    # Create the files and install them
-    make && make install
-
-    # Cleare up unused files
-    cd $BUILD_DIR
-    rm -r nginx-$NGINX_V openssl-$OPENSSL_V pcre-$PCRE_V zlib-$ZLIB_V
-
-    # Prepare Deb Package Folder Structure
-    cd hestia-nginx_$HESTIA_V/
-    mkdir -p usr/local/hestia etc/init.d DEBIAN
-
-    # Download control, postinst and postrm files
-    cd DEBIAN
-    wget $GIT_REP/nginx/control
-    wget $GIT_REP/nginx/copyright
-    wget $GIT_REP/nginx/postinst
-    wget $GIT_REP/nginx/postrm
-
-    # Set permission
-    chmod +x postinst postrm
-
-    # Move nginx directory
-    cd ..
-    mv /usr/local/hestia/nginx usr/local/hestia/
-
-    # Get Service File
-    cd etc/init.d
-    wget $GIT_REP/nginx/hestia
-    chmod +x hestia
-
-    # Get nginx.conf
-    cd ../../
-    rm usr/local/hestia/nginx/conf/nginx.conf
-    wget $GIT_REP/nginx/nginx.conf -O usr/local/hestia/nginx/conf/nginx.conf
-
-    # copy binary
-    cp usr/local/hestia/nginx/sbin/nginx usr/local/hestia/nginx/sbin/hestia-nginx
-
-    # change permission and build the package
-    cd $BUILD_DIR
-    chown -R  root:root hestia-nginx_$HESTIA_V
-    dpkg-deb --build hestia-nginx_$HESTIA_V
-
-    # clear up the source folder
-    rm -r hestia-nginx_$HESTIA_V
-fi
-
-
-#################################################################################
-#
-# Building hestia-php
-#
-#################################################################################
-
-if [ "$PHP_B" = true ] ; then
-    # Change to build directory
-    cd $BUILD_DIR
-
-    # Check if target directory exist
-    if [ -d $BUILD_DIR/hestia-php_$HESTIA_V ]; then
-          #mv $BUILD_DIR/hestia-php_$HESTIA_V $BUILD_DIR/hestia-php_$HESTIA_V-$(timestamp)
-          rm -r $BUILD_DIR/hestia-php_$HESTIA_V
-    fi
-
-    # Create directory
-    mkdir $BUILD_DIR/hestia-php_$HESTIA_V
-
-    # Download and unpack source files
-    wget -qO- $PHP | tar xz
-
-    # Change to php directory
-    cd php-$PHP_V
-
-    # Configure PHP
-    ./configure   --prefix=/usr/local/hestia/php \
-                --enable-fpm \
-                --with-fpm-user=admin \
-                --with-fpm-group=admin \
-                --with-libdir=lib/x86_64-linux-gnu \
-                --with-mysqli \
-                --with-curl \
-                --enable-mbstring
-
-    # Create the files and install them
-    make && make install
-
-    # Cleare up unused files
-    cd $BUILD_DIR
-    rm -r php-$PHP_V
-
-    # Prepare Deb Package Folder Structure
-    cd hestia-php_$HESTIA_V/
-    mkdir -p usr/local/hestia DEBIAN
-
-    # Download control, postinst and postrm files
-    cd DEBIAN
-    wget $GIT_REP/php/control
-    wget $GIT_REP/php/copyright
-
-    # Move php directory
-    cd ..
-    mv /usr/local/hestia/php usr/local/hestia/
-
-    # Get php-fpm.conf
-    wget $GIT_REP/php/php-fpm.conf -O usr/local/hestia/php/etc/php-fpm.conf
-
-    # Get php.ini
-    wget $GIT_REP/php/php.ini -O usr/local/hestia/php/lib/php.ini
-
-    # copy binary
-    cp usr/local/hestia/php/sbin/php-fpm usr/local/hestia/php/sbin/hestia-php
-
-    # change permission and build the package
-    cd $BUILD_DIR
-    chown -R  root:root hestia-php_$HESTIA_V
-    dpkg-deb --build hestia-php_$HESTIA_V
-
-    # clear up the source folder
-    rm -r hestia-php_$HESTIA_V
-fi
-
-
-#################################################################################
-#
-# Building hestia
-#
-#################################################################################
-
-if [ "$HESTIA_B" = true ] ; then
-    # Change to build directory
-    cd $BUILD_DIR
-
-    # Check if target directory exist
-    if [ -d $BUILD_DIR/hestia_$HESTIA_V ]; then
-          #mv $BUILD_DIR/hestia_$HESTIA_V $BUILD_DIR/hestia_$HESTIA_V-$(timestamp)
-          rm -r $BUILD_DIR/hestia_$HESTIA_V
-    fi
-
-    # Create directory
-    mkdir $BUILD_DIR/hestia_$HESTIA_V
-
-    # Download and unpack source files
-    wget $HESTIA
-    unzip -q $branch.zip
-    rm $branch.zip
-
-    # Prepare Deb Package Folder Structure
-    cd hestia_$HESTIA_V/
-    mkdir -p usr/local/hestia DEBIAN
-
-    # Download control, postinst and postrm files
-    cd DEBIAN
-    wget $GIT_REP/hestia/control
-    wget $GIT_REP/hestia/copyright
-    wget $GIT_REP/hestia/postinst
-
-    # Set permission
-    chmod +x postinst
-
-    # Move needed directories
-    cd ../../hestiacp-$branch
-    mv bin func install web ../hestia_$HESTIA_V/usr/local/hestia/
-
-    # Set permission
-    cd ../hestia_$HESTIA_V/usr/local/hestia/bin
-    chmod +x *
-
-    # change permission and build the package
-    cd $BUILD_DIR
-    chown -R root:root hestia_$HESTIA_V
-    dpkg-deb --build hestia_$HESTIA_V
-
-    # clear up the source folder
-    rm -r hestia_$HESTIA_V
-    rm -r hestiacp-$branch
-fi
-
-#################################################################################
-#
-# Install Packages
-#
-#################################################################################
-
-if [ "$INSTALL_P" = true ] ; then
-    for i in ~/*hestia*.deb; do
-      # Install all available packages
-      dpkg -i $i
-    done
-fi