From a5fb0ac334b13acfa17655f0a0dcbcf1d8b0b476 Mon Sep 17 00:00:00 2001 From: qiaofeng1227 <76487013@qq.com> Date: Sat, 29 Jul 2023 11:07:34 +0800 Subject: [PATCH] 0.8.8 --- appmanage/Dockerfile | 2 +- appmanage/api/utils/const.py | 3 +- install/install.sh | 84 +++++++++++++++++++----------------- 3 files changed, 47 insertions(+), 42 deletions(-) diff --git a/appmanage/Dockerfile b/appmanage/Dockerfile index dbccd1bb..5b30af76 100644 --- a/appmanage/Dockerfile +++ b/appmanage/Dockerfile @@ -11,7 +11,7 @@ COPY static ./static COPY requirements.txt main.py database.sqlite ./ RUN apt update -# Install supervisord +# Install supervisords RUN apt install -y supervisor COPY config/supervisord.conf /etc/supervisor/conf.d/supervisord.conf COPY config/cmd.sh /cmd.sh diff --git a/appmanage/api/utils/const.py b/appmanage/api/utils/const.py index 4cd6c760..896d4683 100644 --- a/appmanage/api/utils/const.py +++ b/appmanage/api/utils/const.py @@ -34,4 +34,5 @@ APP_STATUS_RESTARTING = "restarting" APP_STATUS_FAILED = "failed" NGINX_URL="http://websoft9-nginxproxymanager:81" -ARTIFACT_URL="https://artifact.azureedge.net/release/websoft9" +#ARTIFACT_URL="https://artifact.azureedge.net/release/websoft9" +ARTIFACT_URL="hw9artifact.blob.core.windows.net/release/websoft9" diff --git a/install/install.sh b/install/install.sh index 05ae9056..ebbe5947 100644 --- a/install/install.sh +++ b/install/install.sh @@ -54,19 +54,7 @@ function get_os_version() { VERSION=$(uname -r) fi - if [[ "$OS" == "CentOS Linux" && "$VERSION" =~ ^7|8$ ]]; then - echo "CentOS"$VERSION - elif [[ "$OS" == "Oracle Linux Server" && "$VERSION" =~ ^7|8$ ]]; then - echo "OracleLinux"$VERSION - elif [[ "$OS" == "Debian GNU/Linux" && "$VERSION" =~ ^9|10|11$ ]]; then - echo "Debian"$VERSION - elif [[ "$OS" == "Ubuntu" && "$VERSION" =~ ^20.04|20.10|21.04|21.10|22.04$ ]]; then - echo "Ubuntu"$VERSION - elif [[ "$OS" =~ "Red Hat Enterprise Linux" && "$VERSION" =~ ^7|8$ ]]; then - echo "Redhat"$VERSION - else - echo $OS $VERSION - fi + echo $VERSION } os_type=$(get_os_type) os_version=$(get_os_version) @@ -90,35 +78,51 @@ else exit 1 fi -if [ -f /etc/os-release ]; then - . /etc/os-release - OS=$NAME - VERSION=$VERSION_ID -elif type lsb_release >/dev/null 2>&1; then - OS=$(lsb_release -si) - VERSION=$(lsb_release -sr) -else - OS=$(uname -s) - VERSION=$(uname -r) +if [ "$os_type" == 'CentOS' ] ;then + if [ "$os_version" != "7" ]; then + echo "This app only supported on CentOS 7" + exit 1 + fi fi -if [[ "$OS" == "CentOS Linux" && "$VERSION" =~ ^[0-6]$ ]]; then - echo "This script only works on CentOS 7 or later." - exit 1 -elif [[ "$OS" == "CentOS Stream" && ! "$VERSION" =~ ^(8|9)$ ]]; then - echo "This script only works on CentOS Stream 8,9." - exit 1 -elif [[ "$OS" == "Ubuntu" && "$VERSION" =~ ^1[0-7].*$ ]]; then - echo "This script only works on Ubuntu 18.04 or later." - exit 1 -elif [[ "$OS" == "Debian GNU/Linux" && "$VERSION" =~ ^[1-8]$ ]]; then - echo "This script only works on Debian 9 or later." - exit 1 -elif [[ "$OS" =~ "Red Hat Enterprise Linux" && "$VERSION" =~ ^[0-6]$ ]]; then - echo "This script only works on Red Hat 7 or later." - exit 1 -else - echo "Your server os is supported to install this software." +if [ "$os_type" == 'CentOS Stream' ] ;then + if [ "$os_version" != "8" ]; then + echo "This app only supported on CentOS Stream 8" + exit 1 + fi +fi + +if [ "$os_type" == 'Rocky Linux' ] ;then + if [ "$os_version" =~ ^[^8] ]; then + echo "This app only supported on Rocky Linux 8" + exit 1 + fi +fi + +if [ "$os_type" == 'Fedora' ];then + sudo yum update -y + sudo yum install git curl wget yum-utils jq bc unzip -y + +fi + +if [ "$os_type" == 'Redhat' ];then + if [ "$os_version" =~ ^[^8] ] and [ "$os_version" =~ ^[^7]] ; then + echo "This app only supported on Redhat 7,8" + exit 1 + fi +fi + +if [ "$os_type" == 'Ubuntu' ];then + if [ "$os_version" != "22.04" ] and [ "$os_version" != "20.04" ] and [ "$os_version" != "18.04" ]; then + echo "This app only supported on Ubuntu 22.04,20.04,18.04" + exit 1 + fi +fi + +if [ "$os_type" == 'Debian' ];then + sudo yum update -y + sudo yum install git curl wget yum-utils jq bc unzip -y + fi # Check port used