|
|
|
@ -93,10 +93,10 @@ help() {
|
|
|
|
|
-b, --fail2ban Install Fail2ban [yes|no] default: yes
|
|
|
|
|
-q, --quota Filesystem Quota [yes|no] default: no
|
|
|
|
|
-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
|
|
|
|
|
-l, --lang Default language default: en
|
|
|
|
|
-y, --interactive Interactive install [yes|no] default: yes
|
|
|
|
|
-I, --nopublicip Use local ip [yes|no] default: yes
|
|
|
|
|
-s, --hostname Set hostname
|
|
|
|
|
-e, --email Set admin email
|
|
|
|
|
-p, --password Set admin password
|
|
|
|
@ -240,13 +240,13 @@ for arg; do
|
|
|
|
|
--lang) args="${args}-l " ;;
|
|
|
|
|
--interactive) args="${args}-y " ;;
|
|
|
|
|
--api) args="${args}-d " ;;
|
|
|
|
|
--raven) args="${args}-X " ;;
|
|
|
|
|
--hostname) args="${args}-s " ;;
|
|
|
|
|
--email) args="${args}-e " ;;
|
|
|
|
|
--password) args="${args}-p " ;;
|
|
|
|
|
--force) args="${args}-f " ;;
|
|
|
|
|
--with-debs) args="${args}-D " ;;
|
|
|
|
|
--help) args="${args}-h " ;;
|
|
|
|
|
--nopublicip) args="${args}-I " ;;
|
|
|
|
|
*)
|
|
|
|
|
[[ "${arg:0:1}" == "-" ]] || delim="\""
|
|
|
|
|
args="${args}${delim}${arg}${delim} "
|
|
|
|
@ -256,7 +256,7 @@ done
|
|
|
|
|
eval set -- "$args"
|
|
|
|
|
|
|
|
|
|
# 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
|
|
|
|
|
a) apache=$OPTARG ;; # Apache
|
|
|
|
|
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
|
|
|
|
|
l) lang=$OPTARG ;; # Language
|
|
|
|
|
d) api=$OPTARG ;; # Activate API
|
|
|
|
|
X) raven=$OPTARG ;; # Install Raven repo
|
|
|
|
|
y) interactive=$OPTARG ;; # Interactive install
|
|
|
|
|
s) servername=$OPTARG ;; # Hostname
|
|
|
|
|
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
|
|
|
|
|
f) force='yes' ;; # Force install
|
|
|
|
|
h) help ;; # Help
|
|
|
|
|
I) nopublicip=$OPTARG ;; # NoPublicIP
|
|
|
|
|
*) help ;; # Print help (default)
|
|
|
|
|
esac
|
|
|
|
|
done
|
|
|
|
@ -319,7 +319,7 @@ set_default_value 'fail2ban' 'yes'
|
|
|
|
|
set_default_value 'quota' 'no'
|
|
|
|
|
set_default_value 'interactive' 'yes'
|
|
|
|
|
set_default_value 'api' 'yes'
|
|
|
|
|
set_default_value 'raven' 'no'
|
|
|
|
|
set_default_value 'nopublicip' 'yes'
|
|
|
|
|
set_default_port '8083'
|
|
|
|
|
set_default_lang 'en'
|
|
|
|
|
|
|
|
|
@ -669,17 +669,6 @@ fi
|
|
|
|
|
# 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
|
|
|
|
|
mkdir -p /root/.gnupg/ && chmod 700 /root/.gnupg/
|
|
|
|
|
|
|
|
|
@ -690,7 +679,7 @@ echo
|
|
|
|
|
# Installing Nginx repo
|
|
|
|
|
|
|
|
|
|
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
|
|
|
|
|
echo "[ * ] PHP"
|
|
|
|
@ -699,7 +688,7 @@ dnf install -y https://rpms.remirepo.net/enterprise/remi-release-$release.rpm
|
|
|
|
|
# Installing MariaDB repo
|
|
|
|
|
if [ "$mysql" = 'yes' ]; then
|
|
|
|
|
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
|
|
|
|
|
|
|
|
|
|
# Enabling MySQL module
|
|
|
|
@ -712,7 +701,9 @@ fi
|
|
|
|
|
|
|
|
|
|
# Installing HestiaCP repo
|
|
|
|
|
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
|
|
|
|
|
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/php${php_v}-php.${arch}//")
|
|
|
|
|
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
|
|
|
|
|
software=$(echo "$software" | sed -e "s/hestia-nginx//")
|
|
|
|
|
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
|
|
|
|
|
|
|
|
|
|
dnf -y install $software >> $LOG
|
|
|
|
|
dnf -y install $software >> $LOG &
|
|
|
|
|
BACK_PID=$!
|
|
|
|
|
|
|
|
|
|
# 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
|
|
|
|
|
echo "[ * ] Generating default self-signed SSL certificate..."
|
|
|
|
|
$HESTIA/bin/v-generate-ssl-cert $(hostname) '' 'US' 'California' \
|
|
|
|
|
'San Francisco' 'Hestia Control Panel' 'IT' > /tmp/hst.pem
|
|
|
|
|
$HESTIA/bin/v-generate-ssl-cert $(hostname) '' 'RU' 'Moscow' \
|
|
|
|
|
'Moscow' 'Hestia Control Panel' 'IT' > /tmp/hst.pem
|
|
|
|
|
|
|
|
|
|
# Parsing certificate file
|
|
|
|
|
crt_end=$(grep -n "END CERTIFICATE-" /tmp/hst.pem | cut -f 1 -d:)
|
|
|
|
@ -1874,11 +1860,14 @@ if [ "$iptables" = 'yes' ]; then
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
# 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
|
|
|
|
|
$HESTIA/bin/v-change-sys-ip-nat $ip $pub_ip > /dev/null 2>&1
|
|
|
|
|
ip=$pub_ip
|
|
|
|
|
if [ -n "$pub_ip" ] && [ "$pub_ip" != "$ip" ]; then
|
|
|
|
|
$HESTIA/bin/v-change-sys-ip-nat $ip $pub_ip > /dev/null 2>&1
|
|
|
|
|
ip=$pub_ip
|
|
|
|
|
fi
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
# Configuring mod_remoteip
|
|
|
|
@ -1954,8 +1943,21 @@ dnf clean all
|
|
|
|
|
dnf makecache
|
|
|
|
|
dnf -y upgrade >> $LOG &
|
|
|
|
|
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
|
|
|
|
|
|
|
|
|
|
# Check Installation result
|
|
|
|
|
wait $BACK_PID
|
|
|
|
|
check_result $? "dnf upgrade failed"
|
|
|
|
|
|
|
|
|
|
# Starting Hestia service
|
|
|
|
|
systemctl enable hestia --now
|
|
|
|
|
check_result $? "hestia start failed"
|
|
|
|
|