diff --git a/README.md b/README.md
index 221cd15..c6a6675 100644
--- a/README.md
+++ b/README.md
@@ -1,12 +1,13 @@
diff --git a/script/install.sh b/script/install.sh
index 0175309..aec2ab6 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.4.9"
+NZ_VERSION="v0.4.10"
red='\033[0;31m'
green='\033[0;32m'
@@ -47,21 +47,21 @@ pre_check() {
echo "根据ip.sb提供的信息,当前IP可能在中国"
read -r -p "是否选用中国镜像完成安装? [Y/n] " input
case $input in
- [yY][eE][sS]|[yY])
- echo "使用中国镜像"
- CN=true
- ;;
+ [yY][eE][sS] | [yY])
+ echo "使用中国镜像"
+ CN=true
+ ;;
- [nN][oO]|[nN])
- echo "不使用中国镜像"
- ;;
- *)
- echo "使用中国镜像"
- CN=true
- ;;
+ [nN][oO] | [nN])
+ echo "不使用中国镜像"
+ ;;
+ *)
+ echo "使用中国镜像"
+ CN=true
+ ;;
esac
fi
-
+
if [[ -z "${CN}" ]]; then
GITHUB_RAW_URL="raw.githubusercontent.com/naiba/nezha/master"
GITHUB_URL="github.com"
@@ -72,8 +72,6 @@ pre_check() {
GITHUB_URL="dn-dao-github-mirror.daocloud.io"
Get_Docker_URL="get.daocloud.io/docker"
Get_Docker_Argu=" -s docker --mirror Aliyun"
- echo "写入/etc/hosts 52.68.132.128 ghcr.io"
- echo "52.68.132.128 ghcr.io" >> /etc/hosts
fi
}
diff --git a/service/dao/dao.go b/service/dao/dao.go
index ec385f8..a68d2b1 100644
--- a/service/dao/dao.go
+++ b/service/dao/dao.go
@@ -13,7 +13,7 @@ import (
pb "github.com/naiba/nezha/proto"
)
-var Version = "v0.4.14" // !!记得修改 README 重的 badge 版本!!
+var Version = "v0.4.15" // !!记得修改 README 重的 badge 版本!!
const (
SnapshotDelay = 3
diff --git a/service/rpc/nezha.go b/service/rpc/nezha.go
index ac23add..6539f9b 100644
--- a/service/rpc/nezha.go
+++ b/service/rpc/nezha.go
@@ -3,6 +3,7 @@ package rpc
import (
"context"
"fmt"
+ "log"
"strings"
"time"
@@ -27,7 +28,7 @@ func (s *NezhaHandler) ReportTask(c context.Context, r *pb.TaskResult) (*pb.Rece
if strings.HasPrefix(r.GetData(), "SSL证书错误:") {
// 排除 i/o timeont、connection timeout、EOF 错误
if !strings.HasSuffix(r.GetData(), "timeout") &&
- r.GetData() != "EOF" &&
+ !strings.HasSuffix(r.GetData(), "EOF") &&
!strings.HasSuffix(r.GetData(), "timed out") {
errMsg = r.GetData()
}
@@ -130,7 +131,9 @@ func (s *NezhaHandler) ReportSystemInfo(c context.Context, r *pb.Host) (*pb.Rece
host := model.PB2Host(r)
dao.ServerLock.RLock()
defer dao.ServerLock.RUnlock()
+ log.Println(dao.Conf.IgnoredIPNotificationServerIDs)
if dao.Conf.EnableIPChangeNotification &&
+ dao.Conf.IgnoredIPNotificationServerIDs[clientID] != struct{}{} &&
dao.ServerList[clientID].Host != nil &&
dao.ServerList[clientID].Host.IP != "" &&
host.IP != "" &&