diff --git a/README.md b/README.md index 82b0952..8621594 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@
LOGO designed by 熊大 .

-    +   

:trollface: Nezha Monitoring: Self-hosted, lightweight server and website monitoring and O&M tool.

diff --git a/script/install.sh b/script/install.sh index 07bc863..4fb68af 100755 --- a/script/install.sh +++ b/script/install.sh @@ -11,7 +11,7 @@ NZ_BASE_PATH="/opt/nezha" NZ_DASHBOARD_PATH="${NZ_BASE_PATH}/dashboard" NZ_AGENT_PATH="${NZ_BASE_PATH}/agent" NZ_AGENT_SERVICE="/etc/systemd/system/nezha-agent.service" -NZ_VERSION="v0.10.3" +NZ_VERSION="v0.10.4" red='\033[0;31m' green='\033[0;32m' @@ -309,15 +309,13 @@ modify_dashboard_config() { echo -e "> 修改面板配置" echo -e "正在下载 Docker 脚本" - wget -O ${NZ_DASHBOARD_PATH}/docker-compose.yaml https://${GITHUB_RAW_URL}/script/docker-compose.yaml >/dev/null 2>&1 + wget -O /tmp/nezha-docker-compose.yaml https://${GITHUB_RAW_URL}/script/docker-compose.yaml >/dev/null 2>&1 if [[ $? != 0 ]]; then echo -e "${red}下载脚本失败,请检查本机能否连接 ${GITHUB_RAW_URL}${plain}" return 0 fi - mkdir -p $NZ_DASHBOARD_PATH/data - - wget -O ${NZ_DASHBOARD_PATH}/data/config.yaml https://${GITHUB_RAW_URL}/script/config.yaml >/dev/null 2>&1 + wget -O /tmp/nezha-config.yaml https://${GITHUB_RAW_URL}/script/config.yaml >/dev/null 2>&1 if [[ $? != 0 ]]; then echo -e "${red}下载脚本失败,请检查本机能否连接 ${GITHUB_RAW_URL}${plain}" return 0 @@ -349,15 +347,19 @@ modify_dashboard_config() { nz_oauth2_type=github fi - sed -i "s/nz_oauth2_type/${nz_oauth2_type}/" ${NZ_DASHBOARD_PATH}/data/config.yaml - sed -i "s/nz_admin_logins/${nz_admin_logins}/" ${NZ_DASHBOARD_PATH}/data/config.yaml - sed -i "s/nz_grpc_port/${nz_grpc_port}/" ${NZ_DASHBOARD_PATH}/data/config.yaml - sed -i "s/nz_github_oauth_client_id/${nz_github_oauth_client_id}/" ${NZ_DASHBOARD_PATH}/data/config.yaml - sed -i "s/nz_github_oauth_client_secret/${nz_github_oauth_client_secret}/" ${NZ_DASHBOARD_PATH}/data/config.yaml - sed -i "s/nz_site_title/${nz_site_title}/" ${NZ_DASHBOARD_PATH}/data/config.yaml - sed -i "s/nz_site_port/${nz_site_port}/" ${NZ_DASHBOARD_PATH}/docker-compose.yaml - sed -i "s/nz_grpc_port/${nz_grpc_port}/g" ${NZ_DASHBOARD_PATH}/docker-compose.yaml - sed -i "s/nz_image_url/${Docker_IMG}/" ${NZ_DASHBOARD_PATH}/docker-compose.yaml + sed -i "s/nz_oauth2_type/${nz_oauth2_type}/" /tmp/nezha-config.yaml + sed -i "s/nz_admin_logins/${nz_admin_logins}/" /tmp/nezha-config.yaml + sed -i "s/nz_grpc_port/${nz_grpc_port}/" /tmp/nezha-config.yaml + sed -i "s/nz_github_oauth_client_id/${nz_github_oauth_client_id}/" /tmp/nezha-config.yaml + sed -i "s/nz_github_oauth_client_secret/${nz_github_oauth_client_secret}/" /tmp/nezha-config.yaml + sed -i "s/nz_site_title/${nz_site_title}/" /tmp/nezha-config.yaml + sed -i "s/nz_site_port/${nz_site_port}/" /tmp/nezha-docker-compose.yaml + sed -i "s/nz_grpc_port/${nz_grpc_port}/g" /tmp/nezha-docker-compose.yaml + sed -i "s/nz_image_url/${Docker_IMG}/" /tmp/nezha-docker-compose.yaml + + mkdir -p $NZ_DASHBOARD_PATH/data + mv -f /tmp/nezha-config.yaml ${NZ_DASHBOARD_PATH}/data/config.yaml + mv -f /tmp/nezha-docker-compose.yaml ${NZ_DASHBOARD_PATH}/docker-compose.yaml echo -e "面板配置 ${green}修改成功,请稍等重启生效${plain}" diff --git a/script/install_en.sh b/script/install_en.sh index f430229..ca534b5 100755 --- a/script/install_en.sh +++ b/script/install_en.sh @@ -11,7 +11,7 @@ NZ_BASE_PATH="/opt/nezha" NZ_DASHBOARD_PATH="${NZ_BASE_PATH}/dashboard" NZ_AGENT_PATH="${NZ_BASE_PATH}/agent" NZ_AGENT_SERVICE="/etc/systemd/system/nezha-agent.service" -NZ_VERSION="v0.10.3" +NZ_VERSION="v0.10.4" red='\033[0;31m' green='\033[0;32m' @@ -278,15 +278,13 @@ modify_dashboard_config() { echo -e "> Modify Panel Configuration" echo -e "Download Docker Script" - wget -O ${NZ_DASHBOARD_PATH}/docker-compose.yaml https://${GITHUB_RAW_URL}/script/docker-compose.yaml >/dev/null 2>&1 + wget -O /tmp/nezha-docker-compose.yaml https://${GITHUB_RAW_URL}/script/docker-compose.yaml >/dev/null 2>&1 if [[ $? != 0 ]]; then echo -e "${red}Script failed to get, please check if the network can link ${GITHUB_RAW_URL}${plain}" return 0 fi - mkdir -p $NZ_DASHBOARD_PATH/data - - wget -O ${NZ_DASHBOARD_PATH}/data/config.yaml https://${GITHUB_RAW_URL}/script/config.yaml >/dev/null 2>&1 + wget -O /tmp/nezha-config.yaml https://${GITHUB_RAW_URL}/script/config.yaml >/dev/null 2>&1 if [[ $? != 0 ]]; then echo -e "${red}Script failed to get, please check if the network can link ${GITHUB_RAW_URL}${plain}" return 0 @@ -318,17 +316,20 @@ modify_dashboard_config() { nz_oauth2_type=github fi - sed -i "s/nz_oauth2_type/${nz_oauth2_type}/" ${NZ_DASHBOARD_PATH}/data/config.yaml - sed -i "s/nz_admin_logins/${nz_admin_logins}/" ${NZ_DASHBOARD_PATH}/data/config.yaml - sed -i "s/nz_grpc_port/${nz_grpc_port}/" ${NZ_DASHBOARD_PATH}/data/config.yaml - sed -i "s/nz_github_oauth_client_id/${nz_github_oauth_client_id}/" ${NZ_DASHBOARD_PATH}/data/config.yaml - sed -i "s/nz_github_oauth_client_secret/${nz_github_oauth_client_secret}/" ${NZ_DASHBOARD_PATH}/data/config.yaml - sed -i "s/nz_site_title/${nz_site_title}/" ${NZ_DASHBOARD_PATH}/data/config.yaml - sed -i "s/nz_language/en-US/" ${NZ_DASHBOARD_PATH}/data/config.yaml - sed -i "s/nz_site_port/${nz_site_port}/" ${NZ_DASHBOARD_PATH}/docker-compose.yaml - sed -i "s/nz_grpc_port/${nz_grpc_port}/g" ${NZ_DASHBOARD_PATH}/docker-compose.yaml - sed -i "s/nz_image_url/${Docker_IMG}/" ${NZ_DASHBOARD_PATH}/docker-compose.yaml + sed -i "s/nz_oauth2_type/${nz_oauth2_type}/" /tmp/nezha-config.yaml + sed -i "s/nz_admin_logins/${nz_admin_logins}/" /tmp/nezha-config.yaml + sed -i "s/nz_grpc_port/${nz_grpc_port}/" /tmp/nezha-config.yaml + sed -i "s/nz_github_oauth_client_id/${nz_github_oauth_client_id}/" /tmp/nezha-config.yaml + sed -i "s/nz_github_oauth_client_secret/${nz_github_oauth_client_secret}/" /tmp/nezha-config.yaml + sed -i "s/nz_site_title/${nz_site_title}/" /tmp/nezha-config.yaml + sed -i "s/nz_language/en-US/" /tmp/nezha-config.yaml + sed -i "s/nz_site_port/${nz_site_port}/" /tmp/nezha-docker-compose.yaml + sed -i "s/nz_grpc_port/${nz_grpc_port}/g" /tmp/nezha-docker-compose.yaml + sed -i "s/nz_image_url/${Docker_IMG}/" /tmp/nezha-docker-compose.yaml + mkdir -p $NZ_DASHBOARD_PATH/data + mv -f /tmp/nezha-config.yaml ${NZ_DASHBOARD_PATH}/data/config.yaml + mv -f /tmp/nezha-docker-compose.yaml ${NZ_DASHBOARD_PATH}/docker-compose.yaml echo -e "Dashboard configuration ${green} modified successfully, please wait for Dashboard self-restart to take effect${plain}"