Bladeren bron

RHEL & 1:1 distro support (#2749)

* RHEL version checker

* use arch binary instead uname

* modify install script to support RHEL

* add support for RPM based distro

* add RPM repositories

* choose libdir depending on architecture

* common files for both debian and rhel

As @jaapmarcus raised concern to have common config files for both debian and rhel in github comment.

https://github.com/hestiacp/hestiacp/pull/2731#pullrequestreview-1030683914

This is initial commit to have a common base config files for both debian and rhel.

* Disable bats testing for branch

* architecture dependent result dir

* quota & linting for RHEL

* HestiaCP repo

* RHEL support in installer

Co-authored-by: Jaap Marcus <9754650+jaapmarcus@users.noreply.github.com>
Ice Lake 3 jaren geleden
bovenliggende
commit
f8359971fe

+ 1 - 146
.drone.yml

@@ -1,101 +1,3 @@
----
-kind: pipeline
-type: ssh
-name: Ubuntu | Nginx + Apache2  
-
-concurrency:
-  limit: 1
-
-server:
-  host:
-    from_secret: server_address
-  user: 
-    from_secret: username
-  ssh_key: 
-    from_secret: ssh_key
-
-platform:
-  os: linux
-  arch: amd64
-   
-steps:
-- name: Download submodules
-  image: alpine/git
-  commands:
-  - git submodule update --init --recursive
-- name: Build Hestia package and install
-  commands:
-  - ./src/hst_autocompile.sh --hestia --install '~localsrc'
-- name: Run system / user tests
-  commands:
-  - bats ./test/test.bats
-- name: Run restore tests
-  commands:
-  - bats ./test/restore.bats
-- name: Run config tests 
-  commands:
-  - bats ./test/config-tests.bats
-
-trigger:
-  event: [ pull_request, push ]
-  ref:
-  - refs/heads/staging/*
-  - refs/heads/beta
-  - refs/heads/release
-  - refs/heads/main
-  - refs/pull/*/head
-
----
-kind: pipeline
-type: ssh
-name: Debian | Nginx  
-
-concurrency:
-  limit: 1
-
-server:
-  host:
-    from_secret: server_address2
-  user: 
-    from_secret: username
-  ssh_key: 
-    from_secret: ssh_key
-
-platform:
-  os: linux
-  arch: amd64
-   
-steps:
-- name: Download submodules
-  image: alpine/git
-  commands:
-  - git submodule update --init --recursive
-- name: Build Hestia package install
-  commands:
-  - ./src/hst_autocompile.sh --hestia --install '~localsrc'
-- name: Run system / user tests
-  commands:
-  - bats ./test/test.bats
-- name: Run restore tests
-  commands:
-  - bats ./test/restore.bats
-- name: Run Letsencrypt test against Staging
-  commands:
-  - cp /root/le-env.sh /tmp/hestia-le-env.sh
-  - bats ./test/letsencrypt.bats
-- name: Run config tests 
-  commands:
-  - bats ./test/config-tests.bats
-  
-trigger:
-  event: [ pull_request, push ]
-  ref:
-  - refs/heads/staging/*
-  - refs/heads/beta
-  - refs/heads/release
-  - refs/heads/main
-  - refs/pull/*/head
-
 ---
 kind: pipeline
 type: docker
@@ -123,54 +25,7 @@ trigger:
       - refs/heads/main
       - refs/pull/*/head
 
----
-kind: pipeline
-type: docker
-name: Push to beta atp server
-
-platform:
-  os: linux
-  arch: amd64
-
-steps:
-  - name: Build
-    image: debian:bullseye
-    commands:
-    - ln -snf /etc/localtime && echo CET > /etc/timezone
-    - ./src/hst_autocompile.sh --dontinstalldeps --hestia --debug --cross --noinstall --keepbuild --debug '~localsrc'
-    - mkdir -p ./hestia/
-    - mv /tmp/hestiacp-src/deb/*.deb ./hestia/
-  - name: Upload
-    image: appleboy/drone-scp
-    settings:
-      host:
-        from_secret: apt_server
-      user: root
-      key:
-        from_secret: ssh_key
-      port: 22
-      command_timeout: 2m
-      target: /root/
-      source:
-        - ./hestia/*
-  - name: Publish
-    image: appleboy/drone-ssh
-    settings:
-        host:
-          from_secret: apt_server
-        user: root
-        key:
-          from_secret: ssh_key
-        port: 22
-        command_timeout: 2m
-        script:
-            - freight-add ./hestia/*.deb apt/bionic apt/focal apt/jammy apt/stretch apt/buster apt/bullseye
-            - freight-cache
-            - rm -fr ./hestia/
-  
-trigger:
-    event: [ promote] 
 
 ---
 kind: signature
-hmac: a191a477aa337f2efff534022164906ff20ef2b6340ec808d128c09a06d7eaa3
+hmac: 4eec34ee92f63737d6a976140e6e54adf637ebbb4836b17a083c560a4440c54f

+ 1 - 1
bin/v-add-backup-host

@@ -21,7 +21,7 @@ path=${5-/backup}
 port=$6
 
 # CPU Architecture
-arch=$(uname -m)
+arch=$(arch)
 
 # Includes
 # shellcheck source=/usr/local/hestia/func/main.sh

+ 5 - 1
bin/v-add-firewall-ipset

@@ -44,7 +44,11 @@ IPSET_PATH="$HESTIA/data/firewall/ipset"
 
 # Ensure ipset is installed
 if [ -z "$IPSET_BIN" ]; then
-    apt-get --quiet --yes install ipset > /dev/null
+    if [ -f '/etc/redhat-release' ]; then
+        dnf install -q -y ipset > /dev/null
+    else
+        apt-get --quiet --yes install ipset > /dev/null
+    fi
     check_result $? "Installing ipset package"
 
     IPSET_BIN="$(which ipset)"

+ 3 - 4
bin/v-add-sys-quota

@@ -35,14 +35,13 @@ fi
 # Checking quota package
 quota=$(which --skip-alias --skip-functions quota 2>/dev/null)
 if [ $? -ne 0 ]; then
-    if [ -d "/etc/sysconfig" ]; then
-        yum -y install quota >/dev/null 2>&1
-        check_result $? "quota package installation failed" "$E_UPDATE"
+    if [ -f "/etc/redhat-release" ]; then
+        dnf -y install quota >/dev/null 2>&1
     else
         export DEBIAN_FRONTEND=noninteractive
         apt-get -y install quota >/dev/null 2>&1
-        check_result $? "quota package installation failed" "$E_UPDATE"
     fi
+    check_result $? "quota package installation failed" "$E_UPDATE"
 fi
 
 # Perform verification if read-only mode is enabled

+ 12 - 3
bin/v-add-web-php

@@ -84,8 +84,13 @@ if ! echo "$DB_SYSTEM" | grep -w 'pgsql' >/dev/null; then
 fi
 
 # Install php packages
-apt-get -qq update
-apt-get -y -qq -o Dpkg::Options::="--force-confold" install $mph > /dev/null 2>&1 &
+if [ -f '/etc/redhat-release' ]; then
+    dnf makecache -q
+    dnf install -q -y $mph > /dev/null 2>&1 &
+else
+    apt-get -qq update
+    apt-get -y -qq -o Dpkg::Options::="--force-confold" install $mph > /dev/null 2>&1 &
+fi
 BACK_PID=$!
 
 # Check if package installation is done, print a spinner
@@ -103,7 +108,11 @@ echo
 # Check if installation was successful
 if [ ! -f "$php_fpm" ]; then
     echo "ERROR: Installation failed, please run the following command manually for debugging:"
-    echo "apt-get install $mph"
+    if [ -f '/etc/redhat-release' ]; then
+        echo "dnf install $mph"
+    else
+        echo "apt-get install $mph"
+    fi
 fi
 
 # Check if required modules for apache2 are enabled

+ 5 - 1
bin/v-delete-firewall-ipset

@@ -42,7 +42,11 @@ check_hestia_demo_mode
 
 # Install ipset package if missing
 if [ -z "$IPSET_BIN" ]; then
-    apt-get --quiet --yes install ipset > /dev/null
+    if [ -f '/etc/redhat-release' ]; then
+        dnf install -q -y ipset > /dev/null
+    else
+        apt-get --quiet --yes install ipset > /dev/null
+    fi
     check_result $? "Installing ipset package"
 
     IPSET_BIN="$(which ipset)"

+ 10 - 2
bin/v-delete-web-php

@@ -71,7 +71,11 @@ if [[ `echo "$version 7.2" | awk '{print ($1 < $2)}'` == 1 ]]; then
 fi
 
 # Purge php packages
-apt-get -y purge $mph > /dev/null 2>&1 &
+if [ -f '/etc/redhat-release' ]; then
+    dnf remove -y $mph > /dev/null 2>&1 &
+else
+    apt-get -y purge $mph > /dev/null 2>&1 &
+fi
 BACK_PID=$!
 
 # Check if package removal is done, print a spinner
@@ -89,7 +93,11 @@ echo
 # Check if installation was successfully
 if [ -f "$php_fpm" ]; then
     echo "ERROR: Uninstallation failed, please run the following command manually for debugging:"
-    echo "apt-get purge $mph"
+    if [ -f '/etc/redhat-release' ]; then
+        echo "dnf remove $mph"
+    else
+        echo "apt-get purge $mph"
+    fi
     exit 1; 
 fi
 

+ 43 - 21
bin/v-list-sys-hestia-updates

@@ -23,6 +23,25 @@ source_conf "$HESTIA/conf/hestia.conf"
 
 fields="\$NAME \$VERSION \$ARCH \$UPDATED \$DESCR \$TIME \$DATE"
 
+# Check details of installed .deb package function
+check_installed_deb() {
+    dpkg_data=$(dpkg-query -s $1)
+    pkg_date=$(stat -c "%Y" /var/lib/dpkg/info/$1.list)
+    ARCH=$(echo "$dpkg_data"|grep Architecture | cut -f 2 -d ' ')
+    VERSION=$(echo "$dpkg_data"|grep ^Version |cut -f 2 -d ' ')
+    DATE=$(date -d @$pkg_date +"%F")
+    TIME=$(date -d @$pkg_date +"%T")
+}
+
+# Check details of installed .rpm package function
+check_installed_rpm() {
+    rpm_data=$(rpm -qi $1)
+    ARCH=$(echo "$rpm_data"|grep Architecture |cut -f 2 -d ' ')
+    VERSION=$(echo "$rpm_data"|grep Version |cut -f 2 -d ':' | xargs)
+    DATE=$(echo "$rpm_data"| grep "Build Date"| awk '{print $5 " " $6 " " $7}')
+    TIME=$(echo "$rpm_data"| grep "Build Date"| awk '{print $8 " " $9 " " $10}')
+}
+
 # JSON list function
 json_list() {
     IFS=$'\n'
@@ -65,17 +84,22 @@ shell_list() {
 #----------------------------------------------------------#
 
 # Checking official latest version
-hestia_v=$(apt-cache policy hestia | grep Candidate | cut -d ':' -f 2 | xargs)
-nginx_v=$(apt-cache policy hestia-nginx | grep Candidate | cut -d ':' -f 2 | xargs)
-php_v=$(apt-cache policy hestia-php | grep Candidate | cut -d ':' -f 2 | xargs)
+if [ -f '/etc/redhat-release' ]; then
+    hestia_v=$(dnf list hestia | grep hestia | awk '{print $2}' | cut -f 1 -d '-')
+    nginx_v=$(dnf list hestia-nginx | grep hestia-nginx | awk '{print $2}' | cut -f 1 -d '-')
+    php_v=$(dnf list hestia-php | grep hestia-php | awk '{print $2}' | cut -f 1 -d '-')
+else
+    hestia_v=$(apt-cache policy hestia | grep Candidate | cut -d ':' -f 2 | xargs)
+    nginx_v=$(apt-cache policy hestia-nginx | grep Candidate | cut -d ':' -f 2 | xargs)
+    php_v=$(apt-cache policy hestia-php | grep Candidate | cut -d ':' -f 2 | xargs)
+fi
 
 # Checking installed hestia version
-dpkg_data=$(dpkg-query -s hestia)
-pkg_date=$(stat -c "%Y" /var/lib/dpkg/info/hestia.list)
-ARCH=$(echo "$dpkg_data"|grep Architecture |cut -f 2 -d ' ')
-VERSION=$(echo "$dpkg_data"|grep ^Version |cut -f 2 -d ' ')
-DATE=$(date -d @$pkg_date +"%F")
-TIME=$(date -d @$pkg_date +"%T")
+if [ -f '/etc/redhat-release' ]; then
+    check_installed_rpm hestia
+else
+    check_installed_deb hestia
+fi
 
 UPDATED='yes'
 if [ -n "$hesta_v" ] && [ "$hestia_v" \> "$VERSION" ]; then
@@ -86,12 +110,11 @@ data="NAME='hestia' VERSION='$VERSION' ARCH='$ARCH'"
 data="$data UPDATED='$UPDATED' DESCR='core package' TIME='$TIME' DATE='$DATE'"
 
 # Checking installed hestia-php version
-dpkg_data=$(dpkg-query -s hestia-php)
-pkg_date=$(stat -c "%Y" /var/lib/dpkg/info/hestia-php.list)
-ARCH=$(echo "$dpkg_data"|grep Architecture | cut -f 2 -d ' ')
-VERSION=$(echo "$dpkg_data"|grep ^Version |cut -f 2 -d ' ')
-DATE=$(date -d @$pkg_date +"%F")
-TIME=$(date -d @$pkg_date +"%T")
+if [ -f '/etc/redhat-release' ]; then
+    check_installed_rpm hestia-php
+else
+    check_installed_deb hestia-php
+fi
 
 UPDATED='yes'
 if [ -n "$php_v" ] && [ "$php_v" \> "$VERSION" ]; then
@@ -103,12 +126,11 @@ data="$data ARCH='$ARCH' UPDATED='$UPDATED' DESCR='php interpreter'"
 data="$data TIME='$TIME' DATE='$DATE'"
 
 # Checking installed hestia-nginx version
-dpkg_data=$(dpkg-query -s hestia-nginx)
-pkg_date=$(stat -c "%Y" /var/lib/dpkg/info/hestia-nginx.list)
-ARCH=$(echo "$dpkg_data"|grep Architecture | cut -f 2 -d ' ')
-VERSION=$(echo "$dpkg_data"|grep ^Version |cut -f 2 -d ' ')
-DATE=$(date -d @$pkg_date +"%F")
-TIME=$(date -d @$pkg_date +"%T")
+if [ -f '/etc/redhat-release' ]; then
+    check_installed_rpm hestia-nginx
+else
+    check_installed_deb hestia-nginx
+fi
 
 UPDATED='yes'
 if [ -n "$nginx_v" ] && [ "$nginx_v" \> "$VERSION" ]; then

+ 1 - 1
bin/v-update-sys-hestia-git

@@ -78,7 +78,7 @@ BUILD_DIR='/tmp/hestiacp-src'
 DEB_DIR="$BUILD_DIR/debs"
 INSTALL_DIR='/usr/local/hestia'
 ARCHIVE_DIR="${BUILD_DIR}/archive"
-architecture="$(uname -m)"
+architecture="$(arch)"
 if [ $architecture == 'aarch64' ]; then
     BUILD_ARCH='arm64'
 else

+ 0 - 0
install/deb/api/billing → install/common/api/billing


+ 0 - 0
install/deb/api/mail-accounts → install/common/api/mail-accounts


+ 0 - 0
install/deb/api/phpmyadmin-sso → install/common/api/phpmyadmin-sso


+ 0 - 0
install/deb/api/purge-nginx-cache → install/common/api/purge-nginx-cache


+ 0 - 0
install/deb/api/sync-dns-cluster → install/common/api/sync-dns-cluster


+ 0 - 0
install/deb/firewall/ipset/blacklist.sh → install/common/firewall/ipset/blacklist.sh


+ 0 - 0
install/deb/firewall/rules.conf → install/common/firewall/rules.conf


+ 0 - 0
install/deb/packages/default.pkg → install/common/packages/default.pkg


+ 0 - 0
install/deb/packages/system.pkg → install/common/packages/system.pkg


+ 5 - 4
install/hst-install-debian.sh

@@ -24,10 +24,11 @@ memory=$(grep 'MemTotal' /proc/meminfo |tr ' ' '\n' |grep [0-9])
 hst_backups="/root/hst_install_backups/$(date +%d%m%Y%H%M)"
 spinner="/-\|"
 os='debian'
-architecture="$(uname -m)"
+architecture="$(arch)"
 release=$(cat /etc/debian_version | tr "." "\n" | head -n1)
 codename="$(cat /etc/os-release |grep VERSION= |cut -f 2 -d \(|cut -f 1 -d \))"
 HESTIA_INSTALL_DIR="$HESTIA/install/deb"
+HESTIA_COMMON_DIR="$HESTIA/install/common"
 VERBOSE='no'
 
 # Define software versions
@@ -1203,7 +1204,7 @@ write_config_value "UPGRADE_SEND_EMAIL" "true"
 write_config_value "UPGRADE_SEND_EMAIL_LOG" "false"
 
 # Installing hosting packages
-cp -rf $HESTIA_INSTALL_DIR/packages $HESTIA/data/
+cp -rf $HESTIA_COMMON_DIR/packages $HESTIA/data/
 
 # Update nameservers in hosting package
 IFS='.' read -r -a domain_elements <<< "$servername"
@@ -1223,10 +1224,10 @@ cp -rf $HESTIA_INSTALL_DIR/templates/web/unassigned/index.html /var/www/html/
 cp -rf $HESTIA_INSTALL_DIR/templates/web/skel/document_errors/* /var/www/document_errors/
 
 # Installing firewall rules
-cp -rf $HESTIA_INSTALL_DIR/firewall $HESTIA/data/
+cp -rf $HESTIA_COMMON_DIR/firewall $HESTIA/data/
 
 # Installing apis
-cp -rf $HESTIA_INSTALL_DIR/api $HESTIA/data/
+cp -rf $HESTIA_COMMON_DIR/api $HESTIA/data/
 
 # Configuring server hostname
 $HESTIA/bin/v-change-sys-hostname $servername > /dev/null 2>&1

+ 5 - 4
install/hst-install-ubuntu.sh

@@ -26,8 +26,9 @@ spinner="/-\|"
 os='ubuntu'
 release="$(lsb_release -s -r)"
 codename="$(lsb_release -s -c)"
-architecture="$(uname -m)"
+architecture="$(arch)"
 HESTIA_INSTALL_DIR="$HESTIA/install/deb"
+HESTIA_COMMON_DIR="$HESTIA/install/common"
 VERBOSE='no'
 
 # Define software versions
@@ -1264,7 +1265,7 @@ write_config_value "UPGRADE_SEND_EMAIL" "true"
 write_config_value "UPGRADE_SEND_EMAIL_LOG" "false"
 
 # Installing hosting packages
-cp -rf $HESTIA_INSTALL_DIR/packages $HESTIA/data/
+cp -rf $HESTIA_COMMON_DIR/packages $HESTIA/data/
 
 # Update nameservers in hosting package
 IFS='.' read -r -a domain_elements <<< "$servername"
@@ -1284,10 +1285,10 @@ cp -rf $HESTIA_INSTALL_DIR/templates/web/unassigned/index.html /var/www/html/
 cp -rf $HESTIA_INSTALL_DIR/templates/web/skel/document_errors/* /var/www/document_errors/
 
 # Installing firewall rules
-cp -rf $HESTIA_INSTALL_DIR/firewall $HESTIA/data/
+cp -rf $HESTIA_COMMON_DIR/firewall $HESTIA/data/
 
 # Installing apis
-cp -rf $HESTIA_INSTALL_DIR/api $HESTIA/data/
+cp -rf $HESTIA_COMMON_DIR/api $HESTIA/data/
 
 # Configuring server hostname
 $HESTIA/bin/v-change-sys-hostname $servername > /dev/null 2>&1

+ 56 - 14
install/hst-install.sh

@@ -10,6 +10,7 @@
 #
 # Debian 9, 10, 11
 # Ubuntu 18.04, 20.04, 22.04
+# AlmaLinux, EuroLinux, Red Hat EnterPrise Linux, Rocky Linux 8, 9
 #
 # ======================================================== #
 
@@ -40,13 +41,13 @@ if [ ! -z "$(grep ^admin: /etc/group)" ] && [ -z "$1" ]; then
 fi
 
 # Detect OS
-if [ -e "/etc/os-release" ]; then
+if [ -e "/etc/os-release" ] && [ ! -e "/etc/redhat-release" ]; then
     type=$(grep "^ID=" /etc/os-release | cut -f 2 -d '=')
     if [ "$type" = "ubuntu" ]; then
         # Check if lsb_release is installed
         if [ -e '/usr/bin/lsb_release' ]; then
             release="$(lsb_release -s -r)"
-            VERSION='ubuntu'            
+            VERSION='ubuntu'
         else
             echo "lsb_release is currently not installed, please install it:"
             echo "apt-get update && apt-get install lsb_release"
@@ -56,6 +57,21 @@ if [ -e "/etc/os-release" ]; then
         release=$(cat /etc/debian_version|grep -o "[0-9]\{1,2\}"|head -n1)
         VERSION='debian'
     fi
+elif [ -e "/etc/os-release" ] && [ -e "/etc/redhat-release" ]; then
+    type=$(grep "^ID=" /etc/os-release | cut -f 2 -d '"')
+    if [ "$type" = "rhel" ]; then
+        release=$(cat /etc/redhat-release | cut -f 1 -d '.' | awk '{print $3}')
+        VERSION='rhel'
+    elif [ "$type" = "almalinux" ]; then
+        release=$(cat /etc/redhat-release | cut -f 1 -d '.' | awk '{print $3}')
+        VERSION='almalinux'
+    elif [ "$type" = "eurolinux" ]; then
+        release=$(cat /etc/redhat-release | cut -f 1 -d '.' | awk '{print $3}')
+        VERSION='eurolinux'
+    elif [ "$type" = "rocky" ]; then
+        release=$(cat /etc/redhat-release | cut -f 1 -d '.' | awk '{print $3}')
+        VERSION='rockylinux'
+    fi
 else
     type="NoSupport"
 fi
@@ -67,6 +83,8 @@ no_support_message(){
     echo "****************************************************"
     echo "  Debian 10, 11"
     echo "  Ubuntu 18.04, 20.04, 22.04 LTS"
+    # Commenting this out for now
+    # echo "  AlmaLinux, EuroLinux, Red Hat EnterPrise Linux, Rocky Linux 8,9"
     echo ""
     exit 1;
 }
@@ -78,25 +96,47 @@ fi
 check_wget_curl(){
     # Check wget
     if [ -e '/usr/bin/wget' ]; then
-        wget -q https://raw.githubusercontent.com/hestiacp/hestiacp/release/install/hst-install-$type.sh -O hst-install-$type.sh
-        if [ "$?" -eq '0' ]; then
-            bash hst-install-$type.sh $*
-            exit
+        if [ -e '/etc/redhat-release' ]; then
+            wget -q https://raw.githubusercontent.com/hestiacp/hestiacp/release/install/hst-install-rhel.sh -O hst-install-rhel.sh
+            if [ "$?" -eq '0' ]; then
+                bash hst-install-rhel.sh $*
+                exit
+            else
+                echo "Error: hst-install-rhel.sh download failed."
+                exit 1
+            fi
         else
-            echo "Error: hst-install-$type.sh download failed."
-            exit 1
+            wget -q https://raw.githubusercontent.com/hestiacp/hestiacp/release/install/hst-install-$type.sh -O hst-install-$type.sh
+            if [ "$?" -eq '0' ]; then
+                bash hst-install-$type.sh $*
+                exit
+            else
+                echo "Error: hst-install-$type.sh download failed."
+                exit 1
+            fi
         fi
     fi
 
     # Check curl
     if [ -e '/usr/bin/curl' ]; then
-        curl -s -O https://raw.githubusercontent.com/hestiacp/hestiacp/release/install/hst-install-$type.sh
-        if [ "$?" -eq '0' ]; then
-            bash hst-install-$type.sh $*
-            exit
+        if [ -e '/etc/redhat-release' ]; then
+            curl -s -O https://raw.githubusercontent.com/hestiacp/hestiacp/release/install/hst-install-rhel.sh
+            if [ "$?" -eq '0' ]; then
+                bash hst-install-rhel.sh $*
+                exit
+            else
+                echo "Error: hst-install-rhel.sh download failed."
+                exit 1
+            fi
         else
-            echo "Error: hst-install-$type.sh download failed."
-            exit 1
+            curl -s -O https://raw.githubusercontent.com/hestiacp/hestiacp/release/install/hst-install-$type.sh
+            if [ "$?" -eq '0' ]; then
+                bash hst-install-$type.sh $*
+                exit
+            else
+                echo "Error: hst-install-$type.sh download failed."
+                exit 1
+            fi
         fi
     fi
 }
@@ -105,6 +145,8 @@ check_wget_curl(){
 # of OS-specific installer, and throw error message if unsupported OS detected.
 if [[ "$release" =~ ^(10|11|18.04|20.04|22.04)$ ]]; then
     check_wget_curl $*
+elif [[ -e "/etc/redhat-release" ]] && [[ "$release" =~ ^(8|9)$ ]]; then
+    check_wget_curl $*
 else
     no_support_message
 fi

+ 6 - 0
install/rpm/dovecot/dovecot.repo

@@ -0,0 +1,6 @@
+[dovecot]
+name=Dovecot 2.3-latest RHEL $releasever - $basearch
+baseurl=https://repo.dovecot.org/ce-2.3-latest/rhel/$releasever/RPMS/$basearch
+gpgkey=https://repo.dovecot.org/DOVECOT-REPO-GPG
+gpgcheck=1
+enabled=1

+ 0 - 10
install/rpm/firewall/rules.conf

@@ -1,10 +0,0 @@
-RULE='1' ACTION='ACCEPT' PROTOCOL='ICMP' PORT='0' IP='0.0.0.0/0' COMMENT='PING' SUSPENDED='no' TIME='17:13:48' DATE='2014-09-16'
-RULE='2' ACTION='ACCEPT' PROTOCOL='TCP' PORT='8083' IP='0.0.0.0/0' COMMENT='HESTIA' SUSPENDED='no' TIME='07:40:16' DATE='2014-05-25'
-RULE='3' ACTION='ACCEPT' PROTOCOL='TCP' PORT='143,993' IP='0.0.0.0/0' COMMENT='IMAP' SUSPENDED='no' TIME='07:40:16' DATE='2014-05-25'
-RULE='4' ACTION='ACCEPT' PROTOCOL='TCP' PORT='110,995' IP='0.0.0.0/0' COMMENT='POP3' SUSPENDED='no' TIME='07:40:16' DATE='2014-05-25'
-RULE='5' ACTION='ACCEPT' PROTOCOL='TCP' PORT='25,465,587' IP='0.0.0.0/0' COMMENT='SMTP' SUSPENDED='no' TIME='21:47:04' DATE='2018-11-07'
-RULE='6' ACTION='ACCEPT' PROTOCOL='TCP' PORT='53' IP='0.0.0.0/0' COMMENT='DNS' SUSPENDED='no' TIME='07:40:16' DATE='2014-05-25'
-RULE='7' ACTION='ACCEPT' PROTOCOL='UDP' PORT='53' IP='0.0.0.0/0' COMMENT='DNS' SUSPENDED='no' TIME='07:40:16' DATE='2014-05-25'
-RULE='8' ACTION='ACCEPT' PROTOCOL='TCP' PORT='21,12000-12100' IP='0.0.0.0/0' COMMENT='FTP' SUSPENDED='no' TIME='07:40:16' DATE='2014-05-25'
-RULE='9' ACTION='ACCEPT' PROTOCOL='TCP' PORT='80,443' IP='0.0.0.0/0' COMMENT='WEB' SUSPENDED='no' TIME='17:04:27' DATE='2014-09-24'
-RULE='10' ACTION='ACCEPT' PROTOCOL='TCP' PORT='22' IP='0.0.0.0/0' COMMENT='SSH' SUSPENDED='no' TIME='17:14:41' DATE='2014-09-16'

+ 6 - 0
install/rpm/hestia/hestia.repo

@@ -0,0 +1,6 @@
+[hestiacp]
+name=HestiaCP Repository for RHEL $releasever - $basearch
+baseurl=https://rpm.hestiacp.com/rhel/$releasever/$basearch/
+gpgkey=https://rpm.hestiacp.com/RPM-GPG-KEY-HESTIACP
+gpgcheck=1
+enabled=1

+ 7 - 0
install/rpm/mysql/mariadb-aarch64.repo

@@ -0,0 +1,7 @@
+[mariadb]
+name = MariaDB 10.6 for RHEL $releasever - $basearch
+baseurl = https://ftp.osuosl.org/pub/mariadb/yum/10.6/rhel$releasever-$basearch
+module_hotfixes=1
+gpgkey=https://ftp.osuosl.org/pub/mariadb/yum/RPM-GPG-KEY-MariaDB
+gpgcheck=1
+enabled=1

+ 7 - 0
install/rpm/mysql/mariadb-x86_64.repo

@@ -0,0 +1,7 @@
+[mariadb]
+name = MariaDB 10.6 for RHEL $releasever - $basearch
+baseurl = https://ftp.osuosl.org/pub/mariadb/yum/10.6/rhel$releasever-amd64
+module_hotfixes=1
+gpgkey=https://ftp.osuosl.org/pub/mariadb/yum/RPM-GPG-KEY-MariaDB
+gpgcheck=1
+enabled=1

+ 6 - 0
install/rpm/nginx/nginx.repo

@@ -0,0 +1,6 @@
+[nginx]
+name=Nginx Repository for RHEL $releasever - $basearch
+baseurl=https://nginx.org/packages/rhel/$releasever/$basearch/
+gpgkey=https://nginx.org/keys/nginx_signing.key
+gpgcheck=1
+enabled=1

+ 0 - 18
install/rpm/packages/default.pkg

@@ -1,18 +0,0 @@
-WEB_TEMPLATE='default'
-PROXY_TEMPLATE='default'
-DNS_TEMPLATE='default'
-WEB_DOMAINS='unlimited'
-WEB_ALIASES='unlimited'
-DNS_DOMAINS='unlimited'
-DNS_RECORDS='unlimited'
-MAIL_DOMAINS='unlimited'
-MAIL_ACCOUNTS='unlimited'
-DATABASES='unlimited'
-CRON_JOBS='unlimited'
-DISK_QUOTA='unlimited'
-BANDWIDTH='unlimited'
-NS='ns1.domain.tld,ns2.domain.tld'
-SHELL='nologin'
-BACKUPS='1'
-TIME='18:00:00'
-DATE='2019-01-15'

+ 0 - 19
install/rpm/packages/system.pkg

@@ -1,19 +0,0 @@
-WEB_TEMPLATE='default'
-PROXY_TEMPLATE='default'
-BACKEND_TEMPLATE='default'
-DNS_TEMPLATE='default'
-WEB_DOMAINS='1'
-WEB_ALIASES='1'
-DNS_DOMAINS='1'
-DNS_RECORDS='unlimited'
-MAIL_DOMAINS='1'
-MAIL_ACCOUNTS='1'
-DATABASES='0'
-CRON_JOBS='unlimited'
-DISK_QUOTA='unlimited'
-BANDWIDTH='unlimited'
-NS='ns1.domain.tld,ns2.domain.tld'
-SHELL='nologin'
-BACKUPS='1'
-TIME='00:00:00'
-DATE='2022-01-20'

+ 1 - 1
install/upgrade/versions/1.5.1.sh

@@ -26,7 +26,7 @@ codename="$(lsb_release -s -c)"
 if [ -z "$codename" ]; then 
     codename="$(cat /etc/os-release |grep VERSION= |cut -f 2 -d \(|cut -f 1 -d \))"
 fi
-architecture="$(uname -m)"
+architecture="$(arch)"
 case $architecture in 
     x86_64)
         ARCH="amd64"

+ 1 - 1
install/upgrade/versions/1.5.5.sh

@@ -33,7 +33,7 @@ mkdir -p /root/.gnupg && chmod 700 /root/.gnupg
 
 if [ ! -f "/usr/share/keyrings/nginx-keyring.gpg" ]; then 
     # Get Architecture
-    architecture="$(uname -m)"
+    architecture="$(arch)"
     case $architecture in 
     x86_64)
         ARCH="amd64"

+ 18 - 33
src/hst_autocompile.sh

@@ -446,8 +446,8 @@ if [ "$NGINX_B" = true ] ; then
         mkdir -p $BUILD_DIR/rpmbuild
         echo Building Nginx RPM
         rpmbuild -bb --define "sourcedir $BUILD_DIR_HESTIANGINX" --buildroot=$BUILD_DIR/rpmbuild/ ${BUILD_DIR_HESTIANGINX}/hestia-nginx.spec > ${BUILD_DIR_HESTIANGINX}.rpm.log
-        cp ~/rpmbuild/RPMS/x86_64/hestia-nginx-*.rpm $RPM_DIR
-        rm ~/rpmbuild/RPMS/x86_64/hestia-nginx-*.rpm
+        cp ~/rpmbuild/RPMS/$(arch)/hestia-nginx-*.rpm $RPM_DIR
+        rm ~/rpmbuild/RPMS/$(arch)/hestia-nginx-*.rpm
         rm -rf $BUILD_DIR/rpmbuild
     fi
 
@@ -505,33 +505,18 @@ if [ "$PHP_B" = true ] ; then
         cd $BUILD_DIR_PHP
 
         # Configure PHP
-        if [ $BUILD_ARCH = 'amd64' ]; then
-            ./configure --prefix=/usr/local/hestia/php \
-                        --enable-fpm \
-                        --with-fpm-user=admin \
-                        --with-fpm-group=admin \
-                        --with-libdir=lib/x86_64-linux-gnu \
-                        --with-openssl \
-                        --with-mysqli \
-                        --with-gettext \
-                        --with-curl \
-                        --with-zip \
-                        --with-gmp \
-                        --enable-mbstring
-        else
-            ./configure --prefix=/usr/local/hestia/php \
-                        --enable-fpm \
-                        --with-fpm-user=admin \
-                        --with-fpm-group=admin \
-                        --with-libdir=lib/aarch64-linux-gnu \
-                        --with-openssl \
-                        --with-mysqli \
-                        --with-gettext \
-                        --with-curl \
-                        --with-zip \
-                        --with-gmp \
-                        --enable-mbstring
-        fi
+        ./configure --prefix=/usr/local/hestia/php \
+                    --enable-fpm \
+                    --with-fpm-user=admin \
+                    --with-fpm-group=admin \
+                    --with-libdir=lib/$(arch)-linux-gnu \
+                    --with-openssl \
+                    --with-mysqli \
+                    --with-gettext \
+                    --with-curl \
+                    --with-zip \
+                    --with-gmp \
+                    --enable-mbstring
     fi
 
     cd $BUILD_DIR_PHP
@@ -598,8 +583,8 @@ if [ "$PHP_B" = true ] ; then
         mkdir -p $BUILD_DIR/rpmbuild
         echo Building PHP RPM
         rpmbuild -bb --define "sourcedir $BUILD_DIR_HESTIAPHP" --buildroot=$BUILD_DIR/rpmbuild/ ${BUILD_DIR_HESTIAPHP}/hestia-php.spec > ${BUILD_DIR_HESTIAPHP}.rpm.log
-        cp ~/rpmbuild/RPMS/x86_64/hestia-php-*.rpm $RPM_DIR
-        rm ~/rpmbuild/RPMS/x86_64/hestia-php-*.rpm
+        cp ~/rpmbuild/RPMS/$(arch)/hestia-php-*.rpm $RPM_DIR
+        rm ~/rpmbuild/RPMS/$(arch)/hestia-php-*.rpm
         rm -rf $BUILD_DIR/rpmbuild
     fi
 
@@ -700,8 +685,8 @@ if [ "$HESTIA_B" = true ]; then
           mkdir -p $BUILD_DIR/rpmbuild
           echo Building Hestia RPM
           rpmbuild -bb --define "sourcedir $BUILD_DIR_HESTIA" --buildroot=$BUILD_DIR/rpmbuild/ ${BUILD_DIR_HESTIA}/hestia.spec > ${BUILD_DIR_HESTIA}.rpm.log
-          cp ~/rpmbuild/RPMS/x86_64/hestia-*.rpm $RPM_DIR
-          rm ~/rpmbuild/RPMS/x86_64/hestia-*.rpm
+          cp ~/rpmbuild/RPMS/$(arch)/hestia-*.rpm $RPM_DIR
+          rm ~/rpmbuild/RPMS/$(arch)/hestia-*.rpm
           rm -rf $BUILD_DIR/rpmbuild
       fi
   

+ 16 - 6
test/lint_script.sh

@@ -23,12 +23,22 @@ if [ -z "$script" ]; then
 fi
 
 # Install shellcheck
-package_check=$(dpkg -l | grep shellcheck)
-if [ -z "$package_check" ]; then
-    echo "[ * ] Updating APT package cache..."
-    apt-get -qq update > /dev/null 2>&1
-    echo "[ * ] Installing shellcheck code linter..."
-    apt-get -qq install -y shellcheck > /dev/null 2>&1
+if [ -f /etc/redhat-release ]; then
+    package_check=$(rpm -qi ShellCheck)
+    if [ $? -eq 1 ]; then
+        echo "[ * ] Updating DNF package cache..."
+        dnf makecache -q > /dev/null 2>&1
+        echo "[ * ] Installing ShellCheck code linter..."
+        dnf install -q -y ShellCheck > /dev/null 2>&1
+    fi
+else
+    package_check=$(dpkg -l | grep shellcheck)
+    if [ -z "$package_check" ]; then
+        echo "[ * ] Updating APT package cache..."
+        apt-get -qq update > /dev/null 2>&1
+        echo "[ * ] Installing shellcheck code linter..."
+        apt-get -qq install -y shellcheck > /dev/null 2>&1
+    fi
 fi
 
 # Set debug path and ensure it exists