mirror of
https://github.com/retspen/webvirtcloud
synced 2026-07-05 02:55:41 +00:00
Compare commits
No commits in common. "12f0c700698d224029ced2cbfb16d32d36867a5e" and "448c66110bfde95b81bee2b434719d76df7d7e9b" have entirely different histories.
12f0c70069
...
448c66110b
2 changed files with 12 additions and 137 deletions
|
|
@ -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;
|
|
||||||
# }
|
|
||||||
#}
|
|
||||||
|
|
@ -119,7 +119,7 @@ install_packages () {
|
||||||
fi
|
fi
|
||||||
done;
|
done;
|
||||||
;;
|
;;
|
||||||
fedora|openEuler)
|
fedora|uos|openEuler)
|
||||||
for p in $PACKAGES; do
|
for p in $PACKAGES; do
|
||||||
if dnf list installed "$p" >/dev/null 2>&1; then
|
if dnf list installed "$p" >/dev/null 2>&1; then
|
||||||
echo " * $p already installed"
|
echo " * $p already installed"
|
||||||
|
|
@ -129,24 +129,6 @@ install_packages () {
|
||||||
fi
|
fi
|
||||||
done;
|
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
|
esac
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -160,12 +142,7 @@ configure_nginx () {
|
||||||
chown -R "$nginx_group":"$nginx_group" /var/lib/nginx
|
chown -R "$nginx_group":"$nginx_group" /var/lib/nginx
|
||||||
# Copy new configuration and webvirtcloud.conf
|
# Copy new configuration and webvirtcloud.conf
|
||||||
echo " * Copying Nginx configuration"
|
echo " * Copying Nginx configuration"
|
||||||
local nginx_template_conf
|
cp "$APP_PATH"/conf/nginx/"$distro"_nginx.conf /etc/nginx/nginx.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/webvirtcloud.conf /etc/nginx/conf.d/
|
cp "$APP_PATH"/conf/nginx/webvirtcloud.conf /etc/nginx/conf.d/
|
||||||
|
|
||||||
if [ -n "$fqdn" ]; then
|
if [ -n "$fqdn" ]; then
|
||||||
|
|
@ -189,8 +166,7 @@ configure_supervisor () {
|
||||||
create_user () {
|
create_user () {
|
||||||
echo "* Creating webvirtcloud user."
|
echo "* Creating webvirtcloud user."
|
||||||
|
|
||||||
if [ "$distro" == "ubuntu" ] || [ "$distro" == "debian" ] ||
|
if [ "$distro" == "ubuntu" ] || [ "$distro" == "debian" ] ; then
|
||||||
[[ "$distro" == "uos" && "$codename" == "eagle" ]]; then
|
|
||||||
adduser --quiet --disabled-password --gecos '""' "$APP_USER"
|
adduser --quiet --disabled-password --gecos '""' "$APP_USER"
|
||||||
else
|
else
|
||||||
adduser "$APP_USER"
|
adduser "$APP_USER"
|
||||||
|
|
@ -266,7 +242,7 @@ install_webvirtcloud () {
|
||||||
}
|
}
|
||||||
|
|
||||||
set_firewall () {
|
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."
|
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=http/tcp --permanent"
|
||||||
log "firewall-cmd --zone=public --add-port=$novncd_port/tcp --permanent"
|
log "firewall-cmd --zone=public --add-port=$novncd_port/tcp --permanent"
|
||||||
|
|
@ -336,7 +312,7 @@ echo '
|
||||||
'
|
'
|
||||||
|
|
||||||
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 ""
|
echo ""
|
||||||
shopt -s nocasematch
|
shopt -s nocasematch
|
||||||
case $distro in
|
case $distro in
|
||||||
|
|
@ -358,7 +334,7 @@ case $distro in
|
||||||
supervisor_conf_path=/etc/supervisor/conf.d
|
supervisor_conf_path=/etc/supervisor/conf.d
|
||||||
supervisor_file_name=webvirtcloud.conf
|
supervisor_file_name=webvirtcloud.conf
|
||||||
;;
|
;;
|
||||||
*centos*|*redhat*|*ol*|*rhel*|*rocky*|*alma*)
|
*centos*|*redhat*|*ol*|*rhel*|*rocky*)
|
||||||
echo " The installer has detected $distro version $version."
|
echo " The installer has detected $distro version $version."
|
||||||
distro=centos
|
distro=centos
|
||||||
nginx_group=nginx
|
nginx_group=nginx
|
||||||
|
|
@ -368,25 +344,13 @@ case $distro in
|
||||||
supervisor_file_name=webvirtcloud.ini
|
supervisor_file_name=webvirtcloud.ini
|
||||||
;;
|
;;
|
||||||
*Uos*|*uos*)
|
*Uos*|*uos*)
|
||||||
# codename may be fuyu, kongzi, eagle or empty string.
|
echo " The installer has detected $distro version $version."
|
||||||
output_expand=""
|
|
||||||
if test -n "${codename}"; then
|
|
||||||
output_expand=" codename ${codename}"
|
|
||||||
fi
|
|
||||||
echo " The installer has detected $distro version $version${output_expand}."
|
|
||||||
distro=uos
|
distro=uos
|
||||||
|
nginx_group=nginx
|
||||||
nginxfile=/etc/nginx/conf.d/$APP_NAME.conf
|
nginxfile=/etc/nginx/conf.d/$APP_NAME.conf
|
||||||
if test "${codename}" == "eagle"; then
|
supervisor_service=supervisord
|
||||||
nginx_group=www-data
|
supervisor_conf_path=/etc/supervisord.d
|
||||||
supervisor_service=supervisor
|
supervisor_file_name=webvirtcloud.ini
|
||||||
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
|
|
||||||
;;
|
;;
|
||||||
*OpenEuler*|*openEuler*)
|
*OpenEuler*|*openEuler*)
|
||||||
echo " The installer has detected $distro version $version."
|
echo " The installer has detected $distro version $version."
|
||||||
|
|
@ -549,11 +513,7 @@ case $distro in
|
||||||
tzone=\'$(timedatectl|grep "Time zone"| awk '{print $3}')\'
|
tzone=\'$(timedatectl|grep "Time zone"| awk '{print $3}')\'
|
||||||
|
|
||||||
echo "* Installing OS requirements."
|
echo "* Installing OS requirements."
|
||||||
if test "${codename}" == "eagle"; then
|
PACKAGES="git python3-virtualenv python3-devel python3-pip libvirt-devel glibc gcc nginx supervisor python3-lxml python3-libguestfs iproute-tc cyrus-sasl-md5"
|
||||||
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
|
|
||||||
install_packages
|
install_packages
|
||||||
|
|
||||||
set_hosts
|
set_hosts
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue