add GRPCHost config

This commit is contained in:
Zhu Rengen
2021-08-10 14:04:21 +08:00
parent 0ace140df7
commit 39cdfbf6cd
6 changed files with 82 additions and 3 deletions

View File

@@ -2,6 +2,7 @@ package main
import (
"context"
"github.com/naiba/nezha/util"
"log"
"time"
@@ -46,6 +47,9 @@ func init() {
if dao.Conf.GRPCPort == 0 {
dao.Conf.GRPCPort = 5555
}
if dao.Conf.GRPCHost == "" {
dao.Conf.GRPCHost = util.FetchGeoIP(false).IP
}
dao.Cache = cache.New(5*time.Minute, 10*time.Minute)
initSystem()