1
0
Fork 0
mirror of https://github.com/retspen/webvirtcloud synced 2025-07-31 12:41:08 +00:00

Merge pull request #675 from catborise/master

update packages && installation script
This commit is contained in:
catborise 2025-07-01 15:08:25 +03:00 committed by GitHub
commit c0f31909bd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 82 additions and 37 deletions

View file

@ -32,7 +32,7 @@ WebVirtCloud is a virtualization web interface for admins and users. It can dele
## Quick Install with Installer (Beta)
Install an OS and run specified commands. Installer supported OSes: Ubuntu 18.04/20.04, Debian 10/11, Centos/OEL/RHEL 8.
Install an OS and run specified commands. Installer supported OSes: Ubuntu 20.04/22.04, Debian 10/11, Rocky/Alma/OEL/RHEL 10.
It can be installed on a virtual machine, physical host or on a KVM host.
```bash
@ -94,7 +94,7 @@ Done!!
Go to http://serverip and you should see the login screen.
### Install WebVirtCloud panel (CentOS8/OEL8)
### Install WebVirtCloud panel (RHEL Based OS 8/9/10)
```bash
sudo yum -y install epel-release
@ -123,7 +123,7 @@ python3 manage.py migrate
python3 manage.py collectstatic --noinput
```
#### Configure the supervisor for CentOS
#### Configure the supervisor for RHEL Based OS
Add the following after the [include] line (after **files = ...** actually):
```bash

View file

@ -1,27 +1,27 @@
Django==4.2.20
Django==4.2.23
django_bootstrap5==25.1
django-bootstrap-icons==0.9.0
django-login-required-middleware==0.9.0
django-otp==1.6.0
django-qr-code==4.1.0
django-auth-ldap==5.1.0
django-qr-code==4.2.0
django-auth-ldap==5.2.0
djangorestframework==3.16.0
drf-nested-routers==0.94.1
drf-nested-routers==0.94.2
drf-yasg==1.21.10
eventlet==0.39.1
eventlet==0.40.1
gunicorn==23.0.0
libsass==0.23.0
libvirt-python==11.2.0
lxml==5.4.0
libvirt-python==11.4.0
lxml==6.0.0
ldap3==2.9.1
markdown==3.6
markdown==3.8.2
#psycopg2-binary
python-engineio==4.12.0
python-socketio==5.13.0
qrcode==8.2
rwlock==0.0.7
tzdata
websockify==0.12.0
websockify==0.13.0
whitenoise==6.9.0
zipp==3.21.0
zipp==3.23.0
crypt-r==3.13.1

View file

@ -1,9 +1,9 @@
-r ../conf/requirements.txt
coverage==7.8.0
coverage==7.9.1
django-debug-toolbar==5.2.0
django-debug-toolbar-template-profiler
pycodestyle==2.13.0
pyflakes==3.3.2
pylint==3.3.6
pycodestyle==2.14.0
pyflakes==3.4.0
pylint==3.3.7
yapf==0.43.0
black==25.1.0

View file

@ -181,6 +181,7 @@ configure_nginx () {
configure_supervisor () {
# Copy template supervisor service for gunicorn and novnc
echo " * Copying supervisor configuration"
mkdir -p "$supervisor_conf_path" > /dev/null 2>&1
cp "$APP_PATH"/conf/supervisor/webvirtcloud.conf "$supervisor_conf_path"/"$supervisor_file_name"
nginx_group_escape="$(echo -n "$nginx_group"|sed -e 's/[](){}<>=:\!\?\+\|\/\&$*.^[]/\\&/g')"
sed -i "s|^\\(user=\\).*|\\1$nginx_group_escape|" "$supervisor_conf_path/$supervisor_file_name"
@ -208,8 +209,40 @@ run_as_app_user () {
fi
}
check_python () {
# check if python3 is installed.
if ! hash "$PYTHON" 2>/dev/null; then
echo "Python3 is not installed. Please install Python3 and try again."
exit 1
fi
# check if python3 version is grater than 3.10 amd set it as default
if ! "$PYTHON" -c 'import sys; assert sys.version_info >= (3, 10)' >/dev/null 2>&1; then
echo "Your Python version is less than 3.10. This script requires Python 3.10 or greater."
echo "Please install Python 3.10 or greater and set it as the default version."
echo "Use update-alternatives command to set default python version to latest."
echo "For example: sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.10 1"
echo "Then run this script again."
echo "Do not forget to install pip3 and python3-devel for python3.10 or later."
exit 1
fi
# check if pip3 is installed
if ! hash pip3 2>/dev/null; then
echo "pip3 is not installed. Please install pip3 and try again."
exit 1
fi
}
activate_python_environment () {
cd "$APP_PATH" || exit
# Check if virtualenv is installed
if ! "$PYTHON" -c 'import virtualenv' >/dev/null 2>&1; then
echo "Virtualenv is not installed. Please install virtualenv and try again."
exit 1
fi
# Create a virtual environment
echo "* Creating virtual environment in $APP_PATH/venv"
virtualenv -p "$PYTHON" venv
# shellcheck disable=SC1091
source venv/bin/activate
@ -254,6 +287,9 @@ install_webvirtcloud () {
done
sed -i "s|^\\(CSRF_TRUSTED_ORIGINS = \\).*|\\1\[ \'http://$fqdn\', $host_ip ]|" /srv/webvirtcloud/webvirtcloud/settings.py
echo "* Checking up Python3 version."
check_python
echo "* Activate virtual environment."
activate_python_environment
@ -350,7 +386,7 @@ echo '
'
echo ""
echo " Welcome to Webvirtcloud Installer for RHEL&Alternatives, Fedora, Debian and Ubuntu!"
echo " Welcome to Webvirtcloud Installer for RHEL Based OSes, Debian and Ubuntu!"
echo ""
shopt -s nocasematch
case $distro in
@ -475,7 +511,7 @@ echo "========="
case $distro in
debian)
if [[ "$version" -ge 9 ]]; then
# Install for Debian 9.x / 10.x
# Install for Debian 9.x / 10.x / 12.x
tzone=\'$(cat /etc/timezone)\'
echo -n "* Updating installed packages."
@ -503,7 +539,7 @@ case $distro in
fi
;;
ubuntu)
if [ "$version" == "18.04" ] || [ "$version" == "20.04" ]; then
if [ "$version" == "18.04" ] || [ "$version" == "20.04" ] || [ "$version" == "22.04" ]; then
# Install for Ubuntu 18 / 20
tzone=\'$(cat /etc/timezone)\'
@ -532,12 +568,20 @@ case $distro in
fi
;;
centos)
if [[ "$version" =~ ^8 ]] || [[ "$version" =~ ^9 ]]; then
# Install for CentOS/Redhat 8
if [[ "$version" =~ ^10 ]]; then
# Install for CentOS/Redhat 10
tzone=\'$(timedatectl|grep "Time zone"| awk '{print $3}')\'
echo "* Adding wget & epel-release repository."
log "yum -y install wget epel-release"
if command -v "crb" >/dev/null 2>&1; then
echo "* CRB Repo is found, enabling it."
log "crb enable > /dev/null 2>&1"
else
echo "* Enabling CRB repository."
log "dnf config-manager --set-enabled crb"
fi
echo "* Adding wget & epel-release & supervisor repository."
log "yum -y install wget epel-release supervisor"
echo "* Installing OS requirements."
PACKAGES="git python3-virtualenv python3-devel libvirt-devel glibc gcc nginx python3-lxml python3-libguestfs iproute-tc cyrus-sasl-md5 openldap-devel"
@ -545,13 +589,15 @@ case $distro in
set_hosts
echo "* Configuring virtualenv."
log "pip3 install virtualenv"
install_webvirtcloud
echo "* Configuring Nginx."
configure_nginx
echo "* Configuring Supervisor."
log "pip install supervisor "
log "pip3 install supervisor "
configure_supervisor
set_firewall
@ -561,9 +607,8 @@ case $distro in
restart_supervisor
restart_nginx
else
echo "Unsupported CentOS version. Version found: $version"
echo "Unsupported RHEL Based OS($distro) version. Version found: $version"
exit 1
fi
;;