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

Compare commits

..

No commits in common. "12f0c700698d224029ced2cbfb16d32d36867a5e" and "448c66110bfde95b81bee2b434719d76df7d7e9b" have entirely different histories.

2 changed files with 12 additions and 137 deletions

View file

@ -1,85 +0,0 @@
user www-data;
worker_processes auto;
pid /run/nginx.pid;
include /etc/nginx/modules-enabled/*.conf;
events {
worker_connections 768;
# multi_accept on;
}
http {
##
# Basic Settings
##
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
types_hash_max_size 2048;
# server_tokens off;
# server_names_hash_bucket_size 64;
# server_name_in_redirect off;
include /etc/nginx/mime.types;
default_type application/octet-stream;
##
# SSL Settings
##
ssl_protocols TLSv1 TLSv1.1 TLSv1.2; # Dropping SSLv3, ref: POODLE
ssl_prefer_server_ciphers on;
##
# Logging Settings
##
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;
##
# Gzip Settings
##
gzip on;
# gzip_vary on;
# gzip_proxied any;
# gzip_comp_level 6;
# gzip_buffers 16 8k;
# gzip_http_version 1.1;
# gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;
##
# Virtual Host Configs
##
include /etc/nginx/conf.d/*.conf;
include /etc/nginx/sites-enabled/*;
}
#mail {
# # See sample authentication script at:
# # http://wiki.nginx.org/ImapAuthenticateWithApachePhpScript
#
# # auth_http localhost/auth.php;
# # pop3_capabilities "TOP" "USER";
# # imap_capabilities "IMAP4rev1" "UIDPLUS";
#
# server {
# listen localhost:110;
# protocol pop3;
# proxy on;
# }
#
# server {
# listen localhost:143;
# protocol imap;
# proxy on;
# }
#}

View file

@ -119,7 +119,7 @@ install_packages () {
fi
done;
;;
fedora|openEuler)
fedora|uos|openEuler)
for p in $PACKAGES; do
if dnf list installed "$p" >/dev/null 2>&1; then
echo " * $p already installed"
@ -129,24 +129,6 @@ install_packages () {
fi
done;
;;
uos)
if test "${codename}" == "eagle"; then
check_package_cmd=("dpkg" "-s")
install_package_cmd="apt-get install -y"
else
check_package_cmd=("dnf" "list" "installed")
install_package_cmd="dnf -y install"
fi
for p in $PACKAGES; do
# shellcheck disable=SC2048
if ${check_package_cmd[*]} "$p" >/dev/null 2>&1; then
echo " * $p already installed"
else
echo " * Installing $p"
log "${install_package_cmd} $p"
fi
done
;;
esac
}
@ -160,12 +142,7 @@ configure_nginx () {
chown -R "$nginx_group":"$nginx_group" /var/lib/nginx
# Copy new configuration and webvirtcloud.conf
echo " * Copying Nginx configuration"
local nginx_template_conf
nginx_template_conf="${APP_PATH}/conf/nginx/${distro}_${codename}_nginx.conf"
if ! test -f "${nginx_template_conf}"; then
nginx_template_conf="${APP_PATH}/conf/nginx/${distro}_nginx.conf"
fi
cp "${nginx_template_conf}" /etc/nginx/nginx.conf
cp "$APP_PATH"/conf/nginx/"$distro"_nginx.conf /etc/nginx/nginx.conf
cp "$APP_PATH"/conf/nginx/webvirtcloud.conf /etc/nginx/conf.d/
if [ -n "$fqdn" ]; then
@ -189,8 +166,7 @@ configure_supervisor () {
create_user () {
echo "* Creating webvirtcloud user."
if [ "$distro" == "ubuntu" ] || [ "$distro" == "debian" ] ||
[[ "$distro" == "uos" && "$codename" == "eagle" ]]; then
if [ "$distro" == "ubuntu" ] || [ "$distro" == "debian" ] ; then
adduser --quiet --disabled-password --gecos '""' "$APP_USER"
else
adduser "$APP_USER"
@ -266,7 +242,7 @@ install_webvirtcloud () {
}
set_firewall () {
if test -n "$(command -v firewall-cmd)" && test "$(firewall-cmd --state)" == "running"; then
if [ "$(firewall-cmd --state)" == "running" ]; then
echo "* Configuring firewall to allow HTTP & novnc traffic."
log "firewall-cmd --zone=public --add-port=http/tcp --permanent"
log "firewall-cmd --zone=public --add-port=$novncd_port/tcp --permanent"
@ -336,7 +312,7 @@ echo '
'
echo ""
echo " Welcome to Webvirtcloud Installer for RHEL&Alternatives, Fedora, Debian and Ubuntu!"
echo " Welcome to Webvirtcloud Installer for CentOS, Fedora, Debian and Ubuntu!"
echo ""
shopt -s nocasematch
case $distro in
@ -358,7 +334,7 @@ case $distro in
supervisor_conf_path=/etc/supervisor/conf.d
supervisor_file_name=webvirtcloud.conf
;;
*centos*|*redhat*|*ol*|*rhel*|*rocky*|*alma*)
*centos*|*redhat*|*ol*|*rhel*|*rocky*)
echo " The installer has detected $distro version $version."
distro=centos
nginx_group=nginx
@ -368,25 +344,13 @@ case $distro in
supervisor_file_name=webvirtcloud.ini
;;
*Uos*|*uos*)
# codename may be fuyu, kongzi, eagle or empty string.
output_expand=""
if test -n "${codename}"; then
output_expand=" codename ${codename}"
fi
echo " The installer has detected $distro version $version${output_expand}."
echo " The installer has detected $distro version $version."
distro=uos
nginx_group=nginx
nginxfile=/etc/nginx/conf.d/$APP_NAME.conf
if test "${codename}" == "eagle"; then
nginx_group=www-data
supervisor_service=supervisor
supervisor_conf_path=/etc/supervisor/conf.d
supervisor_file_name=webvirtcloud.conf
else
nginx_group=nginx
supervisor_service=supervisord
supervisor_conf_path=/etc/supervisord.d
supervisor_file_name=webvirtcloud.ini
fi
supervisor_service=supervisord
supervisor_conf_path=/etc/supervisord.d
supervisor_file_name=webvirtcloud.ini
;;
*OpenEuler*|*openEuler*)
echo " The installer has detected $distro version $version."
@ -549,11 +513,7 @@ case $distro in
tzone=\'$(timedatectl|grep "Time zone"| awk '{print $3}')\'
echo "* Installing OS requirements."
if test "${codename}" == "eagle"; then
PACKAGES="git virtualenv python3-virtualenv python3-dev python3-lxml libvirt-dev zlib1g-dev libxslt1-dev nginx supervisor libsasl2-modules gcc pkg-config python3-guestfs uuid"
else
PACKAGES="git python3-virtualenv python3-devel python3-pip libvirt-devel glibc gcc nginx supervisor python3-lxml python3-libguestfs iproute-tc cyrus-sasl-md5"
fi
PACKAGES="git python3-virtualenv python3-devel python3-pip libvirt-devel glibc gcc nginx supervisor python3-lxml python3-libguestfs iproute-tc cyrus-sasl-md5"
install_packages
set_hosts