Added fixes to rpm installation

devel
Alexey Berezhok 1 year ago
parent 34da9e801f
commit 4c1c89bc25

@ -93,10 +93,10 @@ help() {
-b, --fail2ban Install Fail2ban [yes|no] default: yes -b, --fail2ban Install Fail2ban [yes|no] default: yes
-q, --quota Filesystem Quota [yes|no] default: no -q, --quota Filesystem Quota [yes|no] default: no
-d, --api Activate API [yes|no] default: yes -d, --api Activate API [yes|no] default: yes
-X, --raven Install Raven modular repo [yes|no] default: no
-r, --port Change Backend Port default: 8083 -r, --port Change Backend Port default: 8083
-l, --lang Default language default: en -l, --lang Default language default: en
-y, --interactive Interactive install [yes|no] default: yes -y, --interactive Interactive install [yes|no] default: yes
-I, --nopublicip Use local ip [yes|no] default: yes
-s, --hostname Set hostname -s, --hostname Set hostname
-e, --email Set admin email -e, --email Set admin email
-p, --password Set admin password -p, --password Set admin password
@ -240,13 +240,13 @@ for arg; do
--lang) args="${args}-l " ;; --lang) args="${args}-l " ;;
--interactive) args="${args}-y " ;; --interactive) args="${args}-y " ;;
--api) args="${args}-d " ;; --api) args="${args}-d " ;;
--raven) args="${args}-X " ;;
--hostname) args="${args}-s " ;; --hostname) args="${args}-s " ;;
--email) args="${args}-e " ;; --email) args="${args}-e " ;;
--password) args="${args}-p " ;; --password) args="${args}-p " ;;
--force) args="${args}-f " ;; --force) args="${args}-f " ;;
--with-debs) args="${args}-D " ;; --with-debs) args="${args}-D " ;;
--help) args="${args}-h " ;; --help) args="${args}-h " ;;
--nopublicip) args="${args}-I " ;;
*) *)
[[ "${arg:0:1}" == "-" ]] || delim="\"" [[ "${arg:0:1}" == "-" ]] || delim="\""
args="${args}${delim}${arg}${delim} " args="${args}${delim}${arg}${delim} "
@ -256,7 +256,7 @@ done
eval set -- "$args" eval set -- "$args"
# Parsing arguments # Parsing arguments
while getopts "a:w:v:j:k:m:M:g:d:x:z:Z:c:t:i:b:r:o:q:l:y:s:e:p:R:fh" Option; do while getopts "I:a:w:v:j:k:m:M:g:d:x:z:Z:c:t:i:b:r:o:q:l:y:s:e:p:R:fh" Option; do
case $Option in case $Option in
a) apache=$OPTARG ;; # Apache a) apache=$OPTARG ;; # Apache
w) phpfpm=$OPTARG ;; # PHP-FPM w) phpfpm=$OPTARG ;; # PHP-FPM
@ -278,7 +278,6 @@ while getopts "a:w:v:j:k:m:M:g:d:x:z:Z:c:t:i:b:r:o:q:l:y:s:e:p:R:fh" Option; do
r) port=$OPTARG ;; # Backend Port r) port=$OPTARG ;; # Backend Port
l) lang=$OPTARG ;; # Language l) lang=$OPTARG ;; # Language
d) api=$OPTARG ;; # Activate API d) api=$OPTARG ;; # Activate API
X) raven=$OPTARG ;; # Install Raven repo
y) interactive=$OPTARG ;; # Interactive install y) interactive=$OPTARG ;; # Interactive install
s) servername=$OPTARG ;; # Hostname s) servername=$OPTARG ;; # Hostname
e) email=$OPTARG ;; # Admin email e) email=$OPTARG ;; # Admin email
@ -286,6 +285,7 @@ while getopts "a:w:v:j:k:m:M:g:d:x:z:Z:c:t:i:b:r:o:q:l:y:s:e:p:R:fh" Option; do
R) withrpms=$OPTARG ;; # Hestia rpms path R) withrpms=$OPTARG ;; # Hestia rpms path
f) force='yes' ;; # Force install f) force='yes' ;; # Force install
h) help ;; # Help h) help ;; # Help
I) nopublicip=$OPTARG ;; # NoPublicIP
*) help ;; # Print help (default) *) help ;; # Print help (default)
esac esac
done done
@ -319,7 +319,7 @@ set_default_value 'fail2ban' 'yes'
set_default_value 'quota' 'no' set_default_value 'quota' 'no'
set_default_value 'interactive' 'yes' set_default_value 'interactive' 'yes'
set_default_value 'api' 'yes' set_default_value 'api' 'yes'
set_default_value 'raven' 'no' set_default_value 'nopublicip' 'yes'
set_default_port '8083' set_default_port '8083'
set_default_lang 'en' set_default_lang 'en'
@ -669,17 +669,6 @@ fi
# Install repository # # Install repository #
#----------------------------------------------------------# #----------------------------------------------------------#
# Installing Raven repository (required for some apache modules and old PHP versions)
if [ "$raven" = 'yes' ] && [ ! -e "/etc/yum.repos.d/raven.repo" ]; then
dnf -y localinstall https://pkgs.dyn.su/el${release}/base/x86_64/raven-release.el${release}.noarch.rpm
check_result $? "Can't install Raven RPM repository"
dnf config-manager --set-enabled raven-modular
fi
if [ "$raven" = 'yes' ] && [ "$multiphp" = 'yes' ]; then
multiphp_v=("56" "70" "71" "72" "73" "74" "80" "81" "82" "83")
fi
# Create new folder if not all-ready exists # Create new folder if not all-ready exists
mkdir -p /root/.gnupg/ && chmod 700 /root/.gnupg/ mkdir -p /root/.gnupg/ && chmod 700 /root/.gnupg/
@ -690,7 +679,7 @@ echo
# Installing Nginx repo # Installing Nginx repo
echo "[ * ] NGINX" echo "[ * ] NGINX"
dnf config-manager --add-repo https://raw.githubusercontent.com/hestiacp/hestiacp/main/install/rpm/nginx/nginx.repo dnf config-manager --add-repo https://dev.putey.net/bayrepo/hestiacp/raw/branch/master/install/rpm/nginx/nginx.repo
# Installing Remi PHP repo # Installing Remi PHP repo
echo "[ * ] PHP" echo "[ * ] PHP"
@ -699,7 +688,7 @@ dnf install -y https://rpms.remirepo.net/enterprise/remi-release-$release.rpm
# Installing MariaDB repo # Installing MariaDB repo
if [ "$mysql" = 'yes' ]; then if [ "$mysql" = 'yes' ]; then
echo "[ * ] MariaDB" echo "[ * ] MariaDB"
dnf config-manager --add-repo https://raw.githubusercontent.com/hestiacp/hestiacp/main/install/rpm/mysql/mariadb-$(arch).repo dnf config-manager --add-repo https://dev.putey.net/bayrepo/hestiacp/raw/branch/master/install/rpm/mysql/mariadb-$(arch).repo
fi fi
# Enabling MySQL module # Enabling MySQL module
@ -712,7 +701,9 @@ fi
# Installing HestiaCP repo # Installing HestiaCP repo
echo "[ * ] Hestia Control Panel" echo "[ * ] Hestia Control Panel"
dnf config-manager --add-repo https://raw.githubusercontent.com/raven-kg/hestiacp/hcp-rhel-rx/install/rpm/hestia/hestia.repo dnf config-manager --add-repo https://dev.putey.net/bayrepo/hestiacp/raw/branch/master/install/rpm/hestia/hestia.repo
rpm --import https://repo.putey.net/repo/gpgkeys/repo.putey.net.pub
check_result $? "rpm import putey.net GPG key failed"
# Installing PostgreSQL repo # Installing PostgreSQL repo
if [ "$postgresql" = 'yes' ]; then if [ "$postgresql" = 'yes' ]; then
@ -894,11 +885,6 @@ if [ "$phpfpm" = 'yes' ]; then
software=$(echo "$software" | sed -e "s/mod_fcgid//") software=$(echo "$software" | sed -e "s/mod_fcgid//")
software=$(echo "$software" | sed -e "s/php${php_v}-php.${arch}//") software=$(echo "$software" | sed -e "s/php${php_v}-php.${arch}//")
fi fi
if [ "$raven" = 'no' ]; then
software=$(echo "$software" | sed -e "s/httpd-itk//")
software=$(echo "$software" | sed -e "s/mod_ruid2//")
software=$(echo "$software" | sed -e "s/mod_suphp//")
fi
if [ -d "$withrpms" ]; then if [ -d "$withrpms" ]; then
software=$(echo "$software" | sed -e "s/hestia-nginx//") software=$(echo "$software" | sed -e "s/hestia-nginx//")
software=$(echo "$software" | sed -e "s/hestia-php//") software=$(echo "$software" | sed -e "s/hestia-php//")
@ -914,7 +900,7 @@ echo "The installer is now downloading and installing all required packages."
echo -ne "NOTE: This process may take 10 to 15 minutes to complete, please wait... " echo -ne "NOTE: This process may take 10 to 15 minutes to complete, please wait... "
echo echo
dnf -y install $software >> $LOG dnf -y install $software >> $LOG &
BACK_PID=$! BACK_PID=$!
# Check if package installation is done, print a spinner # Check if package installation is done, print a spinner
@ -1213,8 +1199,8 @@ $HESTIA/bin/v-change-sys-hostname $servername > /dev/null 2>&1
# Generating SSL certificate # Generating SSL certificate
echo "[ * ] Generating default self-signed SSL certificate..." echo "[ * ] Generating default self-signed SSL certificate..."
$HESTIA/bin/v-generate-ssl-cert $(hostname) '' 'US' 'California' \ $HESTIA/bin/v-generate-ssl-cert $(hostname) '' 'RU' 'Moscow' \
'San Francisco' 'Hestia Control Panel' 'IT' > /tmp/hst.pem 'Moscow' 'Hestia Control Panel' 'IT' > /tmp/hst.pem
# Parsing certificate file # Parsing certificate file
crt_end=$(grep -n "END CERTIFICATE-" /tmp/hst.pem | cut -f 1 -d:) crt_end=$(grep -n "END CERTIFICATE-" /tmp/hst.pem | cut -f 1 -d:)
@ -1874,11 +1860,14 @@ if [ "$iptables" = 'yes' ]; then
fi fi
# Get public IP # Get public IP
pub_ip=$(curl --ipv4 -s https://ip.hestiacp.com/) pub_ip=$ip
if [ "$nopublicip" = 'no' ]; then
pub_ip=$(curl --ipv4 -s https://ip.hestiacp.com/)
if [ -n "$pub_ip" ] && [ "$pub_ip" != "$ip" ]; then if [ -n "$pub_ip" ] && [ "$pub_ip" != "$ip" ]; then
$HESTIA/bin/v-change-sys-ip-nat $ip $pub_ip > /dev/null 2>&1 $HESTIA/bin/v-change-sys-ip-nat $ip $pub_ip > /dev/null 2>&1
ip=$pub_ip ip=$pub_ip
fi
fi fi
# Configuring mod_remoteip # Configuring mod_remoteip
@ -1954,8 +1943,21 @@ dnf clean all
dnf makecache dnf makecache
dnf -y upgrade >> $LOG & dnf -y upgrade >> $LOG &
BACK_PID=$! BACK_PID=$!
# Check if package installation is done, print a spinner
spin_i=1
while kill -0 $BACK_PID > /dev/null 2>&1; do
printf "\b${spinner:spin_i++%${#spinner}:1}"
sleep 0.5
done
# Do a blank echo to get the \n back
echo echo
# Check Installation result
wait $BACK_PID
check_result $? "dnf upgrade failed"
# Starting Hestia service # Starting Hestia service
systemctl enable hestia --now systemctl enable hestia --now
check_result $? "hestia start failed" check_result $? "hestia start failed"

@ -1,7 +1,7 @@
[hestiacp] [hestiacp]
name=HestiaCP Repository for RHEL $releasever - $basearch name=msvsphere9 repo on repo.putey.net
#baseurl=https://rpm.hestiacp.com/rhel/$releasever/$basearch/ comment=msvsphere9 repo on repo.putey.net
baseurl=https://pkgs.dyn.su/hestiacp/el$releasever/$basearch/ baseurl=https://repo.putey.net/repo/msvsphere9_preprod
#gpgkey=https://rpm.hestiacp.com/RPM-GPG-KEY-HESTIACP
gpgcheck=0
enabled=1 enabled=1
gpgkey=https://repo.putey.net/repo/gpgkeys/repo.putey.net.pub
gpgcheck=1
Loading…
Cancel
Save