From c4d8b63d32fe370d7404ae70e5c0e343de87fbf9 Mon Sep 17 00:00:00 2001
From: UUBulb <35923940+uubulb@users.noreply.github.com>
Date: Sat, 5 Oct 2024 23:43:16 +0800
Subject: [PATCH] installer: fix docker-compose detection (#427)
---
README.md | 2 +-
script/install.sh | 10 ++++++----
script/install_en.sh | 10 ++++++----
3 files changed, 13 insertions(+), 9 deletions(-)
diff --git a/README.md b/README.md
index 9ede8d5..34755ec 100644
--- a/README.md
+++ b/README.md
@@ -4,7 +4,7 @@
LOGO designed by 熊大 .
-
+
:trollface: Nezha Monitoring: Self-hostable, lightweight, servers and websites monitoring and O&M tool.
diff --git a/script/install.sh b/script/install.sh index 65e1112..b52e6e9 100755 --- a/script/install.sh +++ b/script/install.sh @@ -12,7 +12,7 @@ NZ_DASHBOARD_PATH="${NZ_BASE_PATH}/dashboard" NZ_AGENT_PATH="${NZ_BASE_PATH}/agent" NZ_DASHBOARD_SERVICE="/etc/systemd/system/nezha-dashboard.service" NZ_DASHBOARD_SERVICERC="/etc/init.d/nezha-dashboard" -NZ_VERSION="v0.19.0" +NZ_VERSION="v0.19.1" red='\033[0;31m' green='\033[0;32m' @@ -65,6 +65,8 @@ geo_check() { } pre_check() { + umask 077 + ## os_arch if uname -m | grep -q 'x86_64'; then os_arch="amd64" @@ -168,6 +170,9 @@ installation_check() { echo "未找到带有 nezha-dashboard 仓库的 Docker 镜像。" fi fi + else + err "请手动安装 docker-compose。https://docs.docker.com/compose/install/linux/" + exit 1 fi if [ -f "$NZ_DASHBOARD_PATH/app" ]; then @@ -288,8 +293,6 @@ install_dashboard() { esac fi - sudo chmod -R 700 $NZ_DASHBOARD_PATH - if [ "$IS_DOCKER_NEZHA" = 1 ]; then install_dashboard_docker elif [ "$IS_DOCKER_NEZHA" = 0 ]; then @@ -375,7 +378,6 @@ install_agent() { # 哪吒监控文件夹 sudo mkdir -p $NZ_AGENT_PATH - sudo chmod -R 700 $NZ_AGENT_PATH echo "正在下载监控端" if [ -z "$CN" ]; then diff --git a/script/install_en.sh b/script/install_en.sh index 32dafa9..43fb882 100755 --- a/script/install_en.sh +++ b/script/install_en.sh @@ -12,7 +12,7 @@ NZ_DASHBOARD_PATH="${NZ_BASE_PATH}/dashboard" NZ_AGENT_PATH="${NZ_BASE_PATH}/agent" NZ_DASHBOARD_SERVICE="/etc/systemd/system/nezha-dashboard.service" NZ_DASHBOARD_SERVICERC="/etc/init.d/nezha-dashboard" -NZ_VERSION="v0.19.0" +NZ_VERSION="v0.19.1" red='\033[0;31m' green='\033[0;32m' @@ -65,6 +65,8 @@ geo_check() { } pre_check() { + umask 077 + ## os_arch if uname -m | grep -q 'x86_64'; then os_arch="amd64" @@ -167,6 +169,9 @@ installation_check() { echo "No Docker images with the nezha-dashboard repository were found." fi fi + else + err "Please install docker-compose manually. https://docs.docker.com/compose/install/linux/" + exit 1 fi if [ -f "$NZ_DASHBOARD_PATH/app" ]; then @@ -287,8 +292,6 @@ install_dashboard() { esac fi - sudo chmod -R 700 $NZ_DASHBOARD_PATH - if [ "$IS_DOCKER_NEZHA" = 1 ]; then install_dashboard_docker elif [ "$IS_DOCKER_NEZHA" = 0 ]; then @@ -374,7 +377,6 @@ install_agent() { # Nezha Monitoring Folder sudo mkdir -p $NZ_AGENT_PATH - sudo chmod -R 700 $NZ_AGENT_PATH echo "Downloading Agent" wget -t 2 -T 60 -O nezha-agent_linux_${os_arch}.zip https://${GITHUB_URL}/nezhahq/agent/releases/download/${version}/nezha-agent_linux_${os_arch}.zip >/dev/null 2>&1