Skip to content

CasaOS - A simple, easy-to-use, elegant open-source Personal Cloud system.

Add zertier (#1137)

linkc9617e583f87
diff --git a/route/v1/zerotier.go b/route/v1/zerotier.go
index 0def71f..a2ca1b3 100644
--- a/route/v1/zerotier.go
+++ b/route/v1/zerotier.go
@@ -76,7 +76,6 @@ func copyHeaders(destination, source http.Header) {
}
func CheckNetwork() {
-
//先获取所有已创建的网络
respBody, err := httper.ZTGet("/controller/network")
if err != nil {
diff --git a/route/v2/zerotier.go b/route/v2/zerotier.go
index 03d8ae4..f27d420 100644
--- a/route/v2/zerotier.go
+++ b/route/v2/zerotier.go
@@ -13,7 +13,7 @@ import (
)
func (s *CasaOS) SetZerotierNetworkStatus(ctx echo.Context, networkId string) error {
- ip := `,"via":"10.147.20.256"`
+ ip := `,"via":"10.147.19.0"`
status := ctx.Request().PostFormValue("status")
if status == "online" {
ip = ``
@@ -34,7 +34,7 @@ func (s *CasaOS) SetZerotierNetworkStatus(ctx echo.Context, networkId string) er
via := gjson.GetBytes(res, "routes.0.via").Str
info.Id = utils.Ptr(gjson.GetBytes(res, "id").Str)
info.Name = utils.Ptr(gjson.GetBytes(res, "name").Str)
- if len(via) != 0 {
+ if len(via) == 0 {
info.Status = utils.Ptr("online")
} else {
info.Status = utils.Ptr("offline")