可选的通知信息 IP 不打码

This commit is contained in:
naiba
2022-02-19 14:29:06 +08:00
parent e82ffd466a
commit 520f8d2170
7 changed files with 49 additions and 30 deletions

View File

@@ -10,10 +10,11 @@ import (
"gorm.io/gorm"
"github.com/naiba/nezha/model"
"github.com/naiba/nezha/pkg/utils"
pb "github.com/naiba/nezha/proto"
)
var Version = "v0.12.9" // !!记得修改 README 中的 badge 版本!!
var Version = "v0.12.10" // !!记得修改 README 中的 badge 版本!!
var (
Conf *model.Config
@@ -84,3 +85,10 @@ func CronTrigger(cr model.Cron) func() {
}
}
}
func IPDesensitize(ip string) string {
if Conf.EnablePlainIPInNotification {
return ip
}
return utils.IPDesensitize(ip)
}