CasaOS - A simple, easy-to-use, elegant open-source Personal Cloud system.
Add zertier (#1124)
linkdda15b082165
diff --git a/route/init.go b/route/init.goindex 3e3c640..697d9ad 100644--- a/route/init.go+++ b/route/init.go@@ -24,6 +24,7 @@ import ("github.com/IceWhaleTech/CasaOS/pkg/samba""github.com/IceWhaleTech/CasaOS/pkg/utils/encryption""github.com/IceWhaleTech/CasaOS/pkg/utils/file"+ v1 "github.com/IceWhaleTech/CasaOS/route/v1""github.com/IceWhaleTech/CasaOS/service""go.uber.org/zap")@@ -31,6 +32,7 @@ import (func InitFunction() {go InitNetworkMount()go InitInfo()+ go InitZerotier()}func InitInfo() {@@ -98,3 +100,6 @@ func InitNetworkMount() {logger.Error("mount storage err", zap.Any("err", err))}}+func InitZerotier() {+ v1.CheckNetwork()+}diff --git a/route/v1.go b/route/v1.goindex 12be472..a5648d9 100644--- a/route/v1.go+++ b/route/v1.go@@ -40,7 +40,7 @@ func InitV1Router() *gin.Engine {})r.GET("/v1/recover/:type", v1.GetRecoverStorage)v1Group := r.Group("/v1")- r.Any("/v1/test", v1.CheckNetwork)+ // r.Any("/v1/test", v1.CheckNetwork)v1Group.Use(jwt.ExceptLocalhost(func() (*ecdsa.PublicKey, error) { return external.GetPublicKey(config.CommonInfo.RuntimePath) })){diff --git a/route/v1/zerotier.go b/route/v1/zerotier.goindex ce336e3..0def71f 100644--- a/route/v1/zerotier.go+++ b/route/v1/zerotier.go@@ -75,7 +75,8 @@ func copyHeaders(destination, source http.Header) {}}-func CheckNetwork(c *gin.Context) {+func CheckNetwork() {+//先获取所有已创建的网络respBody, err := httper.ZTGet("/controller/network")if err != nil {